-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix ruff discovery for paths containing symbols that can't be represented by the local encoding #584
Conversation
4f1d558
to
bd76273
Compare
@@ -32,4 +39,4 @@ def find_ruff_binary_path() -> Optional[Path]: | |||
if __name__ == "__main__": | |||
ruff_binary_path = find_ruff_binary_path() | |||
if ruff_binary_path: | |||
print(os.fsdecode(str(ruff_binary_path)), flush=True) | |||
print(os.fsdecode(ruff_binary_path), flush=True) |
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.
I think the call to str
before calling os.fsdecode
is just wrong? But how would I know, I don't know nothing of Python
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.
Yeah, I think that's correct. print(<pathlib.Path>)
would use the pathlib.Path.__str__
method, so the str
call here is redundant.
bd76273
to
df493e2
Compare
df493e2
to
9afc924
Compare
…nted by the local encoding
9afc924
to
fd7baeb
Compare
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.
Thanks!
Co-authored-by: Dhruv Manilawala <[email protected]>
86152f6
to
9590943
Compare
Summary
Fixes #583
See inline comment for an explanation
Test Plan
löカひ漢
Before fix: The python script crashed
After: It finds the right ruff binary