ls crashes when run on a UNC path or with non-ascii args #1006

Closed
jstenar opened this Issue Nov 16, 2011 · 6 comments

Comments

Projects
None yet
3 participants
@jstenar
Member

jstenar commented Nov 16, 2011

ls crashes when run on a UNC path or with non-ascii args.

I believe it is because os.system requires a str and will try to convert using ascii.
See #1005 for a quick fix. @takluyver how should this be done in a python3 compatible way?

In [3]: ls åäö/
---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)
C:\python\bugreports\ipython\<ipython-input-3-af7427a4d827> in <module>()
----> 1 get_ipython().system(u"dir /on åäö/")

c:\python\external\ipython\IPython\core\interactiveshell.pyc in system_raw(self, cmd)
   2083                 if path is not None:
   2084                     cmd = '"pushd %s &&"%s' % (path, cmd)
-> 2085                 ec = os.system(cmd)
   2086         else:
   2087             ec = os.system(cmd)

UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-10: ordinal not in range(128)
@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Nov 16, 2011

Member

Does it really fail on a UNC path? Because I specifically tested that case, and it certainly does work. Does the UNC path have to be non-ascii as well for it to fail?

Member

minrk commented Nov 16, 2011

Does it really fail on a UNC path? Because I specifically tested that case, and it certainly does work. Does the UNC path have to be non-ascii as well for it to fail?

@jstenar

This comment has been minimized.

Show comment
Hide comment
@jstenar

jstenar Nov 16, 2011

Member

Min RK skrev 2011-11-16 23:03:

Does it really fail on a UNC path? Because I specifically tested that case, and it certainly does work. Does the UNC path have to be non-ascii as well for it to fail?


Reply to this email directly or view it on GitHub:
#1006 (comment)
I meant it fails if the unc path has non-ascii characters.

Member

jstenar commented Nov 16, 2011

Min RK skrev 2011-11-16 23:03:

Does it really fail on a UNC path? Because I specifically tested that case, and it certainly does work. Does the UNC path have to be non-ascii as well for it to fail?


Reply to this email directly or view it on GitHub:
#1006 (comment)
I meant it fails if the unc path has non-ascii characters.

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Nov 18, 2011

Member

Question, now that #1005 got merged, should this issue be closed?

Member

fperez commented Nov 18, 2011

Question, now that #1005 got merged, should this issue be closed?

@jstenar

This comment has been minimized.

Show comment
Hide comment
@jstenar

jstenar Nov 18, 2011

Member

Yes I believe so. These things work for me now.

Member

jstenar commented Nov 18, 2011

Yes I believe so. These things work for me now.

@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Nov 18, 2011

Member

Thanks, closing.

Member

minrk commented Nov 18, 2011

Thanks, closing.

@minrk minrk closed this Nov 18, 2011

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Nov 18, 2011

Member

OK, closing then. You're the most likely to find any problems here, so feel free to reopen if you see any.

Member

fperez commented Nov 18, 2011

OK, closing then. You're the most likely to find any problems here, so feel free to reopen if you see any.

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