Deleting unused directories inside devtools/python

Remove several python related tools which are no longer needed
in the build.

Change-Id: Ica9f04f8fd9c9744e17ad6b0cb52eadaa0d2de20
This commit is contained in:
Jack Ding 2018-06-14 08:17:26 -04:00 committed by jmckenna
parent b0b7201758
commit b22026ce83
6 changed files with 0 additions and 230 deletions

View File

@ -1,18 +0,0 @@
diff --git a/eventlet/wsgi.py b/eventlet/wsgi.py
index 7258277..057ef64 100644
--- a/eventlet/wsgi.py
+++ b/eventlet/wsgi.py
@@ -512,7 +512,12 @@ class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler):
hook(self.environ, *args, **kwargs)
if self.server.log_output:
- self.server.log.info(self.server.log_format % {
+ if (self.requestline.startswith('GET') and
+ (status_code[0] == '200')):
+ logger = self.server.log.debug
+ else:
+ logger = self.server.log.info
+ logger(self.server.log_format % {
'client_ip': self.get_client_ip(),
'client_port': self.client_address[1],
'date_time': self.log_date_time_string(),

View File

@ -1,48 +0,0 @@
---
nose/plugins/logcapture.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
--- a/nose/plugins/logcapture.py
+++ b/nose/plugins/logcapture.py
@@ -110,6 +110,8 @@ class LogCapture(Plugin):
logdatefmt = None
clear = False
filters = ['-nose']
+ realtime = False
+
def options(self, parser, env):
"""Register commandline options.
@@ -156,6 +158,10 @@ class LogCapture(Plugin):
"--logging-level", action="store",
default='NOTSET', dest="logcapture_level",
help="Set the log level to capture")
+ parser.add_option(
+ "--logging-realtime", action="store_true",
+ default=False, dest="logcapture_realtime",
+ help="Set to display log in realtime")
def configure(self, options, conf):
"""Configure plugin.
@@ -171,6 +177,7 @@ class LogCapture(Plugin):
self.loglevel = options.logcapture_level
if options.logcapture_filters:
self.filters = options.logcapture_filters.split(',')
+ self.logrealtime = options.logcapture_realtime
def setupLoghandler(self):
# setup our handler with root logger
@@ -193,6 +200,12 @@ class LogCapture(Plugin):
if isinstance(handler, MyMemoryHandler):
root_logger.handlers.remove(handler)
root_logger.addHandler(self.handler)
+
+ # added to see realtime logging - 31 Oct 2014
+ # add stderr output
+ if self.logrealtime:
+ root_logger.addHandler(logging.StreamHandler())
+
# to make sure everything gets captured
loglevel = getattr(self, "loglevel", "NOTSET")
root_logger.setLevel(getattr(logging, loglevel))

View File

@ -1,15 +0,0 @@
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,7 @@
# under the License.
-from distutils.core import setup
+from setuptools import setup
setup(name='rtstool',
version='0.1a4',

View File

@ -1,33 +0,0 @@
---
lib/sqlalchemy/pool.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--- a/lib/sqlalchemy/pool.py
+++ b/lib/sqlalchemy/pool.py
@@ -435,6 +435,17 @@ class _ConnectionRecord(object):
"""
return {}
+ @property
+ def pool_info(self):
+ """The ``.pool_info`` dictionary associated with the DBAPI connection.
+ """
+ pool_info = dict()
+ pool_info['Pool size'] = self.__pool.size()
+ pool_info['Connections'] = self.__pool.checkedin()
+ pool_info['Overflow'] = self.__pool.overflow()
+ pool_info['Checkedout'] = self.__pool.checkedout()
+ return pool_info
+
@classmethod
def checkout(cls, pool):
rec = pool._do_get()
@@ -540,7 +551,7 @@ class _ConnectionRecord(object):
self.__pool.logger.debug("Created new connection %r", connection)
return connection
except Exception as e:
- self.__pool.logger.debug("Error on connect(): %s", e)
+ self.__pool.logger.error("Error on connect(): %s, %s", self.__pool.status(), e)
raise

View File

@ -1,97 +0,0 @@
---
Lib/subprocess.py | 33 +++++++++++++++++++++++++++------
Lib/test/test_subprocess.py | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 6 deletions(-)
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -671,12 +671,33 @@ class Popen(object):
c2pread, c2pwrite,
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
- self._execute_child(args, executable, preexec_fn, close_fds,
- cwd, env, universal_newlines,
- startupinfo, creationflags, shell,
- p2cread, p2cwrite,
- c2pread, c2pwrite,
- errread, errwrite)
+ try:
+ self._execute_child(args, executable, preexec_fn, close_fds,
+ cwd, env, universal_newlines,
+ startupinfo, creationflags, shell,
+ p2cread, p2cwrite,
+ c2pread, c2pwrite,
+ errread, errwrite)
+ except Exception:
+ # preserve original exception in case os.close raises
+ exc_type, exc_value, exc_trace = sys.exc_info()
+
+ to_close = []
+ # only close the pipes we created
+ if stdin == PIPE:
+ to_close.extend([p2cread, p2cwrite])
+ if stdout == PIPE:
+ to_close.extend([c2pread, c2pwrite])
+ if stderr == PIPE:
+ to_close.extend([errread, errwrite])
+
+ for fd in to_close:
+ try:
+ os.close(fd)
+ except OSError:
+ pass
+
+ raise exc_type, exc_value, exc_trace
if mswindows:
if p2cwrite is not None:
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -58,6 +58,23 @@ class BaseTestCase(unittest.TestCase):
self.assertEqual(actual, expected, msg)
+class PopenTestException(Exception):
+ pass
+
+class PopenExecuteChildRaises(subprocess.Popen):
+ """ POpen subclass for testing cleanup of subprocess.PIPE filehandles when
+ _execute_child fails
+ """
+ def _execute_child(self, args, executable, preexec_fn, close_fds,
+ cwd, env, universal_newlines,
+ startupinfo, creationflags, shell,
+ p2cread, p2cwrite,
+ c2pread, c2pwrite,
+ errread, errwrite):
+
+ raise PopenTestException("Forced Exception for Test")
+
+
class ProcessTestCase(BaseTestCase):
def test_call_seq(self):
@@ -631,6 +648,23 @@ class ProcessTestCase(BaseTestCase):
time.sleep(2)
p.communicate("x" * 2**20)
+ # This test is Linux specific for simplicity to at least have
+ # some coverage. It is not a platform specific bug.
+ @unittest.skipUnless(os.path.isdir('/proc/%d/fd' % os.getpid()),
+ "Linux specific")
+ # Test for the fd leak reported in http://bugs.python.org/issue16327
+ def test_failed_child_execute_fd_leak(self):
+ fd_directory = '/proc/%d/fd' % os.getpid()
+ num_fds_before_popen = len(os.listdir(fd_directory))
+ with self.assertRaises(PopenTestException):
+ PopenExecuteChildRaises(
+ [sys.executable, "-c", "print()"], stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+
+ num_fds_after_exception = len(os.listdir(fd_directory))
+ self.assertEqual(num_fds_before_popen, num_fds_after_exception)
+
+
# context manager
class _SuppressCoreFiles(object):
"""Try to prevent core files from being created."""

View File

@ -1,19 +0,0 @@
---
Lib/logging/handlers.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -742,7 +742,11 @@ class SysLogHandler(logging.Handler):
except socket.error:
self.socket.close()
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- self.socket.connect(address)
+ try:
+ self.socket.connect(address)
+ except socket.error:
+ self.socket.close()
+ raise
# curious: when talking to the unix-domain '/dev/log' socket, a
# zero-terminator seems to be required. this string is placed