python 3 install fails due to README encoding

Bug #982600 reported by Mike Bayer on 2012-04-15
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Python Memcached
Undecided
Unassigned

Bug Description

in the Python 3 version available at http://pypi.python.org/pypi/python3-memcached/1.44, the first line of the README file contains a non-ascii character which causes invocation of setup.py to fail:

$ python3 setup.py install
Traceback (most recent call last):
  File "setup.py", line 9, in <module>
    long_description=open("README").read(),
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 63: ordinal not in range(128)

removing the first line of the README fixes the issue, or adding an encoding to the open() statement in setup.py:

long_description=open("README", encoding='utf-8').read()

Mike Bayer (zzzeek) wrote :

actually the install still fails later on even if the long_description is fixed...

  File "setup.py", line 24, in <module>
    "Topic :: Software Development :: Libraries :: Python Modules",
  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.24-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.24-py3.2.egg/setuptools/command/install.py", line 93, in do_egg_install
    self.run_command('bdist_egg')
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  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.24-py3.2.egg/setuptools/command/bdist_egg.py", line 172, in run
    self.run_command("egg_info")
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  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.24-py3.2.egg/setuptools/command/egg_info.py", line 172, in run
    writer(self, ep.name, os.path.join(self.egg_info,ep.name))
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/egg_info.py", line 384, in write_pkg_info
    metadata.write_pkg_info(cmd.egg_info)
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/dist.py", line 1015, in write_pkg_info
    self.write_pkg_file(pkg_info)
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/dist.py", line 1038, in write_pkg_file
    file.write('Description: %s\n' % long_desc)
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 76: ordinal not in range(128)

Marius Gedminas (mgedmin) wrote :

I'm unable to reproduce on Ubuntu 12.10:

    virtualenv -p python3.3 /tmp/e33
    /tmp/e33/bin/pip install python3-memcached
    Downloading/unpacking python3-memcached
      Downloading python3-memcached-1.44.tar.gz
      Running setup.py egg_info for package python3-memcached

    Installing collected packages: python3-memcached
      Running setup.py install for python3-memcached

    Successfully installed python3-memcached
    Cleaning up...

Marius Gedminas (mgedmin) wrote :

Scratch that, I can reproduce if I switch to a non-UTF-8 locale:

    LC_ALL=C /tmp/e33/bin/pip install -I python3-memcached
    Downloading/unpacking python3-memcached
    ...
      Running setup.py egg_info for package python3-memcached
        Traceback (most recent call last):
          File "<string>", line 16, in <module>
          File "/tmp/e33/build/python3-memcached/setup.py", line 9, in <module>
            long_description=open("README").read(),
          File "/tmp/e33/lib/python3.3/encodings/ascii.py", line 26, in decode
            return codecs.ascii_decode(input, self.errors)[0]
        UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 63: ordinal not in range(128)
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):

      File "<string>", line 16, in <module>

      File "/tmp/e33/build/python3-memcached/setup.py", line 9, in <module>

        long_description=open("README").read(),

      File "/tmp/e33/lib/python3.3/encodings/ascii.py", line 26, in decode

        return codecs.ascii_decode(input, self.errors)[0]

    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 63: ordinal not in range(128)

    ----------------------------------------
    Command python setup.py egg_info failed with error code 1 in /tmp/e33/build/python3-memcached
    Storing complete log in /home/mg/.pip/pip.log

Sean Reifschneider (jafo) wrote :

This bug is not relevant to python-memcached, it is the python3 port of it, which is a separate item apparently by Eren Güven. I don't control that package at all, though I would like to see what needs to happen to merge it, if possible.

Changed in python-memcached:
status: New → Invalid
Mike Bayer (zzzeek) wrote :

OK is there a bug tracker for the Python 3 port, the pypi page https://pypi.python.org/pypi/python3-memcached/1.44 leads directly to http://www.tummy.com/software/python-memcached/ and then to this launchpad project. Or do we email Eren directly, and if so what email address?

Sean Reifschneider (jafo) wrote :

I'm afraid I have no idea, before yesterday when I looked at this bug, I hadn't heard anything about that version of it.

Sean

Mike Bayer (zzzeek) wrote :

there's a github link there. Wonder if I missed that, or if it's been added. will bug him over there thanks

Eren Güven (eguven) wrote :

This has been fixed, sorry for the confusion about Python3 version.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers