Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "surrogateescape" error handler when encoding unicode paths. #3

Merged
merged 1 commit into from May 23, 2014

Conversation

jborg
Copy link
Contributor

@jborg jborg commented Jun 13, 2013

On Python 3 functions like os.listdir() always returns unicode
paths. "invalid" byte paths are decoded using the "surrogateescape" error
handler which must also be used when decoding.
See os.fsencodefs() and os.fsdecode().

On Python 3 functions like os.listdir() always returns unicode
paths. "invalid" byte paths are decoded using the "surrogateescape" error
handler which must also be used when decoding.
See os.fsencodefs() and os.fsdecode().
@iustin
Copy link
Owner

iustin commented May 23, 2014

Hmm, I don't like too much the "silent" handling of errors via surogateescape, but if Python itself does this, then it's good enough.

iustin added a commit that referenced this pull request May 23, 2014
Use "surrogateescape" error handler when encoding unicode paths.
@iustin iustin merged commit 3843148 into iustin:master May 23, 2014
@iustin
Copy link
Owner

iustin commented May 23, 2014

Released in version 0.5.3 (https://pypi.python.org/pypi/pyxattr/0.5.3). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants