Opened 13 months ago

#12982 new Bug Report - General

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

Reported by: brian@… Owned by: wagnerrp
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.

Attachments (0)

Change History (0)

Add Comment

Modify Ticket

as new The owner will remain wagnerrp.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.