[mythtv-users] Problem deleting recordings with find_orphans.py NameError: global name 'NoneType' is not defined

Eric Sharkey eric at lisaneric.org
Thu Aug 25 20:30:21 UTC 2011


On Thu, Aug 25, 2011 at 4:18 PM, Eric Sharkey <eric at lisaneric.org> wrote:
> On Thu, Aug 25, 2011 at 11:22 AM, Raymond Wagner <raymond at wagnerrp.com> wrote:
>> This is an unavoidable but otherwise benign race condition.
>
> To me, it looks like a bug in the python bindings.
>
> This thread:
>
> http://www.gossamer-threads.com/lists/python/python/656839
>
> implies that doing "except NoneType" is just broken python.  I'm not
> experienced enough in python to judge.

Changing except NoneType to except Exception moves the error to here:

Traceback (most recent call last):
  File "/usr/local/bin/find_orphans.py", line 230, in <module>
    main()
  File "/usr/local/bin/find_orphans.py", line 214, in main
    opt[1](opt[2])
  File "/usr/local/bin/find_orphans.py", line 136, in delete_recs
    name = u'{0.hostname}: {0.title}'.format(self)
NameError: global name 'self' is not defined

Which appears to be more squarely in the exception handling code you
recently added.

Eric


More information about the mythtv-users mailing list