diff --git a/rhodecode/subscribers.py b/rhodecode/subscribers.py --- a/rhodecode/subscribers.py +++ b/rhodecode/subscribers.py @@ -26,7 +26,7 @@ import os import datetime import logging import Queue -import subprocess32 +import subprocess from dateutil.parser import parse @@ -359,7 +359,7 @@ class AsyncSubscriber(Subscriber): class AsyncSubprocessSubscriber(AsyncSubscriber): """ - Subscriber that uses the subprocess32 module to execute a command if an + Subscriber that uses the subprocess module to execute a command if an event is received. Events are handled asynchronously:: subscriber = AsyncSubprocessSubscriber('ls -la', timeout=10) @@ -380,16 +380,16 @@ class AsyncSubprocessSubscriber(AsyncSub log.debug('Executing command %s.', cmd) try: - output = subprocess32.check_output( - cmd, timeout=timeout, stderr=subprocess32.STDOUT) + output = subprocess.check_output( + cmd, timeout=timeout, stderr=subprocess.STDOUT) log.debug('Command finished %s', cmd) if output: log.debug('Command output: %s', output) - except subprocess32.TimeoutExpired as e: + except subprocess.TimeoutExpired as e: log.exception('Timeout while executing command.') if e.output: log.error('Command output: %s', e.output) - except subprocess32.CalledProcessError as e: + except subprocess.CalledProcessError as e: log.exception('Error while executing command.') if e.output: log.error('Command output: %s', e.output) diff --git a/rhodecode/tests/database/conftest.py b/rhodecode/tests/database/conftest.py --- a/rhodecode/tests/database/conftest.py +++ b/rhodecode/tests/database/conftest.py @@ -18,7 +18,7 @@ # RhodeCode Enterprise Edition, including its added features, Support services, # and proprietary license terms, please see https://rhodecode.com/licenses/ -from subprocess32 import Popen, PIPE +from subprocess import Popen, PIPE import os import shutil import sys diff --git a/rhodecode/tests/lib/middleware/utils/test_scm_app_http_chunking.py b/rhodecode/tests/lib/middleware/utils/test_scm_app_http_chunking.py --- a/rhodecode/tests/lib/middleware/utils/test_scm_app_http_chunking.py +++ b/rhodecode/tests/lib/middleware/utils/test_scm_app_http_chunking.py @@ -24,7 +24,7 @@ Checking the chunked data transfer via H import os import time -import subprocess32 +import subprocess import pytest import requests @@ -53,7 +53,7 @@ def echo_app_chunking(request, available 'rhodecode.tests.lib.middleware.utils.test_scm_app_http_chunking' ':create_echo_app') command = command.format(port=port) - proc = subprocess32.Popen(command.split(' '), bufsize=0) + proc = subprocess.Popen(command.split(' '), bufsize=0) echo_app_url = 'http://localhost:' + str(port) @request.addfinalizer @@ -78,7 +78,7 @@ def scm_app(request, available_port_fact command = command.format(port=port) env = os.environ.copy() env["RC_ECHO_URL"] = echo_app_chunking - proc = subprocess32.Popen(command.split(' '), bufsize=0, env=env) + proc = subprocess.Popen(command.split(' '), bufsize=0, env=env) scm_app_url = 'http://localhost:' + str(port) wait_for_url(scm_app_url) diff --git a/rhodecode/tests/load/http_performance.py b/rhodecode/tests/load/http_performance.py --- a/rhodecode/tests/load/http_performance.py +++ b/rhodecode/tests/load/http_performance.py @@ -32,7 +32,7 @@ import itertools import os import pprint import shutil -import subprocess32 +import subprocess import sys import time @@ -77,12 +77,12 @@ def execute(*popenargs, **kwargs): input = kwargs.pop('stdin', None) stdin = None if input: - stdin = subprocess32.PIPE + stdin = subprocess.PIPE #if 'stderr' not in kwargs: - # kwargs['stderr'] = subprocess32.PIPE + # kwargs['stderr'] = subprocess.PIPE if 'stdout' in kwargs: raise ValueError('stdout argument not allowed, it will be overridden.') - process = subprocess32.Popen(stdin=stdin, stdout=subprocess32.PIPE, + process = subprocess.Popen(stdin=stdin, stdout=subprocess.PIPE, *popenargs, **kwargs) output, error = process.communicate(input=input) retcode = process.poll() @@ -91,7 +91,7 @@ def execute(*popenargs, **kwargs): if cmd is None: cmd = popenargs[0] print('{} {} {} '.format(cmd, output, error)) - raise subprocess32.CalledProcessError(retcode, cmd, output=output) + raise subprocess.CalledProcessError(retcode, cmd, output=output) return output diff --git a/rhodecode/tests/load/profile.py b/rhodecode/tests/load/profile.py --- a/rhodecode/tests/load/profile.py +++ b/rhodecode/tests/load/profile.py @@ -31,7 +31,7 @@ To stop the script by press Ctrl-C import datetime import os import psutil -import subprocess32 +import subprocess import sys import time import traceback @@ -66,7 +66,7 @@ def dump_system(): def count_dulwich_fds(proc): - p = subprocess32.Popen(["lsof", "-p", proc.pid], stdout=subprocess32.PIPE) + p = subprocess.Popen(["lsof", "-p", proc.pid], stdout=subprocess.PIPE) out, err = p.communicate() count = 0 @@ -117,7 +117,7 @@ print("VCS - Ok") print("\nStarting RhodeCode...") rc = psutil.Popen("RC_VCSSERVER_TEST_DISABLE=1 paster serve test.ini", - shell=True, stdin=subprocess32.PIPE) + shell=True, stdin=subprocess.PIPE) time.sleep(1) if not rc.is_running(): print("RC - Failed to start") diff --git a/rhodecode/tests/load/vcs_performance.py b/rhodecode/tests/load/vcs_performance.py --- a/rhodecode/tests/load/vcs_performance.py +++ b/rhodecode/tests/load/vcs_performance.py @@ -40,7 +40,7 @@ import functools import logging import os import shutil -import subprocess32 +import subprocess import tempfile import time from itertools import chain @@ -145,8 +145,8 @@ class Repository(object): def _run(self, *args): command = [self.BASE_COMMAND] + list(args) - process = subprocess32.Popen( - command, stdout=subprocess32.PIPE, stderr=subprocess32.PIPE) + process = subprocess.Popen( + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) return process.communicate() def _create_file(self, name, size): diff --git a/rhodecode/tests/plugin.py b/rhodecode/tests/plugin.py --- a/rhodecode/tests/plugin.py +++ b/rhodecode/tests/plugin.py @@ -26,7 +26,7 @@ import re import pprint import shutil import socket -import subprocess32 +import subprocess import time import uuid import dateutil.tz @@ -928,7 +928,7 @@ class RepoServer(object): if vcsrepo.alias != 'svn': raise TypeError("Backend %s not supported" % vcsrepo.alias) - proc = subprocess32.Popen( + proc = subprocess.Popen( ['svnserve', '-d', '--foreground', '--listen-host', 'localhost', '--root', vcsrepo.path]) self._cleanup_servers.append(proc) diff --git a/rhodecode/tests/scripts/test_concurency.py b/rhodecode/tests/scripts/test_concurency.py --- a/rhodecode/tests/scripts/test_concurency.py +++ b/rhodecode/tests/scripts/test_concurency.py @@ -30,7 +30,7 @@ from os.path import join as jn from os.path import dirname as dn from tempfile import _RandomNameSequence -from subprocess32 import Popen, PIPE +from subprocess import Popen, PIPE from rhodecode.lib.utils2 import engine_from_config from rhodecode.lib.auth import get_crypt_password diff --git a/rhodecode/tests/server_utils.py b/rhodecode/tests/server_utils.py --- a/rhodecode/tests/server_utils.py +++ b/rhodecode/tests/server_utils.py @@ -23,7 +23,7 @@ import os import time import tempfile import pytest -import subprocess32 +import subprocess import configobj import logging from urllib.request import urlopen @@ -152,7 +152,7 @@ class RcVCSServer(ServerBase): log.info('rhodecode-vcsserver command: {}'.format(self.command)) log.info('rhodecode-vcsserver logfile: {}'.format(self.log_file)) - self.process = subprocess32.Popen( + self.process = subprocess.Popen( self._args, bufsize=0, env=env, stdout=self.server_out, stderr=self.server_out) @@ -184,7 +184,7 @@ class RcWebServer(ServerBase): log.info('rhodecode-web command: {}'.format(self.command)) log.info('rhodecode-web logfile: {}'.format(self.log_file)) - self.process = subprocess32.Popen( + self.process = subprocess.Popen( self._args, bufsize=0, env=env, stdout=self.server_out, stderr=self.server_out) diff --git a/rhodecode/tests/utils.py b/rhodecode/tests/utils.py --- a/rhodecode/tests/utils.py +++ b/rhodecode/tests/utils.py @@ -22,7 +22,7 @@ import threading import time import logging import os.path -import subprocess32 +import subprocess import tempfile import urllib.request, urllib.error, urllib.parse from lxml.html import fromstring, tostring @@ -223,10 +223,10 @@ def _load_svn_dump_into_repo(dump_name, integrated with the main repository once they stabilize more. """ dump = rc_testdata.load_svn_dump(dump_name) - load_dump = subprocess32.Popen( + load_dump = subprocess.Popen( ['svnadmin', 'load', repo_path], - stdin=subprocess32.PIPE, stdout=subprocess32.PIPE, - stderr=subprocess32.PIPE) + stdin=subprocess.PIPE, stdout=subprocess.PIPE, + stderr=subprocess.PIPE) out, err = load_dump.communicate(dump) if load_dump.returncode != 0: log.error("Output of load_dump command: %s", out) diff --git a/rhodecode/tests/vcs/test_utils.py b/rhodecode/tests/vcs/test_utils.py --- a/rhodecode/tests/vcs/test_utils.py +++ b/rhodecode/tests/vcs/test_utils.py @@ -20,7 +20,7 @@ import os import datetime -import subprocess32 +import subprocess import pytest @@ -86,8 +86,8 @@ class TestGetScm(object): def test_get_two_scms_for_path(self, tmpdir): multialias_repo_path = str(tmpdir) - subprocess32.check_call(['hg', 'init', multialias_repo_path]) - subprocess32.check_call(['git', 'init', multialias_repo_path]) + subprocess.check_call(['hg', 'init', multialias_repo_path]) + subprocess.check_call(['git', 'init', multialias_repo_path]) with pytest.raises(VCSError): get_scm(multialias_repo_path) diff --git a/rhodecode/tests/vcs/utils.py b/rhodecode/tests/vcs/utils.py --- a/rhodecode/tests/vcs/utils.py +++ b/rhodecode/tests/vcs/utils.py @@ -27,7 +27,7 @@ import os import re import sys -from subprocess32 import Popen +from subprocess import Popen class VCSTestError(Exception): diff --git a/rhodecode/tests/vcs_operations/__init__.py b/rhodecode/tests/vcs_operations/__init__.py --- a/rhodecode/tests/vcs_operations/__init__.py +++ b/rhodecode/tests/vcs_operations/__init__.py @@ -28,7 +28,7 @@ Base for test suite for making push/pull """ from os.path import join as jn -from subprocess32 import Popen, PIPE +from subprocess import Popen, PIPE import logging import os import tempfile