Show More
@@ -15,9 +15,6 import os | |||||
15 | import stat |
|
15 | import stat | |
16 |
|
16 | |||
17 | from ..i18n import _ |
|
17 | from ..i18n import _ | |
18 | from ..pycompat import ( |
|
|||
19 | open, |
|
|||
20 | ) |
|
|||
21 | from .. import ( |
|
18 | from .. import ( | |
22 | encoding, |
|
19 | encoding, | |
23 | pycompat, |
|
20 | pycompat, | |
@@ -222,7 +219,7 def staticfile(templatepath, directory, | |||||
222 | path = os.path.join(directory, fpath) |
|
219 | path = os.path.join(directory, fpath) | |
223 | try: |
|
220 | try: | |
224 | os.stat(path) |
|
221 | os.stat(path) | |
225 |
with open(path, |
|
222 | with open(path, 'rb') as fh: | |
226 | data = fh.read() |
|
223 | data = fh.read() | |
227 | except TypeError: |
|
224 | except TypeError: | |
228 | raise ErrorResponse(HTTP_SERVER_ERROR, b'illegal filename') |
|
225 | raise ErrorResponse(HTTP_SERVER_ERROR, b'illegal filename') |
@@ -15,9 +15,6 import traceback | |||||
15 | import wsgiref.validate |
|
15 | import wsgiref.validate | |
16 |
|
16 | |||
17 | from ..i18n import _ |
|
17 | from ..i18n import _ | |
18 | from ..pycompat import ( |
|
|||
19 | open, |
|
|||
20 | ) |
|
|||
21 |
|
18 | |||
22 | from .. import ( |
|
19 | from .. import ( | |
23 | encoding, |
|
20 | encoding, | |
@@ -351,7 +348,7 except ImportError: | |||||
351 |
|
348 | |||
352 | def openlog(opt, default): |
|
349 | def openlog(opt, default): | |
353 | if opt and opt != b'-': |
|
350 | if opt and opt != b'-': | |
354 |
return open(opt, |
|
351 | return open(opt, 'ab') | |
355 | return default |
|
352 | return default | |
356 |
|
353 | |||
357 |
|
354 |
General Comments 0
You need to be logged in to leave comments.
Login now