From f14d4ad2b3b16e4b6e5520df28b3ec93f2cee6be 2015-10-09 11:36:11 From: John Kirkham Date: 2015-10-09 11:36:11 Subject: [PATCH] IPython/utils/tests/test_path.py: Only use `encode` for system functions that cannot handle unicode. --- diff --git a/IPython/utils/tests/test_path.py b/IPython/utils/tests/test_path.py index 4b251c1..8d655f2 100644 --- a/IPython/utils/tests/test_path.py +++ b/IPython/utils/tests/test_path.py @@ -430,12 +430,12 @@ def test_unescape_glob(): def test_ensure_dir_exists(): with TemporaryDirectory() as td: - d = os.path.join(td, u'∂ir').encode("utf8") + d = os.path.join(td, u'∂ir') path.ensure_dir_exists(d) # create it - assert os.path.isdir(d) + assert os.path.isdir(d.encode("utf8")) path.ensure_dir_exists(d) # no-op - f = os.path.join(td, u'ƒile').encode("utf8") - open(f, 'w').close() # touch + f = os.path.join(td, u'ƒile') + open(f.encode("utf8"), 'w').close() # touch with nt.assert_raises(IOError): path.ensure_dir_exists(f)