Starting REPL from Command Palette not working when path contains non ASCII characters on Windows #206
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.
Sets SUBLIMEREPL_DIR with a Unicode object representing the current working directory.
The problem occurs on Windows, when the path to SublimeREPL package folder contains non ASCII characters (e.g. šćčž), and when we want through Command Palette (Ctrl+Shift+P) select the appropriate language to open REPL.
Error:
Traceback (most recent call last):
File ".\sublime_plugin.py", line 337, in run_
File ".\run_existing_command.py", line 31, in run
File ".\ntpath.py", line 108, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8e in position 9: ordinal not in range(128)
In run_existing_command.py file, SUBLIMEREPL_DIR has been set by os.getcwd() which returns a string representing the current working directory.
Solution to the problem is to return Unicode object - os.getcwdu().