Commit e87ef0f0 by willmcgugan

Fixed a bug when using print_fs to a file without an encoding value

parent c2ecf0ef
...@@ -313,7 +313,7 @@ def print_fs(fs, path='/', max_levels=5, file_out=None, terminal_colors=None): ...@@ -313,7 +313,7 @@ def print_fs(fs, path='/', max_levels=5, file_out=None, terminal_colors=None):
terminal_colors = True terminal_colors = True
def write(line): def write(line):
file_out.write(line.encode(file_out.encoding)+'\n') file_out.write(line.encode(file_out.encoding or 'utf-8')+'\n')
def wrap_prefix(prefix): def wrap_prefix(prefix):
if not terminal_colors: if not terminal_colors:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment