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

Starting REPL from Command Palette not working when path contains non ASCII characters on Windows #206

Merged
merged 1 commit into from
Jul 23, 2013

Conversation

ztepsic
Copy link
Contributor

@ztepsic ztepsic commented Jul 14, 2013

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().

Sets SUBLIMEREPL_DIR with a Unicode object representing
the current working directory.

The problem occures on Windows, when the path to SublimeREPL package folder contains non ASCII characters,
and when we want through Command Pallete (Ctrl+Shift+P) select the approperiate 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().
wuub added a commit that referenced this pull request Jul 23, 2013
Starting REPL from Command Palette not working when path contains non ASCII characters on Windows
@wuub wuub merged commit 64a411e into wuub:master Jul 23, 2013
@wuub
Copy link
Owner

wuub commented Jul 23, 2013

Thank you :)

@hpsilva
Copy link

hpsilva commented Aug 31, 2015

I am having an issue which seems related to non ASCII characters in the program path, however haven't been able to solve yet looking into the solution here described. Can you have a look at?

Traceback (most recent call last):
File "C:\Users\helio_000\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\sublimerepl.py", line 454, in open
r = repls.Repl.subclass(type)(encoding, **kwds)
File "C:\Users\helio_000\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\repls\subprocess_repl.py", line 77, in init
strings_env[k.decode("utf-8")] = v.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 1: invalid continuation byte

error: UnicodeDecodeError('utf-8', b'H\xe9lio Silva', 1, 2, 'invalid continuation byte')

@rrodrigueznt
Copy link

rrodrigueznt commented May 30, 2017

Hi! I'm afraid I've a new case study equal to the posted by @hpsilva . Here the messages logged in the console...

  File "C:\Users\Ricardo Rodríguez\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\sublimerepl.py", line 487, in open
    r = repls.Repl.subclass(type)(encoding, **kwds)
  File "C:\Users\Ricardo Rodríguez\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\repls\subprocess_repl.py", line 77, in __init__
    strings_env[k.decode("utf-8")] = v.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 19: invalid continuation byte
error: UnicodeDecodeError('utf-8', b'\\Users\\Ricardo Rodr\xedguez', 19, 20, 'invalid continuation byte')

Running Sublime Text 3, Stable Channel, Build 3126 on Windows 10 Home, Version 1607, OS Build 14393.1198.

Sorry, I'm far from being able to contribute to finding a fix! I'm trying to create a framework to work on R scripts across different OS and private and public networks with different security requirements. Sublime Text seems to me a valuable piece of the puzzle, but I've not been able yet to find a complete set of utilities working fine in all of at least four desktop OS: Windows 7, Windows 10, Ubuntu Linux and Mac OS X. Any help will be very welcome! Thanks!

This pull request was closed.
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

Successfully merging this pull request may close these issues.

4 participants