Python 3 and non-ASCII in

Create issue
Issue #310 resolved
Walter Dörwald created an issue

I'm trying to install XIST 4.0 with distribute and get the following error:

{{{ #!shell

$ easy_install-3.2 -Z ll-xist==4.0 Searching for ll-xist==4.0 Reading Reading Reading Reading Best match: ll-xist 4.0 Downloading Processing Writing /tmp/easy_install-09ld7l/ll-xist-4.0/setup.cfg Running ll-xist-4.0/ -q bdist_egg --dist-dir /tmp/easy_install-09ld7l/ll-xist-4.0/egg-dist-tmp-xsxpm1 Traceback (most recent call last): File "/usr/local/bin/easy_install-3.2", line 9, in <module> load_entry_point('distribute==0.6.28', 'console_scripts', 'easy_install-3.2')() [...] File "/usr/local/lib/python3.2/distutils/command/", line 300, in get_source_files return [module[-1] for module in self.find_all_modules()] File "/usr/local/lib/python3.2/distutils/command/", line 295, in find_all_modules m = self.find_package_modules(package, package_dir) File "/usr/local/lib/python3.2/distutils/command/", line 217, in find_package_modules self.check_package(package, package_dir) File "/usr/local/lib/python3.2/site-packages/distribute-0.6.28-py3.2.egg/setuptools/command/", line 220, in check_package if 'declare_namespace' not in File "/usr/local/lib/python3.2/encodings/", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 118: ordinal not in range(128) }}}

The problem seems to be that src/ll/ contains non-ASCII characters. However it also contains a proper # -- coding: utf-8 -- line (which should be neccessary with Python 3)

Comments (7)

  1. Lennart Regebro

    A much easier way to solve this is to open the file in binary mode. Works for every encoding. :-)

  2. Log in to comment