##// END OF EJS Templates
subprocess: Change all imports from `subprocess` -> `subprocess32`
Martin Bornhold -
r1007:e9c22488 default
parent child Browse files
Show More
@@ -35,7 +35,7 b" VERSION = (0, 5, 0, 'dev')"
35 35
36 36 import atexit
37 37 import logging
38 import subprocess
38 import subprocess32
39 39 import time
40 40 import urlparse
41 41 from cStringIO import StringIO
@@ -165,7 +165,7 b' def _start_pyro4_vcs_server(server_and_p'
165 165 '--threadpool', '32']
166 166 if log_level:
167 167 args += ['--log-level', log_level]
168 proc = subprocess.Popen(args)
168 proc = subprocess32.Popen(args)
169 169
170 170 def cleanup_server_process():
171 171 proc.kill()
@@ -182,7 +182,7 b' def _start_http_vcs_server(server_and_po'
182 182 args = [
183 183 'pserve', 'rhodecode/tests/vcsserver_http.ini',
184 184 'http_port=%s' % (port, ), 'http_host=%s' % (host, )]
185 proc = subprocess.Popen(args)
185 proc = subprocess32.Popen(args)
186 186
187 187 def cleanup_server_process():
188 188 proc.kill()
@@ -15,7 +15,7 b' import logging'
15 15 import optparse
16 16 import os
17 17 import re
18 import subprocess
18 import subprocess32
19 19 import sys
20 20 import textwrap
21 21 import threading
@@ -32,9 +32,9 b' from rhodecode.lib.compat import kill'
32 32
33 33
34 34 def make_web_build_callback(filename):
35 p = subprocess.Popen('make web-build', shell=True,
36 stdout=subprocess.PIPE,
37 stderr=subprocess.PIPE,
35 p = subprocess32.Popen('make web-build', shell=True,
36 stdout=subprocess32.PIPE,
37 stderr=subprocess32.PIPE,
38 38 cwd=os.path.dirname(os.path.dirname(__file__)))
39 39 stdout, stderr = p.communicate()
40 40 stdout = ''.join(stdout)
@@ -658,7 +658,7 b' class RcServerCommand(object):'
658 658 try:
659 659 try:
660 660 _turn_sigterm_into_systemexit()
661 proc = subprocess.Popen(args, env=new_environ)
661 proc = subprocess32.Popen(args, env=new_environ)
662 662 exit_code = proc.wait()
663 663 proc = None
664 664 except KeyboardInterrupt:
@@ -18,7 +18,7 b''
18 18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 20
21 from subprocess import Popen, PIPE
21 from subprocess32 import Popen, PIPE
22 22 import os
23 23 import shutil
24 24 import sys
@@ -24,7 +24,7 b' Checking the chunked data transfer via H'
24 24
25 25 import os
26 26 import time
27 import subprocess
27 import subprocess32
28 28
29 29 import pytest
30 30 import requests
@@ -53,7 +53,7 b' def echo_app_chunking(request, available'
53 53 'rhodecode.tests.lib.middleware.utils.test_scm_app_http_chunking'
54 54 ':create_echo_app')
55 55 command = command.format(port=port)
56 proc = subprocess.Popen(command.split(' '), bufsize=0)
56 proc = subprocess32.Popen(command.split(' '), bufsize=0)
57 57 echo_app_url = 'http://localhost:' + str(port)
58 58
59 59 @request.addfinalizer
@@ -78,7 +78,7 b' def scm_app(request, available_port_fact'
78 78 command = command.format(port=port)
79 79 env = os.environ.copy()
80 80 env["RC_ECHO_URL"] = echo_app_chunking
81 proc = subprocess.Popen(command.split(' '), bufsize=0, env=env)
81 proc = subprocess32.Popen(command.split(' '), bufsize=0, env=env)
82 82 scm_app_url = 'http://localhost:' + str(port)
83 83 wait_for_url(scm_app_url)
84 84
@@ -32,7 +32,7 b' import itertools'
32 32 import os
33 33 import pprint
34 34 import shutil
35 import subprocess
35 import subprocess32
36 36 import sys
37 37 import time
38 38
@@ -77,12 +77,12 b' def execute(*popenargs, **kwargs):'
77 77 input = kwargs.pop('stdin', None)
78 78 stdin = None
79 79 if input:
80 stdin = subprocess.PIPE
80 stdin = subprocess32.PIPE
81 81 #if 'stderr' not in kwargs:
82 # kwargs['stderr'] = subprocess.PIPE
82 # kwargs['stderr'] = subprocess32.PIPE
83 83 if 'stdout' in kwargs:
84 84 raise ValueError('stdout argument not allowed, it will be overridden.')
85 process = subprocess.Popen(stdin=stdin, stdout=subprocess.PIPE,
85 process = subprocess32.Popen(stdin=stdin, stdout=subprocess32.PIPE,
86 86 *popenargs, **kwargs)
87 87 output, error = process.communicate(input=input)
88 88 retcode = process.poll()
@@ -91,7 +91,7 b' def execute(*popenargs, **kwargs):'
91 91 if cmd is None:
92 92 cmd = popenargs[0]
93 93 print cmd, output, error
94 raise subprocess.CalledProcessError(retcode, cmd, output=output)
94 raise subprocess32.CalledProcessError(retcode, cmd, output=output)
95 95 return output
96 96
97 97
@@ -31,7 +31,7 b' To stop the script by press Ctrl-C'
31 31 import datetime
32 32 import os
33 33 import psutil
34 import subprocess
34 import subprocess32
35 35 import sys
36 36 import time
37 37 import traceback
@@ -66,7 +66,7 b' def dump_system():'
66 66
67 67
68 68 def count_dulwich_fds(proc):
69 p = subprocess.Popen(["lsof", "-p", proc.pid], stdout=subprocess.PIPE)
69 p = subprocess32.Popen(["lsof", "-p", proc.pid], stdout=subprocess32.PIPE)
70 70 out, err = p.communicate()
71 71
72 72 count = 0
@@ -117,7 +117,7 b' print "VCS - Ok"'
117 117
118 118 print "\nStarting RhodeCode..."
119 119 rc = psutil.Popen("RC_VCSSERVER_TEST_DISABLE=1 paster serve test.ini",
120 shell=True, stdin=subprocess.PIPE)
120 shell=True, stdin=subprocess32.PIPE)
121 121 time.sleep(1)
122 122 if not rc.is_running():
123 123 print "RC - Failed to start"
@@ -40,7 +40,7 b' import functools'
40 40 import logging
41 41 import os
42 42 import shutil
43 import subprocess
43 import subprocess32
44 44 import tempfile
45 45 import time
46 46 from itertools import chain
@@ -145,8 +145,8 b' class Repository(object):'
145 145
146 146 def _run(self, *args):
147 147 command = [self.BASE_COMMAND] + list(args)
148 process = subprocess.Popen(
149 command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
148 process = subprocess32.Popen(
149 command, stdout=subprocess32.PIPE, stderr=subprocess32.PIPE)
150 150 return process.communicate()
151 151
152 152 def _create_file(self, name, size):
@@ -28,7 +28,7 b' Base for test suite for making push/pull'
28 28 """
29 29
30 30 from os.path import join as jn
31 from subprocess import Popen, PIPE
31 from subprocess32 import Popen, PIPE
32 32 import logging
33 33 import os
34 34 import tempfile
@@ -29,7 +29,7 b' py.test config for test suite for making'
29 29
30 30 import ConfigParser
31 31 import os
32 import subprocess
32 import subprocess32
33 33 import tempfile
34 34 import textwrap
35 35 import pytest
@@ -164,7 +164,7 b' def rc_web_server('
164 164 print('Command: {}'.format(command))
165 165 print('Logfile: {}'.format(RC_LOG))
166 166
167 proc = subprocess.Popen(
167 proc = subprocess32.Popen(
168 168 command, bufsize=0, env=env, stdout=server_out, stderr=server_out)
169 169
170 170 wait_for_url(host_url, timeout=30)
@@ -26,7 +26,7 b' import re'
26 26 import pprint
27 27 import shutil
28 28 import socket
29 import subprocess
29 import subprocess32
30 30 import time
31 31 import uuid
32 32
@@ -42,7 +42,7 b' from rhodecode.model.changeset_status im'
42 42 from rhodecode.model.comment import ChangesetCommentsModel
43 43 from rhodecode.model.db import (
44 44 PullRequest, Repository, RhodeCodeSetting, ChangesetStatus, RepoGroup,
45 UserGroup, RepoRhodeCodeUi, RepoRhodeCodeSetting, RhodeCodeUi, Integration)
45 UserGroup, RepoRhodeCodeUi, RepoRhodeCodeSetting, RhodeCodeUi)
46 46 from rhodecode.model.meta import Session
47 47 from rhodecode.model.pull_request import PullRequestModel
48 48 from rhodecode.model.repo import RepoModel
@@ -884,7 +884,7 b' class RepoServer(object):'
884 884 if vcsrepo.alias != 'svn':
885 885 raise TypeError("Backend %s not supported" % vcsrepo.alias)
886 886
887 proc = subprocess.Popen(
887 proc = subprocess32.Popen(
888 888 ['svnserve', '-d', '--foreground', '--listen-host', 'localhost',
889 889 '--root', vcsrepo.path])
890 890 self._cleanup_servers.append(proc)
@@ -23,7 +23,7 b' import logging.config'
23 23 import os
24 24 import platform
25 25 import socket
26 import subprocess
26 import subprocess32
27 27 import time
28 28 from urllib2 import urlopen, URLError
29 29
@@ -196,7 +196,7 b' class VCSServer(object):'
196 196
197 197 def start(self):
198 198 print("Starting the VCSServer: {}".format(self._args))
199 self.process = subprocess.Popen(self._args)
199 self.process = subprocess32.Popen(self._args)
200 200
201 201 def wait_until_ready(self, timeout=30):
202 202 raise NotImplementedError()
@@ -255,7 +255,7 b' class HttpVCSServer(VCSServer):'
255 255 return template.format(**self._config)
256 256
257 257 def start(self):
258 self.process = subprocess.Popen(self._args)
258 self.process = subprocess32.Popen(self._args)
259 259
260 260 def wait_until_ready(self, timeout=30):
261 261 host = self._config['host']
@@ -30,10 +30,8 b' from os.path import join as jn'
30 30 from os.path import dirname as dn
31 31
32 32 from tempfile import _RandomNameSequence
33 from subprocess import Popen, PIPE
34
33 from subprocess32 import Popen, PIPE
35 34 from paste.deploy import appconfig
36 from pylons import config
37 35
38 36 from rhodecode.lib.utils import add_cache
39 37 from rhodecode.lib.utils2 import engine_from_config
@@ -42,7 +40,7 b' from rhodecode.model import init_model'
42 40 from rhodecode.model import meta
43 41 from rhodecode.model.db import User, Repository
44 42
45 from rhodecode.tests import TESTS_TMP_PATH, NEW_HG_REPO, HG_REPO
43 from rhodecode.tests import TESTS_TMP_PATH, HG_REPO
46 44 from rhodecode.config.environment import load_environment
47 45
48 46 rel_path = dn(dn(dn(dn(os.path.abspath(__file__)))))
@@ -22,7 +22,7 b' import threading'
22 22 import time
23 23 import logging
24 24 import os.path
25 import subprocess
25 import subprocess32
26 26 import urllib2
27 27 from urlparse import urlparse, parse_qsl
28 28 from urllib import unquote_plus
@@ -113,10 +113,10 b' def _load_svn_dump_into_repo(dump_name, '
113 113 integrated with the main repository once they stabilize more.
114 114 """
115 115 dump = rc_testdata.load_svn_dump(dump_name)
116 load_dump = subprocess.Popen(
116 load_dump = subprocess32.Popen(
117 117 ['svnadmin', 'load', repo_path],
118 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
119 stderr=subprocess.PIPE)
118 stdin=subprocess32.PIPE, stdout=subprocess32.PIPE,
119 stderr=subprocess32.PIPE)
120 120 out, err = load_dump.communicate(dump)
121 121 if load_dump.returncode != 0:
122 122 log.error("Output of load_dump command: %s", out)
@@ -20,7 +20,7 b''
20 20
21 21 import datetime
22 22 import os
23 import subprocess
23 import subprocess32
24 24
25 25 import pytest
26 26
@@ -86,8 +86,8 b' class TestGetScm:'
86 86 def test_get_two_scms_for_path(self, tmpdir):
87 87 multialias_repo_path = str(tmpdir)
88 88
89 subprocess.check_call(['hg', 'init', multialias_repo_path])
90 subprocess.check_call(['git', 'init', multialias_repo_path])
89 subprocess32.check_call(['hg', 'init', multialias_repo_path])
90 subprocess32.check_call(['git', 'init', multialias_repo_path])
91 91
92 92 with pytest.raises(VCSError):
93 93 get_scm(multialias_repo_path)
@@ -27,7 +27,7 b' import os'
27 27 import re
28 28 import sys
29 29
30 from subprocess import Popen
30 from subprocess32 import Popen
31 31
32 32
33 33 class VCSTestError(Exception):
General Comments 0
You need to be logged in to leave comments. Login now