-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
Windows encoding bugfix #277
Conversation
Problem: When installing auto-completion in Powershell, the path to the profile file was decoded with windows-1252 encoding - but such path didn't exist in my case. The correct encoding was cp850. Solution: - try to decode with cp850 also - check if the decoded path exists (checking for UnicodeDecodeError isn't enough)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
Thanks for your contribution, and I apologize for the delay in reviewing this.
For easier reviewing, I suggest to split the suggested changes up in two PRs:
- one adding the
cp850
encoding - this should be straightforward. - one for also checking whether the path exists.
After some initial testing, it looks like the second PR would require some changes to the test suite, so I prefer getting the first change in as such, and then build on it. I'll look into this after #808 is merged.
except UnicodeDecodeError: | ||
click.echo("Couldn't decode the path automatically", err=True) | ||
raise | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use contextlib.suppress there?
Thanks @matejfroebe! 🤓 This was handled in #808, so I'll close this one now. The fix will be available in the next release in a few hours. 0.13.1 🚀 |
Problem: When installing auto-completion in Powershell, the path to
the profile file was decoded with windows-1252 encoding - but such
path didn't exist in my case. The correct encoding was cp850.
Solution: