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

Elixir silently removes exclamation marks and reports no such file (Windows 10) #13165

Open
robss2020 opened this issue Dec 11, 2023 · 2 comments

Comments

@robss2020
Copy link

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.15.7 (compiled with Erlang/OTP 26)

Operating system

Windows 10

Current behavior

Exclamation marks are silently removed from filenames, although they are allowed characters in Windows, and an error is reported.

To reproduce: save IO.puts("Hello, world!") as "hello world!.exs" and execute it with:
elixir "hello world!.exs"
It will fail with "no file named hello world.exs" (silently removing the exclamation mark). Also works without quotation marks as a single word (helloworld!.exs).

C:\test>elixir "hello world!.exs"
No file named hello world.exs

image

image

Expected behavior

If it is legal in the operating system it should be accepted as an input file, or at least the error message should say "! is not allowed in filename" if it can't be run for some reason.

@josevalim
Copy link
Member

Thank you. I could easily reproduce the issue but it does not seem trivial to fix. I think we should rewrite our script to PowerShell, it should be both more maintainable and we could also test them on Unix as of PowerShell 7.

You may be able to run it as elixir "helloworld^!.exs" meanwhile.

@josevalim
Copy link
Member

There is a failing test here: #13166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants