summaryrefslogtreecommitdiffstats
path: root/gitsrht/blueprints/repo.py
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-02 07:51:48 -0400
committerDrew DeVault <sir@cmpwn.com>2018-10-02 07:52:11 -0400
commiteb75b78c6c4e63ac89b54a1dd67f1881522ad8a0 (patch)
tree4f08eec138dfd9731622317154215f21a640c590 /gitsrht/blueprints/repo.py
parent791b8df969dff8953edbc4819ab7a0b77570a6fb (diff)
Don't capture stderr/stdout of git subprocesses
Apparently subprocess is leaky https://bugs.python.org/issue28165
Diffstat (limited to 'gitsrht/blueprints/repo.py')
-rw-r--r--gitsrht/blueprints/repo.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py
index 5535b1e..93e87c4 100644
--- a/gitsrht/blueprints/repo.py
+++ b/gitsrht/blueprints/repo.py
@@ -2,6 +2,7 @@ import binascii
import os
import pygit2
import pygments
+import sys
import subprocess
from datetime import datetime, timedelta
from jinja2 import Markup
@@ -203,7 +204,7 @@ def archive(owner, repo, ref):
]
print(args)
subp = subprocess.run(args, timeout=30,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout=sys.stdout, stderr=sys.stderr)
except:
try:
os.unlink(path)
@@ -212,7 +213,6 @@ def archive(owner, repo, ref):
raise
if subp.returncode != 0:
- print(subp.stdout, subp.stderr)
try:
os.unlink(path)
except:
@@ -325,9 +325,8 @@ def patch(owner, repo, ref):
"format-patch",
"--stdout", "-1",
ref
- ], timeout=10, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ ], timeout=10, stdout=sys.stdout, stderr=sys.stderr)
if subp.returncode != 0:
- print(subp.stdout, subp.stderr)
return "Error preparing patch", 500
return Response(subp.stdout, mimetype='text/plain')