classification
Title: Write pkg_info with local encoding(GBK) will be a problem.
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.2
process
Status: closed Resolution: duplicate
Dependencies: Superseder: distutils: set encoding to utf-8 for input and output files
View: 9561
Assigned To: eric.araujo Nosy List: eric.araujo, tarek, 勇刚.罗
Priority: normal Keywords:

Created on 2012-02-15 16:58 by 勇刚.罗, last changed 2012-02-15 17:05 by eric.araujo. This issue is now closed.

Messages (2)
msg153415 - (view) Author: 勇刚 罗 (勇刚.罗) Date: 2012-02-15 16:58
D:\CI\bld\vcs\pygit2>python setup.py install
Find C:\Python32\python.exe
Using C:\Python32\python.exe
running install
running bdist_egg
running egg_info
writing pygit2.egg-info\PKG-INFO
Traceback (most recent call last):
  File "setup.py", line 106, in <module>
    **kwargs)
  File "C:\Python32\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Python32\lib\distutils\dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "C:\Python32\lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "C:\Python32\lib\site-packages\distribute-0.6.24-py3.2.egg\setuptools\command\install.py", line 73, in run
    self.do_egg_install()
  File "C:\Python32\lib\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 "C:\Python32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Python32\lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "C:\Python32\lib\site-packages\distribute-0.6.24-py3.2.egg\setuptools\command\bdist_egg.py", line 172, in run
    self.run_command("egg_info")
  File "C:\Python32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Python32\lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "C:\Python32\lib\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 "C:\Python32\lib\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 "C:\Python32\lib\distutils\dist.py", line 1015, in write_pkg_info
    self.write_pkg_file(pkg_info)
  File "C:\Python32\lib\distutils\dist.py", line 1031, in write_pkg_file
    file.write('Author: %s\n' % self.get_contact() )
UnicodeEncodeError: 'gbk' codec can't encode character '\xf1' in position 20: illegal multibyte sequence

D:\CI\bld\vcs\pygit2>
It's better to use utf8 instead.
msg153416 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-15 17:05
Hi.  This code was changed to use UTF-8 as you recommend.  The next version of Python 3.2 should have the fix.  You can get this version from hg.python.org (see instructions in the devguide) and see if your problem is gone.  Thanks for the report anyway!
History
Date User Action Args
2012-02-15 17:05:31eric.araujosetstatus: open -> closed

superseder: distutils: set encoding to utf-8 for input and output files
assignee: tarek -> eric.araujo
messages: + msg153416
type: crash -> behavior
resolution: duplicate
stage: resolved
2012-02-15 16:58:44勇刚.罗create