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

Crashes if run with different casing for rye.exe (ex: rye.EXE). #1284

Closed
itsjohncs opened this issue Jul 26, 2024 · 3 comments · Fixed by #1286
Closed

Crashes if run with different casing for rye.exe (ex: rye.EXE). #1284

itsjohncs opened this issue Jul 26, 2024 · 3 comments · Fixed by #1286
Assignees
Labels
bug Something isn't working

Comments

@itsjohncs
Copy link

Steps to Reproduce

On Windows, run rye using its full path, but using different casing for its name than what's recorded on the filesystem. For example, if rye is installed to C:\Users\johns\.rye\shims\rye.exe you can reproduce this bug by running C:\Users\johns\.rye\shims\RYE.EXE or C:\Users\johns\.rye\shims\rye.EXE.

As an example for the remaining sections of this report, I will use:

C:\Users\johns\.rye\shims\rye.EXE --version

Expected Result

rye should print out the version and then exit.

Actual Result

> C:\Users\johns\.rye\shims\rye.EXE --version
error: target shim binary 'rye.EXE' not found

Version Info

> C:\Users\johns\.rye\shims\rye.exe --version
rye 0.37.0
commit: 0.37.0 (09b67c469 2024-07-20)
platform: windows (x86_64)
self-python: cpython@3.12.4
symlink support: true
uv enabled: true

Stacktrace

> $env:RUST_BACKTRACE=1; C:\Users\johns\.rye\shims\rye.EXE --version; $env:RUST_BACKTRACE=$null
error: target shim binary 'rye.EXE' not found

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: BaseThreadInitThunk
  14: RtlUserThreadStart
@itsjohncs
Copy link
Author

Ah! I forgot to add the why to this esoteric issue.

This came up while creating a pre-commit hook for rye. pre-commit will search the PATH and apply PATHEXT itself on Windows (source) and thus create a path with odd casing. I was able to work around this issue easily enough though (source).

@charliermarsh
Copy link
Member

Hey @itsjohncs good to see you. Should be fixed in #1286.

charliermarsh added a commit that referenced this issue Jul 27, 2024
## Summary

This check can be subtly incorrect on case-insensitive filesystems
(e.g., NTFS). Seems easiest to just make the whole comparison
case-insensitive.

Closes #1284.
@itsjohncs
Copy link
Author

It’s good to see you too! You’ve made some wonderful tools.

Thank you for such a quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants