This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tarek
Recipients lemburg, loewis, tarek
Date 2008-04-08.20:39:50
SpamBayes Score 0.01968561
Marked as misclassified No
Message-id <1207687191.45.0.790454985231.issue2562@psf.upfronthosting.co.za>
In-reply-to
Content
>>>> pkg_info.write('Author: %s\n' % self.get_contact() )
> Why do you say that it uses ascii? It uses whatever encoding the string
> returned by get_contact uses. See the attached P1-1.0.tar.gz for an
> example. This doesn't use ASCII, and doesn't use UTF-8, and works with
> 2.4.


This happens of course only when get_contact returns an unicode.
It uses the ascii codec by default. Here's an example:

>>> contact = u'Barnabé'
>>> f = open('/tmp/test', 'w')
>>> f.write('Author: %s' % contact)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 14: ordinal not in range(128)

> That would work - although I fail to see what this has to do with
> a failing unicode(field). Instead, it has rather to do with a failing
> .write().

Absolutely, I was focusing on write_pkg_file() method that fails
when the egg-info file is written.
History
Date User Action Args
2008-04-08 20:39:52tareksetspambayes_score: 0.0196856 -> 0.01968561
recipients: + tarek, lemburg, loewis
2008-04-08 20:39:51tareksetspambayes_score: 0.0196856 -> 0.0196856
messageid: <1207687191.45.0.790454985231.issue2562@psf.upfronthosting.co.za>
2008-04-08 20:39:50tareklinkissue2562 messages
2008-04-08 20:39:50tarekcreate