Opened 16 years ago

Closed 16 years ago

#1046 closed defect (fixed)

[patch]syndication_feeds's bug for TypeError

Reported by: junzhang.jn@… Owned by: Adrian Holovaty
Component: contrib.syndication Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


at's line 35:

if callable(attr):
        return attr(obj)
    except TypeError:
        return attr()

this code will hide TypeError that zhe 'attr(obj)' function throws.
so , i use below code to fix the little bug.

if callable(attr):
    if hasattr( attr , 'func_code' ):
        argcount = attr.func_code.co_argcount
        argcount = attr.__call__.func_code.co_argcount
    if argcount == 2:
        # one is self
        return attr(obj)
        return attr()

Change History (1)

comment:1 Changed 16 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [2341]) Fixed #1046 -- Made syndication feed framework not swallow TypeErrors in functions. Thanks, junzhang.jn

Note: See TracTickets for help on using tickets.
Back to Top