[Distutils] is_python should catch TypeError

Phillip J. Eby pje at telecommunity.com
Sat Feb 17 18:57:06 CET 2007


At 12:00 PM 2/17/2007 -0500, Matt Good wrote:
>I just got an error trying to upgrade SilverCity from easy_install:
>
>   File 
> "/usr/lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/setuptools/command/easy_install.py", 
> line 1462, in is_python
>     compile(text, filename, 'exec')
>TypeError: compile() expected string without null bytes
>
>You can reproduce it easily:
> >>> from setuptools.command.easy_install import is_python
> >>> is_python('\0')
>
>The fix is simply to add TypeError to the except clause along with
>SyntaxError.

Added for 0.6c6.  Thanks!



More information about the Distutils-SIG mailing list