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

Unicode error when starting ipython in a folder with non-ascii path #200

Closed
jstenar opened this issue Nov 3, 2010 · 8 comments
Closed

Comments

@jstenar
Copy link
Member

jstenar commented Nov 3, 2010

I get a unicode error when starting ipython from a path containing non-ascii characters, see below.

/Jörgen

C:\projekt\Papers\Föredrag\Mätkurs doktorander 2010\grafer\Adapter>ipython
[IPythonApp] Error loading config file: ipython_config.py
Traceback (most recent call last):
File "c:\python26\external\ipython\IPython\core\application.py", line 365, in
load_file_config
self.file_config = loader.load_config()
File "c:\python26\external\ipython\IPython\config\loader.py", line 253, in loa
d_config
self._find_file()
File "c:\python26\external\ipython\IPython\config\loader.py", line 260, in _fi
nd_file
self.full_filename = filefind(self.filename, self.path)
File "c:\python26\external\ipython\IPython\utils\path.py", line 131, in filefi
nd
testname = expand_path(os.path.join(path, filename))
File "C:\Python26\lib\ntpath.py", line 108, in join
path += "" + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf6 in position 19: ordinal
not in range(128)
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.

IPython 0.11.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]:

@fperez
Copy link
Member

fperez commented Nov 3, 2010

Jorgen, why did you close this ticket right away?

@jstenar
Copy link
Member Author

jstenar commented Nov 3, 2010

I don't know, I guess I made a mistake somewhere and then I couldn't figure out how to reopen it.

Anyway by changing os.getcwd to os.getcwdu on line 347 in core/application.py I got around this problem.

/Jörgen

@fperez
Copy link
Member

fperez commented Nov 3, 2010

OK, thanks. I reopened it and tagged it with unicode as part of my planned attack on our unicode mess.

@takluyver
Copy link
Member

Fixed by commit c9f8851ec0d26445b503a06dc10f191f05d29191 in my unicode pull request #252 .

@jstenar
Copy link
Member Author

jstenar commented Mar 23, 2011

The fix in c9f8851 seems to do the trick for me.

However the test_application.py file should declare encoding, I get a syntaxerror from that file.

File "test_application.py", line 10
SyntaxError: Non-ASCII character '\xe2' in file test_application.py on line 10,
but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Perhaps those strings containing non-ascii characters should be unicode strings as well.

/Jörgen

@jstenar jstenar closed this as completed Mar 23, 2011
@takluyver
Copy link
Member

Thanks for spotting that - I've pushed those changes to my unicode-issues
branch.

@jstenar
Copy link
Member Author

jstenar commented Mar 23, 2011

Now the test works for me.

@takluyver
Copy link
Member

Excellent. Thanks, Jörgen. I'm hoping to get it merged tomorrow.

markvoorhies pushed a commit to markvoorhies/ipython that referenced this issue Apr 21, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants