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 pitrou
Recipients bru, docs@python, ncoghlan, pitrou
Date 2015-04-11.22:02:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Interesting. The doc is wrong here: pathlib was designed so that it only accepts text strings.

> If I use "surrogateescape" (see PEP383) how can I display the
> fake-unicode path to the user? `print()` does seems to use strict
> encoding. Should I encode it with "surrogateescape" or "ignore" myself 
> beforehand?

Yes, you should probably encode it yourself. If you are sure your terminal can eat the original bytestring, then use "surrogateescape". Otherwise, "replace" sounds better so that the user knows there are some undecodable characters out there.
Date User Action Args
2015-04-11 22:02:08pitrousetrecipients: + pitrou, ncoghlan, docs@python, bru
2015-04-11 22:02:08pitrousetmessageid: <>
2015-04-11 22:02:08pitroulinkissue23904 messages
2015-04-11 22:02:08pitroucreate