Skip to content

Commit

Permalink
Merge pull request ipython#8886 from jakirkham/fix_unicode_dir_test
Browse files Browse the repository at this point in the history
TST: Decode UTF-8 paths before passing them to `os.path` functions
  • Loading branch information
rgbkrk committed Oct 8, 2015
2 parents eba089c + 2ac4738 commit a58ab37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IPython/utils/tests/test_path.py
Expand Up @@ -430,11 +430,11 @@ def test_unescape_glob():

def test_ensure_dir_exists():
with TemporaryDirectory() as td:
d = os.path.join(td, u'∂ir')
d = os.path.join(td, u'∂ir').encode("utf8")
path.ensure_dir_exists(d) # create it
assert os.path.isdir(d)
path.ensure_dir_exists(d) # no-op
f = os.path.join(td, u'ƒile')
f = os.path.join(td, u'ƒile').encode("utf8")
open(f, 'w').close() # touch
with nt.assert_raises(IOError):
path.ensure_dir_exists(f)
Expand Down

0 comments on commit a58ab37

Please sign in to comment.