Issue #232 resolved

setuptools.commands.easy_install.get_script_header throws TypeError on py3.2

Steve Johnson
created an issue

You guys have this:

{{{

!python

setuptoos.commands.easy_install

line 1585-ish

def get_script_header(script_text, executable=sys_executable, wininst=False): """Create a #! line, getting options (if any) from script_text""" from distutils.command.build_scripts import first_line_re first = (script_text+'\n').splitlines()[0] match = first_line_re.match(first) }}}

The last line should actually be:

{{{

!python

match = first_line_re.match(first.encode('UTF-8')) }}}

I didn't submit a patch because I figured someone with the whole environment set up already could apply it with much less work.

This bug makes it impossible to install pip without modifying the file. Exception when doing "python setup.py install" for pip 1.0.2:

{{{ Traceback (most recent call last): File "setup.py", line 55, in <module> zip_safe=False) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/core.py", line 148, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/dist.py", line 917, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/dist.py", line 936, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/setuptools/command/install.py", line 73, in run self.do_egg_install() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/setuptools/command/install.py", line 101, in do_egg_install cmd.run() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/setuptools/command/easy_install.py", line 342, in run self.easy_install(spec, not self.no_deps) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/setuptools/command/easy_install.py", line 562, in easy_install return self.install_item(None, spec, tmpdir, deps, True) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/setuptools/command/easy_install.py", line 614, in install_item self.process_distribution(spec, dist, deps) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/setuptools/command/easy_install.py", line 643, in process_distribution self.install_egg_scripts(dist) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/setuptools/command/easy_install.py", line 513, in install_egg_scripts self.install_wrapper_scripts(dist) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/setuptools/command/easy_install.py", line 717, in install_wrapper_scripts for args in get_script_args(dist): File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/setuptools/command/easy_install.py", line 1738, in get_script_args header = get_script_header("", executable, wininst) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/setuptools/command/easy_install.py", line 1590, in get_script_header match = first_line_re.match(first) TypeError: can't use a bytes pattern on a string-like object }}}

Edit: first code block was wrong

Edit: traceback

Comments (5)

  1. Log in to comment