e.read() returns bytes

This commit is contained in:
j 2021-06-18 12:23:10 +01:00
parent 7e72cfd163
commit 887760acc1

View file

@ -100,7 +100,7 @@ class API(object):
if self.DEBUG: if self.DEBUG:
import webbrowser import webbrowser
if e.code >= 500: if e.code >= 500:
with open('/tmp/error.html', 'w') as f: with open('/tmp/error.html', 'wb') as f:
f.write(e.read()) f.write(e.read())
webbrowser.open_new_tab('/tmp/error.html') webbrowser.open_new_tab('/tmp/error.html')