mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Fix fdopen RuntimeWarning in 3.8 (#2146)
This commit is contained in:
parent
3fcb551921
commit
21d6287e15
@ -32,7 +32,9 @@ class WorkerTmp(object):
|
|||||||
try:
|
try:
|
||||||
if not IS_CYGWIN:
|
if not IS_CYGWIN:
|
||||||
util.unlink(name)
|
util.unlink(name)
|
||||||
self._tmp = os.fdopen(fd, 'w+b', 1)
|
# In Python 3.8, open() emits RuntimeWarning if buffering=1 for binary mode.
|
||||||
|
# Because we never write to this file, pass 0 to switch buffering off.
|
||||||
|
self._tmp = os.fdopen(fd, 'w+b', 0)
|
||||||
except:
|
except:
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
raise
|
raise
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user