Skip to content

Commit

Permalink
Use 'replace' error handling to decode server in FTPFS
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Larralde committed Sep 10, 2017
1 parent 2f36daa commit 5ed51f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ftpfs.py
Expand Up @@ -87,7 +87,7 @@ def parse_ftp_error(e):
def _encode(st, encoding):
return st.encode(encoding) if isinstance(st, text_type) else st
def _decode(st, encoding):
return st.decode(encoding) if isinstance(st, bytes) else st
return st.decode(encoding, 'replace') if isinstance(st, bytes) else st
else:
def _encode(st, _):
return st
Expand Down

0 comments on commit 5ed51f8

Please sign in to comment.