Skip to content

Commit

Permalink
Merge branch 'unicodesafe-ls'
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Nov 17, 2011
2 parents 9e86e6b + 1f32705 commit 69a09eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions IPython/core/interactiveshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2082,8 +2082,10 @@ def system_raw(self, cmd):
with AvoidUNCPath() as path:
if path is not None:
cmd = '"pushd %s &&"%s' % (path, cmd)
cmd = py3compat.unicode_to_str(cmd)
ec = os.system(cmd)
else:
cmd = py3compat.unicode_to_str(cmd)
ec = os.system(cmd)

# We explicitly do NOT return the subprocess status code, because
Expand Down
8 changes: 8 additions & 0 deletions IPython/core/tests/test_interactiveshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,11 @@ def test_1(self):
"""Test safe_execfile with non-ascii path
"""
_ip.shell.safe_execfile(self.fname, {}, raise_exceptions=True)


class TestSystemRaw(unittest.TestCase):
def test_1(self):
"""Test system_raw with non-ascii cmd
"""
cmd = ur'''python -c "'åäö'" '''
_ip.shell.system_raw(cmd)

0 comments on commit 69a09eb

Please sign in to comment.