diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index cef8d529241..5ce338ad6cf 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -2085,6 +2085,7 @@ def system_raw(self, 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 diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index ae4c596dec8..31bb4afd6d1 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -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 "u'åäö'" ''' + _ip.shell.system_raw(cmd)