summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2010-06-19 19:33:54 +0000
committerwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2010-06-19 19:33:54 +0000
commite87ef0f0617fbc638f0ef5e9935af694ec0e220e (patch)
treee78b01aad9f5b3c7ca94ce44669200cc3e08c57a
parentc2ecf0ef152342a6c7ad1aac3dd301acc926eae0 (diff)
downloadpyfilesystem-git-e87ef0f0617fbc638f0ef5e9935af694ec0e220e.tar.gz
Fixed a bug when using print_fs to a file without an encoding value
-rw-r--r--fs/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/utils.py b/fs/utils.py
index b17e636..83ad832 100644
--- a/fs/utils.py
+++ b/fs/utils.py
@@ -313,7 +313,7 @@ def print_fs(fs, path='/', max_levels=5, file_out=None, terminal_colors=None):
terminal_colors = True
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):
if not terminal_colors: