Issue #113 resolved

LookupError: unknown encoding on install under OsX 10.8.5

coolnodje
created an issue

I'm attempting a first time install according to according to the doc:

sudo wget --no-check-certificate https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | sudo python

but the following error occurs:

Extracting in /tmp/tmpMfVhxV
Now working in /tmp/tmpMfVhxV/setuptools-1.4
Installing Setuptools
running install
running bdist_egg
running egg_info
writing dependency_links to setuptools.egg-info/dependency_links.txt
writing requirements to setuptools.egg-info/requires.txt
writing setuptools.egg-info/PKG-INFO
writing top-level names to setuptools.egg-info/top_level.txt
writing entry points to setuptools.egg-info/entry_points.txt
Traceback (most recent call last):
  File "setup.py", line 204, in <module>
    dist = setuptools.setup(**setup_params)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/command/install.py", line 73, in run
    self.do_egg_install()
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/command/install.py", line 93, in do_egg_install
    self.run_command('bdist_egg')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/command/bdist_egg.py", line 177, in run
    self.run_command("egg_info")
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/command/egg_info.py", line 187, in run
    self.find_sources()
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/command/egg_info.py", line 230, in find_sources
    mm.run()
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/command/egg_info.py", line 296, in run
    self.add_defaults()
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/command/egg_info.py", line 335, in add_defaults
    rcfiles = list(walk_revctrl())
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/command/sdist.py", line 18, in walk_revctrl
    for item in ep.load()(dirname):
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/command/sdist.py", line 58, in _default_revctrl
    for item in finder(dirname):
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/svn_utils.py", line 419, in svn_finder
    info = SvnInfo.load(dirname)
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/svn_utils.py", line 221, in load
    code, data = _run_command(['svn', 'info', normdir])
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/svn_utils.py", line 41, in _run_command
    data = decode_as_string(data, encoding)
  File "/private/tmp/tmpMfVhxV/setuptools-1.4/setuptools/svn_utils.py", line 93, in decode_as_string
    text = text.decode(encoding)
LookupError: unknown encoding: 
Something went wrong during the installation.
See the error message above.

Comments (7)

  1. philip_thiem

    what does

    python -c "import locale; print(locale.getpreferredencoding())"
    

    return? (If you would check please). This is likely related to the other Mac Encoding bug, just your setup/python version is likely different. So it would be useful for me to know.

  2. philip_thiem

    https://bitbucket.org/pypa/setuptools/pull-request/26/svn-encoding-issues/diff Basically for determining the terminal encoding:

    1. Try getpreferredencoding
    2. If that is US_ASCII or None try the encoding from getdefaultlocale() if that was a "fallback" because python couldn't figure it out from the environment or OS, this wll result in None.
    3. If not none, then make sure python actually knows about the encoding.
    4. On the event of an error or unknown codec, revert to fallbacks
    5. That is, on darwin try utf-8 everything else ASCII. Also on the darwin and mac-roman, switch to utf-8 this was a bug on older pythons.
  3. Log in to comment