Skip to content

Commit

Permalink
👕 pyfs2 on python 2 caught non-unicode again. #303
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Jul 31, 2019
1 parent 1d928ba commit fe42c43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion moban/file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def read_bytes(path):

@log_fs_failure
def write_bytes(filename, bytes_content):
filename = to_unicode(filename)
if "zip://" in filename:
zip_file, folder = filename.split(".zip/")
with fs.open_fs(zip_file + ".zip", create=True) as the_fs:
Expand All @@ -124,7 +125,6 @@ def write_bytes(filename, bytes_content):
with fs.open_fs(tar_file + ".tar", create=True) as the_fs:
the_fs.writebytes(folder, bytes_content)
else:
filename = to_unicode(filename)
dir_name = fs.path.dirname(filename)
the_file_name = fs.path.basename(filename)
with fs.open_fs(dir_name) as the_fs:
Expand Down

0 comments on commit fe42c43

Please sign in to comment.