Message65158
> 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. |
|
| Date |
User |
Action |
Args |
| 2008-04-08 13:26:24 | tarek | set | spambayes_score: 0.00545841 -> 0.00545841 recipients:
+ tarek, lemburg, loewis |
| 2008-04-08 13:26:24 | tarek | set | spambayes_score: 0.00545841 -> 0.00545841 messageid: <1207661184.56.0.396312221678.issue2562@psf.upfronthosting.co.za> |
| 2008-04-08 13:26:16 | tarek | link | issue2562 messages |
| 2008-04-08 13:26:15 | tarek | create | |
|