Skip to content

Commit fe42c43

Browse files
committed
👕 pyfs2 on python 2 caught non-unicode again. #303
1 parent 1d928ba commit fe42c43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

moban/file_system.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def read_bytes(path):
114114

115115
@log_fs_failure
116116
def write_bytes(filename, bytes_content):
117+
filename = to_unicode(filename)
117118
if "zip://" in filename:
118119
zip_file, folder = filename.split(".zip/")
119120
with fs.open_fs(zip_file + ".zip", create=True) as the_fs:
@@ -124,7 +125,6 @@ def write_bytes(filename, bytes_content):
124125
with fs.open_fs(tar_file + ".tar", create=True) as the_fs:
125126
the_fs.writebytes(folder, bytes_content)
126127
else:
127-
filename = to_unicode(filename)
128128
dir_name = fs.path.dirname(filename)
129129
the_file_name = fs.path.basename(filename)
130130
with fs.open_fs(dir_name) as the_fs:

0 commit comments

Comments
 (0)