Opened 3 years ago

#12982 new Bug Report - General

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 (0)

Note: See TracTickets for help on using tickets.