Tarek Ziadé <[EMAIL PROTECTED]> added the comment:
> For writing the metadata, we don't need to make any assumptions. We
> can just write the bytes as-is. This is how distutils has behaved
> for many releases now, and this is how users have been using it.
But write_pkg_file will use ascii encoding if we don't indicate it
here:
>>> pkg_info.write('Author: %s\n' % self.get_contact() )
So wouldn't a light fix in write_pkg_file() would be sufficient when a
unicode(field) fails, as MAL mentioned ? by trying utf8:
>>> try:
... pkg_info.write('Author: %s\n' % self.get_contact() )
... except UnicodeEncodeError:
... pkg_info.write('Author: %s\n' % self.get_contact().encode('utf8') )
As far as I know, this simple change will not impact people and will
just make it possible to use Unicode. And everything will be fine under
Py3K as it is now.
But I don't know yet how this would impact 3rd party softwares that reads
the egg-info file. But like MAL said, they will have to get fixed as well.
__________________________________
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