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 vstinner
Recipients arjennienhuis, barry, benjamin.peterson, christian.heimes, durin42, ecir.hana, eric.smith, exarkun, ezio.melotti, flox, glyph, gregory.p.smith, gvanrossum, loewis, martin.panter,, pitrou, serhiy.storchaka, stendec, terry.reedy, uau, vstinner
Date 2013-10-08.21:24:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
2013/10/8 Augie Fackler <>:
> sys.stdout.write('%(state)s %(path)s\n' % {'state': 'M', 'path':
> 'some/filesystem/path'})
> except we don't know the encoding of the filesystem path (Hi unix!) so we
> have to treat the whole thing as opaque bytes.

You are doing it wrong. In Python 3, you "should" store filenames as
Unicode (str type). If Python fails to decode a filename, undecodable
bytes are stored as surrogate characters (see the PEP 383).

The Unicode type became natural in Python 3, as byte string (old "str"
type) was natural in Python 2.

sys.stdout.write() expects a Unicode string, not a byte string.

Does it mean that Mercurial is moving to Python 3? Cool :-)
Date User Action Args
2013-10-08 21:24:53vstinnersetrecipients: + vstinner, gvanrossum, loewis, barry, terry.reedy, gregory.p.smith, exarkun, pitrou, eric.smith, christian.heimes, benjamin.peterson, glyph, ezio.melotti, durin42, arjennienhuis, flox, ecir.hana, uau, martin.panter, serhiy.storchaka,, stendec
2013-10-08 21:24:53vstinnerlinkissue3982 messages
2013-10-08 21:24:53vstinnercreate