Opened 4 years ago

Closed 8 months ago

#12982 closed Bug Report - General (Unverified)

python functions shouldn't be able to return single values or tuples

Reported by: brian@… Owned by: Raymond Wagner
Priority: minor Milestone: unknown
Component: Bindings - Python Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no


In the getSGList() function can return either an integer or a list of strings or a tuple of lists of strings.

How is a caller supposed to be able to deal with that? A caller will typically want to do:

    dirs,files,sizes = BE.getSGList(host, sg.groupname, sg.dirname)

But that will cause an exception when the return value is one of the -1, or -2 values. -1 could be quite common for an empty SG for example so it's not like it's even limited to error situations strictly.

I wonder how many other functions have this kind of problem.

Change History (1)

comment:1 Changed 8 months ago by Stuart Auchterlonie

Resolution: Unverified
Status: newclosed

Closing all old tickets in trac.

If your issue still persists, please open an issue in Github

and reference the existing trac ticket.

Note: See TracTickets for help on using tickets.