distutils: upload fails if maintainer name is unicode

Hello, when I run "python setup.py sdist upload" on my package, it fails with the following traceback: Traceback (most recent call last): File "setup.py", line 86, in <module> cmdclass=cmdclass) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 152, in setup dist.run_commands() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 987, in run_commands self.run_command(cmd) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 1007, in run_command cmd_obj.run() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/command/upload.py", line 57, in run self.upload_file(command, pyversion, filename) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/command/upload.py", line 135, in upload_file value = str(value) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128) I'm running Python 2.6.4 on mac os X. Note also that I could register the package on pypi without any problem. Apparently, the problem occurs because of the maintainer=u'Sébastien BARTHÉLEMY' argument to the setup command. This seems to be a known problem : http://bugs.python.org/issue1076233 http://stackoverflow.com/questions/1162338/whats-the-right-way-to-use-unicod... If I read well, it should be fixed in 2.6. Can you confirm this problem is (at least officially) fixed for python 2.6.4 ? Any idea or workaround ? Thanks Sébastien

HI Sébastien, 2010/3/18 Sébastien Barthélemy <barthelemy@crans.org>: [..]
If I read well, it should be fixed in 2.6. Can you confirm this problem is (at least officially) fixed for python 2.6.4 ? Any idea or workaround ?
This bug was fixed for the register command some time ago, and I've fixed the upload command recently (r77719), so you can expect 2.6.5 to behave correctly for that matter. (2.6.5 is coming out very soon) Regards Tarek -- Tarek Ziadé | http://ziade.org

On Thu, Mar 18, 2010 at 10:48 AM, Sébastien Barthélemy <barthelemy@crans.org> wrote:
Hello Tarek,
thank you for the fast reply. I guess I'll just wait.
If you need it today, and you control your python installation, the patch is quite simple to do (one liner) let me know if you want it,
Regards
-- Tarek Ziadé | http://ziade.org
participants (2)
-
Sébastien Barthélemy
-
Tarek Ziadé