Tarek Ziadé <[EMAIL PROTECTED]> added the comment: >>>> 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. __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2562> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com