diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-02 07:51:48 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-10-02 07:52:11 -0400 |
commit | eb75b78c6c4e63ac89b54a1dd67f1881522ad8a0 (patch) | |
tree | 4f08eec138dfd9731622317154215f21a640c590 /gitsrht/blueprints/repo.py | |
parent | 791b8df969dff8953edbc4819ab7a0b77570a6fb (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.py | 7 |
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') |