Message65214
>>>> 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. |
|
| Date |
User |
Action |
Args |
| 2008-04-08 20:39:52 | tarek | set | spambayes_score: 0.0196856 -> 0.0196856 recipients:
+ tarek, lemburg, loewis |
| 2008-04-08 20:39:51 | tarek | set | spambayes_score: 0.0196856 -> 0.0196856 messageid: <1207687191.45.0.790454985231.issue2562@psf.upfronthosting.co.za> |
| 2008-04-08 20:39:50 | tarek | link | issue2562 messages |
| 2008-04-08 20:39:50 | tarek | create | |
|