From 859c93f3905ba0b059318a9e3e6931a2b7947975 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Wed, 1 Feb 2017 15:42:02 -0800 Subject: [PATCH] comment out unused code that fails in py2 --- setup.py | 2 +- tests/test_warcprox.py | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/setup.py b/setup.py index a665f26..d4f4d6c 100755 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ except: setuptools.setup( name='warcprox', - version='2.1b1.dev47', + version='2.1b1.dev48', description='WARC writing MITM HTTP/S proxy', url='https://github.com/internetarchive/warcprox', author='Noah Levitt', diff --git a/tests/test_warcprox.py b/tests/test_warcprox.py index 8294679..b011c09 100755 --- a/tests/test_warcprox.py +++ b/tests/test_warcprox.py @@ -60,21 +60,21 @@ import certauth.certauth import warcprox -import http.client -orig_send = http.client.HTTPConnection.send -def _send(self, data): - if isinstance(data, bytes): - logging.info('sending data (bytes): ') - logging.root.handlers[0].stream.buffer.write(data) - logging.root.handlers[0].stream.buffer.write(b'\n') - elif isinstance(data, str): - logging.info('sending data (str): ') - logging.root.handlers[0].stream.write(data) - logging.root.handlers[0].stream.write('\n') - else: - logging.info('sending data from %s', repr(data)) - orig_send(self, data) -### uncomment this to see raw requests going over the wire +### uncomment this to block see raw requests going over the wire +# import http.client +# orig_send = http.client.HTTPConnection.send +# def _send(self, data): +# if isinstance(data, bytes): +# logging.info('sending data (bytes): ') +# logging.root.handlers[0].stream.buffer.write(data) +# logging.root.handlers[0].stream.buffer.write(b'\n') +# elif isinstance(data, str): +# logging.info('sending data (str): ') +# logging.root.handlers[0].stream.write(data) +# logging.root.handlers[0].stream.write('\n') +# else: +# logging.info('sending data from %s', repr(data)) +# orig_send(self, data) # http.client.HTTPConnection.send = _send logging.basicConfig(