1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Annotate and refactor streams.py

This commit is contained in:
Jakub Roztocil
2019-08-31 18:21:10 +02:00
parent 82a224a658
commit e8ef5a783f
3 changed files with 91 additions and 56 deletions

View File

@@ -144,7 +144,7 @@ def load_text_file(item) -> str:
path = item.value
try:
with open(os.path.expanduser(path), 'rb') as f:
return f.read().decode('utf8')
return f.read().decode()
except IOError as e:
raise ParseError('"%s": %s' % (item.orig, e))
except UnicodeDecodeError: