Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

Wong Wah Meng-R32813 r32813 at freescale.com
Mon Oct 3 02:45:25 EDT 2011


Hello guys,

I am migrating my application from python 1.5.2 to 2.7.1. I encountered an error when I run some commands (I put in debug statement however, not able to trace down to which line of code that cause it to generate a lot of messages in one second until my hard disk space is full. The error log I got in my log file is as below:-

Oct  3 14:12:41  ('Encountered exception while processing from', (0, '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'), <type 'exceptions.TypeError'>, TypeError('exceptions must be old-style classes or derived from BaseException, not str',))

Does it mean in newer python I need to migrate all my Exception to non-string based exception type? That's should be a lot of changes. :p

Regards,
Wah Meng






More information about the Python-list mailing list