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

Autoreload doesn’t work with unicode paths #228

Open
Glutexo opened this issue Dec 6, 2018 · 3 comments
Open

Autoreload doesn’t work with unicode paths #228

Glutexo opened this issue Dec 6, 2018 · 3 comments

Comments

@Glutexo
Copy link

Glutexo commented Dec 6, 2018

If the elixir-koans folder is located in a path with non-ASCII characters, the autoreloading doesn’t work. An error like this is raised every time a change is detected:

** (Code.LoadError) could not load /Users/stomsa/_dev/�/elixir-koans/lib/koans/02_strings.ex
    (elixir) lib/code.ex:1147: Code.find_file/2
    (elixir) lib/code.ex:713: Code.load_file/2

The path should be ~/_dev/ň/ and not ~/_dev/Å�/.

Happens on macOS Mojave 10.14 (18A391) with zsh.

@iamvery
Copy link
Collaborator

iamvery commented Dec 6, 2018

I dug in a little bit on this. The error originates here. It ultimately seems that :elixir_utils.read_file_type doesn't handle these characters well. I don't have time to dig in any further right now, but overall it feels like an Elixir/Erlang issue more than this specific project. That is unless there is some escaping or something special that needs to happen in order to support paths like this.

I did, however, notice a deprecated call which is fixed in #229.

@Glutexo
Copy link
Author

Glutexo commented Jan 1, 2019

Thanks for taking a look at this, @iamvery! I examined a bit too and I at least found out that the Watcher’s handle_info method already receive an already invalid path. Printing it out, the Unicode characters are already botched.

I wanted to dig deeper and see the actual result of file_system’s parse_line method for a Mac worker, but I wasn’t able to get my changes actually executed.

My impression is that the culprit lies somewhere there, not translating the platform-specific watcher result correctly. But maybe it’s even deeper.

@iamvery
Copy link
Collaborator

iamvery commented Jan 2, 2019

Fun times 😅

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

No branches or pull requests

2 participants