Windows encoding bugfix#277
Closed
matejfroebe wants to merge 5 commits intofastapi:masterfrom
Closed
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)
svlandeg
reviewed
Apr 19, 2024
svlandeg
reviewed
Apr 19, 2024
svlandeg
reviewed
Apr 25, 2024
Member
svlandeg
left a comment
There was a problem hiding this comment.
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
cp850encoding - 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.
lachaib
reviewed
May 27, 2024
Comment on lines
193
to
+194
| except UnicodeDecodeError: | ||
| click.echo("Couldn't decode the path automatically", err=True) | ||
| raise | ||
| pass |
There was a problem hiding this comment.
Why not use contextlib.suppress there?
3 tasks
Member
|
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 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: