Skip to content

Commit ffaae03

Browse files
authored
Merge pull request #16 from kovge/main
Working with utf-8 filepaths. fixes issue #15
2 parents 5fa4dbd + 0c7e31d commit ffaae03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Service/python/files.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_file_full_path(data_dir: str, storage_id: int, relative_path: str) -> st
6363
mount_point = get_storage_mount_point(storage_id)
6464
if not mount_point:
6565
return ''
66-
return data_dir + mount_point + relative_path
66+
return data_dir.encode('utf-8') + mount_point + relative_path.encode('utf-8')
6767

6868

6969
def can_directly_access_file(file_info: dict) -> bool:
@@ -97,12 +97,12 @@ def get_storage_info(storage_id: int):
9797
def get_storage_mount_point(storage_id: int) -> str:
9898
for storage_info in StoragesInfo:
9999
if storage_info['numeric_id'] == storage_id:
100-
return storage_info['mount_point']
100+
return storage_info['mount_point'].encode('utf-8')
101101
return ''
102102

103103

104104
def get_storage_user_id(storage_id: int) -> str:
105105
for storage_info in StoragesInfo:
106106
if storage_info['numeric_id'] == storage_id:
107-
return storage_info['user_id']
107+
return storage_info['user_id'].encode('utf-8')
108108
return ''

0 commit comments

Comments
 (0)