mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 22:34:52 +00:00
Avoid calling fdopen on closed descriptor
This commit is contained in:
parent
5bc10b45a3
commit
cd0e585d0d
1 changed files with 11 additions and 0 deletions
|
|
@ -2299,6 +2299,17 @@ class Client:
|
||||||
cdn_session.start()
|
cdn_session.start()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# cant fdopen the closed file descriptor from above
|
||||||
|
# which is closed due to the with statement in the branch just above
|
||||||
|
# make a new temp file to write to
|
||||||
|
|
||||||
|
try:
|
||||||
|
os.remove(file_name)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
fd, file_name = tempfile.mkstemp()
|
||||||
|
|
||||||
with os.fdopen(fd, "wb") as f:
|
with os.fdopen(fd, "wb") as f:
|
||||||
while True:
|
while True:
|
||||||
r2 = cdn_session.send(
|
r2 = cdn_session.send(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue