[issue25997] Tarfile.add with bytes path is failing

Martin Panter report at bugs.python.org
Sat Jan 2 19:16:35 EST 2016


Martin Panter added the comment:

It looks like surrogate-escaped bytes should be supported thanks to Issue 8390, although this is not so useful if you use the “pax” format (which always uses UTF-8 internally).

To generate a surrogate-escaped string, you can “decode” it with the following error handler:

>>> b"non-as\xA9ii".decode("ascii", "surrogateescape")
'non-as\udca9ii'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25997>
_______________________________________


More information about the Python-bugs-list mailing list