Éric Araujo <mer...@netwok.org> added the comment: Duh, obviously that code branch is used only for unicode paths:
>>> open('/tmp/t\nest', 'w') <open file '/tmp/t est', mode 'w' at 0x7f6f0f3dd9c0> >>> open(u'/tmp/t\nest', 'w') <open file u'/tmp/t\nest', mode 'w' at 0x7f6f0f3dda50> There does not seem to be something similar in http://docs.python.org/c-api/string, so I guess one would have to create intermediary objects to decode str to unicode, transform with unicode-escape and convert back to str. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14161> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com