##// END OF EJS Templates
IPython/utils/path.py: Sometimes this system encoding just won't work. So, we try to use it if we can, but fallback to UTF8 if it simply won't work.
John Kirkham -
Show More
@@ -441,8 +441,12 b' def ensure_dir_exists(path, mode=0o755):'
441 try:
441 try:
442 path_exists = os.path.exists(path)
442 path_exists = os.path.exists(path)
443 except UnicodeEncodeError:
443 except UnicodeEncodeError:
444 path = path.encode(sys.getfilesystemencoding() or "utf8")
444 try:
445 path_exists = os.path.exists(path)
445 path = path.encode(sys.getfilesystemencoding() or "utf8")
446 path_exists = os.path.exists(path)
447 except UnicodeEncodeError:
448 path = path.encode("utf8")
449 path_exists = os.path.exists(path)
446
450
447 if not os.path.exists(path):
451 if not os.path.exists(path):
448 try:
452 try:
General Comments 0
You need to be logged in to leave comments. Login now