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

Handle byte sequences as paths too #183

Open
StyXman opened this issue Nov 15, 2019 · 0 comments
Open

Handle byte sequences as paths too #183

StyXman opened this issue Nov 15, 2019 · 0 comments

Comments

@StyXman
Copy link

StyXman commented Nov 15, 2019

I know this is going to be closed a EWONTFIX, but I have to try.

I do work with legacy software and migrations. I know that Unicode/UTF-8 has been the default for ages, but Latin-1 still lurks in the dark guts of old, don't-break institutions (banks, government, etc). There are gazillion of misencoded/never converted filenames, so trying to do pathname = pathname.encode(sys.getfilesystemencoding()) here leads to things like:

UnicodeEncodeError: 'utf-8' codec can't encode character '\udce1' in position 32: surrogates not allowed

Again, this is not in any way your fault, just not handling someone else's error (but, I have to point out, still a valid path).

So I'm here to ask you for a non default mode where pyinotify accepts bytes instead of str and pass that to the underlying libs untouched. In fact, for the moment I will have to fork and 'fix' this for myself, so I should be in the position of providing a patch.

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

No branches or pull requests

1 participant