[Distutils] unicode bug in distutils
Tres Seaver
tseaver at palladion.com
Sat Feb 24 23:45:38 CET 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Tarek Ziadé wrote:
> On 2/24/07, Paul Pogonyshev <pogonyshev at gmx.net> wrote:
>> Tarek Ziadé wrote:
>>> I have created a setup.py file for distirbution and I bumped into
>>> a small bug when i tried to set my name in the contact field (Tarek
>> Ziadé)
>>> Using string (utf8 file):
>>>
>>> setup(
>>> maintainer="Tarek Ziadé"
>>> )
>> How about maintainer = u"Tarek Ziadé"?
>
>
> see second part of my message:
>
> Using unicode:
>
> setup(
> maintainer=u"Tarek Ziadé"
> )
>
> leads to:
>
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py",
> line 1094, in write_pkg_file
> file.write('Author: %s\n' % self.get_contact() )
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position
> 18: ordinal not in range(128)
Don't you still need to tell Python about the encoding of your string
literals [1] [2] ? E.g.::
# -*- coding: utf-8 -*-
#vim:fileencoding=utf-8 -*-
print "Tarek Ziadé"
[1] http://docs.python.org/ref/encodings.html#encodings
[2] http://docs.python.org/ref/strings.html
Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF4MAS+gerLs4ltQ4RAn2FAJ0XLaZOuOaAjLpOygBXx3MmxWnY5ACgpWlw
xTllHr/4WeIq1fU74rXcuqg=
=Cam9
-----END PGP SIGNATURE-----
More information about the Distutils-SIG
mailing list