diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-01-30 10:20:41 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-01-30 10:20:41 +0100 |
commit | cec904367c6f2c81694801eb3ff1a634b2434d55 (patch) | |
tree | a75fe8104abf7dacc5f26a4d19a8a164508260d7 /ishtar_common/utils.py | |
parent | 0fe66599b19b1dc000544f994b2f201972601c1f (diff) | |
download | Ishtar-cec904367c6f2c81694801eb3ff1a634b2434d55.tar.bz2 Ishtar-cec904367c6f2c81694801eb3ff1a634b2434d55.zip |
Tests: fix warehouse division creation test
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r-- | ishtar_common/utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 3e05ff6eb..1d44026e0 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -1032,9 +1032,11 @@ def rename_and_simplify_media_name(full_path_name, rename=True): :return: new full path name (or old if not changed), modified """ try: + is_str = False exists = os.path.exists(full_path_name) is_file = os.path.isfile(full_path_name) except UnicodeEncodeError: + is_str = True full_path_name = full_path_name.encode('utf-8') exists = os.path.exists(full_path_name) is_file = os.path.isfile(full_path_name) @@ -1043,6 +1045,10 @@ def rename_and_simplify_media_name(full_path_name, rename=True): path, current_name, name = simplify_name(full_path_name, check_existing=True) + if is_str: + full_path_name = full_path_name.decode('utf-8') + name = name.decode('utf-8') + path = path.decode('utf-8') if current_name == name: return full_path_name, False |