chiark
/
gitweb
/
~ianmdlvl
/
fdroidserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
be874b1
)
make sure file-streams of subprocesses get closed
author
Michael Pöhn
<michael.poehn@fsfe.org>
Thu, 7 Sep 2017 00:36:58 +0000
(
02:36
+0200)
committer
Michael Pöhn
<michael.poehn@fsfe.org>
Thu, 7 Sep 2017 00:36:58 +0000
(
02:36
+0200)
fdroidserver/common.py
patch
|
blob
|
history
diff --git
a/fdroidserver/common.py
b/fdroidserver/common.py
index 95b1b06c0a97e34a67a222dff9dac9cdd8e08a4d..43471bfcbc39a7b5e23d9f16b990ab4e93779313 100644
(file)
--- a/
fdroidserver/common.py
+++ b/
fdroidserver/common.py
@@
-1789,6
+1789,12
@@
def FDroidPopenBytes(commands, cwd=None, envs=None, output=True, stderr_to_stdou
result.returncode = p.wait()
result.output = buf.getvalue()
buf.close()
+ # make sure all filestreams of the subprocess are closed
+ for streamvar in ['stdin', 'stdout', 'stderr']:
+ if hasattr(p, streamvar):
+ stream = getattr(p, streamvar)
+ if stream:
+ stream.close()
return result