diff options
author | VG <vg@devys.org> | 2014-11-29 23:35:06 +0100 |
---|---|---|
committer | VG <vg@devys.org> | 2014-11-29 23:35:06 +0100 |
commit | ec42aa12bf5ac9f9926003ead78f54d1ed35ba52 (patch) | |
tree | 4d2f42bfd1d23b66fe0ebef9861a09df7f555dbd | |
parent | 4559bdfaa93a14dd24c65305c93a94f07d7f3024 (diff) | |
download | pasteme-ec42aa12bf5ac9f9926003ead78f54d1ed35ba52.tar.gz pasteme-ec42aa12bf5ac9f9926003ead78f54d1ed35ba52.tar.bz2 pasteme-ec42aa12bf5ac9f9926003ead78f54d1ed35ba52.zip |
add consistency in encoding for file i/o
-rwxr-xr-x | pasteme.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -39,8 +39,8 @@ def route_paste_get(pid, pformat='colored'): return bottle.template('bad_format') path = pathbase / pid try: - with path.open() as fd: - content = fd.read() + with path.open(mode='rb') as fd: + content = fd.read().decode('utf8') except IOError: # use this template for all file based exception bottle.abort(404) |