<86>Feb 3 01:13:42 userdel[124702]: delete user 'rooter' <86>Feb 3 01:13:42 userdel[124702]: removed group 'rooter' owned by 'rooter' <86>Feb 3 01:13:42 groupadd[124749]: group added to /etc/group: name=rooter, GID=597 <86>Feb 3 01:13:42 groupadd[124749]: group added to /etc/gshadow: name=rooter <86>Feb 3 01:13:42 groupadd[124749]: new group: name=rooter, GID=597 <86>Feb 3 01:13:42 useradd[124800]: new user: name=rooter, UID=597, GID=597, home=/root, shell=/bin/bash <86>Feb 3 01:13:42 userdel[124845]: delete user 'builder' <86>Feb 3 01:13:42 userdel[124845]: removed group 'builder' owned by 'builder' <86>Feb 3 01:13:42 groupadd[124980]: group added to /etc/group: name=builder, GID=598 <86>Feb 3 01:13:42 groupadd[124980]: group added to /etc/gshadow: name=builder <86>Feb 3 01:13:42 groupadd[124980]: new group: name=builder, GID=598 <86>Feb 3 01:13:42 useradd[125003]: new user: name=builder, UID=598, GID=598, home=/usr/src, shell=/bin/bash <13>Feb 3 01:13:45 rpmi: libexpat-2.2.4-alt0.M80P.1 1503871120 installed <13>Feb 3 01:13:45 rpmi: libgdbm-1.8.3-alt10 1454943313 installed <13>Feb 3 01:13:45 rpmi: libtinfo-devel-5.9-alt8 1456756459 installed <13>Feb 3 01:13:45 rpmi: libncurses-devel-5.9-alt8 1456756459 installed <13>Feb 3 01:13:45 rpmi: python-modules-curses-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:45 rpmi: libverto-0.2.6-alt1_6 1455633234 installed <13>Feb 3 01:13:45 rpmi: libkeyutils-1.5.10-alt0.M80P.2 p8+216694.100.6.1 1547827915 installed <13>Feb 3 01:13:45 rpmi: libcom_err-1.42.13-alt2 1449075846 installed <13>Feb 3 01:13:45 rpmi: ca-certificates-2016.02.25-alt1 1462368370 installed <13>Feb 3 01:13:45 rpmi: libcrypto10-1.0.2n-alt0.M80P.1 1512766129 installed <13>Feb 3 01:13:45 rpmi: libssl10-1.0.2n-alt0.M80P.1 1512766129 installed <86>Feb 3 01:13:45 groupadd[6723]: group added to /etc/group: name=_keytab, GID=499 <86>Feb 3 01:13:45 groupadd[6723]: group added to /etc/gshadow: name=_keytab <86>Feb 3 01:13:45 groupadd[6723]: new group: name=_keytab, GID=499 <13>Feb 3 01:13:45 rpmi: libkrb5-1.14.6-alt1.M80P.1 1525355673 installed <13>Feb 3 01:13:46 rpmi: python3-base-3.5.4-alt2.M80P.1 1527753911 installed <13>Feb 3 01:13:46 rpmi: python3-3.5.4-alt2.M80P.1 1527753911 installed <13>Feb 3 01:13:46 rpmi: python-modules-compiler-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:46 rpmi: rpm-build-python3-0.1.10.10-alt1.M80P.1 1530521451 installed <13>Feb 3 01:13:46 rpmi: libpython3-3.5.4-alt2.M80P.1 1527753911 installed <13>Feb 3 01:13:46 rpmi: python3-module-py-1.4.34-alt0.M80P.1 1503506764 installed <13>Feb 3 01:13:47 rpmi: python3-dev-3.5.4-alt2.M80P.1 1527753911 installed <13>Feb 3 01:13:47 rpmi: python-modules-email-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python3-module-pytest-3.2.1-alt0.M80P.1 1503499784 installed <13>Feb 3 01:13:47 rpmi: python3-module-setuptools-1:18.5-alt0.M80P.1 1497527461 installed <13>Feb 3 01:13:47 rpmi: python-modules-unittest-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-modules-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-modules-ctypes-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-modules-encodings-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-modules-multiprocessing-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-modules-logging-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-tools-2to3-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-modules-xml-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-modules-hotshot-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-modules-bsddb-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-dev-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-module-py-1.4.34-alt0.M80P.1 1503506764 installed <13>Feb 3 01:13:47 rpmi: python-modules-json-2.7.11-alt6.M80P.1 1527682470 installed <13>Feb 3 01:13:47 rpmi: python-module-pytest-3.2.1-alt0.M80P.1 1503499784 installed <13>Feb 3 01:13:47 rpmi: python-module-setuptools-1:18.5-alt0.M80P.1 1497527461 installed Installing python-module-oauth2-1.5.211-alt1.1.src.rpm Building target platforms: x86_64 Building for target x86_64 Executing(%prep): /bin/sh -e /usr/src/tmp/rpm-tmp.12771 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + rm -rf python-module-oauth2-1.5.211 + echo 'Source #0 (python-module-oauth2-1.5.211.tar):' Source #0 (python-module-oauth2-1.5.211.tar): + /bin/tar -xf /usr/src/RPM/SOURCES/python-module-oauth2-1.5.211.tar + cd python-module-oauth2-1.5.211 + /bin/chmod -c -Rf u+rwX,go-w . + cp -fR . ../python3 + find ../python3 -type f -name '*.py' -exec 2to3 -w -n '{}' + RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: Refactored ../python3/tests/test_oauth.py --- ../python3/tests/test_oauth.py (original) +++ ../python3/tests/test_oauth.py (refactored) @@ -29,15 +29,15 @@ import oauth2 as oauth import random import time -import urllib -import urlparse +import urllib.request, urllib.parse, urllib.error +import urllib.parse from types import ListType import mock import httplib2 # Fix for python2.5 compatibility try: - from urlparse import parse_qs, parse_qsl + from urllib.parse import parse_qs, parse_qsl except ImportError: from cgi import parse_qs, parse_qsl @@ -49,20 +49,20 @@ def test_message(self): try: raise oauth.Error - except oauth.Error, e: + except oauth.Error as e: self.assertEqual(e.message, 'OAuth error occurred.') msg = 'OMG THINGS BROKE!!!!' try: raise oauth.Error(msg) - except oauth.Error, e: + except oauth.Error as e: self.assertEqual(e.message, msg) def test_str(self): try: raise oauth.Error - except oauth.Error, e: - self.assertEquals(str(e), 'OAuth error occurred.') + except oauth.Error as e: + self.assertEqual(str(e), 'OAuth error occurred.') class TestGenerateFunctions(unittest.TestCase): def test_build_auth_header(self): @@ -92,16 +92,16 @@ var, val = part.split('=') returned[var] = val.strip('"') - self.assertEquals('HMAC-SHA1', returned['oauth_signature_method']) - self.assertEquals('user_token', returned['oauth_token']) - self.assertEquals('consumer_token', returned['oauth_consumer_key']) + self.assertEqual('HMAC-SHA1', returned['oauth_signature_method']) + self.assertEqual('user_token', returned['oauth_token']) + self.assertEqual('consumer_token', returned['oauth_consumer_key']) self.assertTrue('oauth_signature' in returned, 'oauth_signature') def test_escape(self): string = 'http://whatever.com/~someuser/?test=test&other=other' - self.assert_('~' in oauth.escape(string)) + self.assertTrue('~' in oauth.escape(string)) string = '../../../../../../../etc/passwd' - self.assert_('../' not in oauth.escape(string)) + self.assertTrue('../' not in oauth.escape(string)) def test_gen_nonce(self): nonce = oauth.generate_nonce() @@ -139,8 +139,8 @@ res = dict(parse_qsl(str(self.consumer))) self.assertTrue('oauth_consumer_key' in res) self.assertTrue('oauth_consumer_secret' in res) - self.assertEquals(res['oauth_consumer_key'], self.consumer.key) - self.assertEquals(res['oauth_consumer_secret'], self.consumer.secret) + self.assertEqual(res['oauth_consumer_key'], self.consumer.key) + self.assertEqual(res['oauth_consumer_secret'], self.consumer.secret) class TestToken(unittest.TestCase): def setUp(self): @@ -252,20 +252,20 @@ class ReallyEqualMixin: def failUnlessReallyEqual(self, a, b, msg=None): - self.failUnlessEqual(a, b, msg=msg) - self.failUnlessEqual(type(a), type(b), msg="a :: %r, b :: %r, %r" % (a, b, msg)) + self.assertEqual(a, b, msg=msg) + self.assertEqual(type(a), type(b), msg="a :: %r, b :: %r, %r" % (a, b, msg)) class TestFuncs(unittest.TestCase): def test_to_unicode(self): - self.failUnlessRaises(TypeError, oauth.to_unicode, '\xae') - self.failUnlessRaises(TypeError, oauth.to_unicode_optional_iterator, '\xae') - self.failUnlessRaises(TypeError, oauth.to_unicode_optional_iterator, ['\xae']) - - self.failUnlessEqual(oauth.to_unicode(':-)'), u':-)') - self.failUnlessEqual(oauth.to_unicode(u'\u00ae'), u'\u00ae') - self.failUnlessEqual(oauth.to_unicode('\xc2\xae'), u'\u00ae') - self.failUnlessEqual(oauth.to_unicode_optional_iterator([':-)']), [u':-)']) - self.failUnlessEqual(oauth.to_unicode_optional_iterator([u'\u00ae']), [u'\u00ae']) + self.assertRaises(TypeError, oauth.to_unicode, '\xae') + self.assertRaises(TypeError, oauth.tWARNING: couldn't encode ../python3/tests/test_oauth.py's diff for your terminal RefactoringTool: Refactored ../python3/setup.py RefactoringTool: No changes to ../python3/oauth2/clients/smtp.py RefactoringTool: No changes to ../python3/oauth2/clients/imap.py RefactoringTool: No changes to ../python3/oauth2/_version.py RefactoringTool: Refactored ../python3/oauth2/__init__.py o_unicode_optional_iterator, '\xae') + self.assertRaises(TypeError, oauth.to_unicode_optional_iterator, ['\xae']) + + self.assertEqual(oauth.to_unicode(':-)'), ':-)') + self.assertEqual(oauth.to_unicode('\u00ae'), '\u00ae') + self.assertEqual(oauth.to_unicode('\xc2\xae'), '\u00ae') + self.assertEqual(oauth.to_unicode_optional_iterator([':-)']), [':-)']) + self.assertEqual(oauth.to_unicode_optional_iterator(['\u00ae']), ['\u00ae']) class TestRequest(unittest.TestCase, ReallyEqualMixin): def test_setter(self): @@ -286,7 +286,7 @@ self.fail("AttributeError should have been raised on empty url.") except AttributeError: pass - except Exception, e: + except Exception as e: self.fail(str(e)) def test_url(self): @@ -297,12 +297,12 @@ method = "GET" req = oauth.Request(method, url1) - self.assertEquals(req.normalized_url, exp1) - self.assertEquals(req.url, url1) + self.assertEqual(req.normalized_url, exp1) + self.assertEqual(req.url, url1) req = oauth.Request(method, url2) - self.assertEquals(req.normalized_url, exp2) - self.assertEquals(req.url, url2) + self.assertEqual(req.normalized_url, exp2) + self.assertEqual(req.url, url2) def test_bad_url(self): request = oauth.Request() @@ -319,8 +319,8 @@ request.sign_request(oauth.SignatureMethod_HMAC_SHA1(), consumer, token) - self.assertEquals(consumer.key, request['oauth_consumer_key']) - self.assertEquals(token.key, request['oauth_token']) + self.assertEqual(consumer.key, request['oauth_consumer_key']) + self.assertEqual(token.key, request['oauth_token']) def test_no_url_set(self): consumer = oauth.Consumer('my_consumer_key', 'my_consumer_secret') @@ -338,12 +338,12 @@ def test_url_query(self): url = "https://www.google.com/m8/feeds/contacts/default/full/?alt=json&max-contacts=10" - normalized_url = urlparse.urlunparse(urlparse.urlparse(url)[:3] + (None, None, None)) + normalized_url = urllib.parse.urlunparse(urllib.parse.urlparse(url)[:3] + (None, None, None)) method = "GET" req = oauth.Request(method, url) - self.assertEquals(req.url, url) - self.assertEquals(req.normalized_url, normalized_url) + self.assertEqual(req.url, url) + self.assertEqual(req.normalized_url, normalized_url) def test_get_parameter(self): url = "http://example.com" @@ -351,7 +351,7 @@ params = {'oauth_consumer' : 'asdf'} req = oauth.Request(method, url, parameters=params) - self.assertEquals(req.get_parameter('oauth_consumer'), 'asdf') + self.assertEqual(req.get_parameter('oauth_consumer'), 'asdf') self.assertRaises(oauth.Error, req.get_parameter, 'blah') def test_get_nonoauth_parameters(self): @@ -361,19 +361,19 @@ } other_params = { - u'foo': u'baz', - u'bar': u'foo', - u'multi': [u'FOO',u'BAR'], - u'uni_utf8': u'\xae', - u'uni_unicode': u'\u00ae', --- ../python3/setup.py (original) +++ ../python3/setup.py (refactored) @@ -15,7 +15,7 @@ if mo: mverstr = mo.group(1) else: - print "unable to find version in %s" % (VERSIONFILE,) + print("unable to find version in %s" % (VERSIONFILE,)) raise RuntimeError("if %s.py exists, it must be well-formed" % (VERSIONFILE,)) AVSRE = r"^auto_build_num *= *['\"]([^'\"]*)['\"]" mo = re.search(AVSRE, verstrline, re.M) --- ../python3/oauth2/__init__.py (original) +++ ../python3/oauth2/__init__.py (refactored) @@ -23,16 +23,16 @@ """ import base64 -import urllib +import urllib.request, urllib.parse, urllib.error import time import random -import urlparse +import urllib.parse import hmac import binascii import httplib2 try: - from urlparse import parse_qs + from urllib.parse import parse_qs parse_qs # placate pyflakes except ImportError: # fall back for Python 2.5 @@ -45,7 +45,7 @@ # hashlib was added in Python 2.5 import sha -import _version +from . import _version __version__ = _version.__version__ @@ -87,7 +87,7 @@ request.sign_request(signing_method, consumer, token) params = [] - for k, v in sorted(request.iteritems()): + for k, v in sorted(request.items()): if v is not None: params.append('%s="%s"' % (k, escape(v))) @@ -97,12 +97,12 @@ def to_unicode(s): """ Convert to unicode, raise exception with instructive error message if s is not unicode, ascii, or utf-8. """ - if not isinstance(s, unicode): + if not isinstance(s, str): if not isinstance(s, str): raise TypeError('You are required to pass either unicode or string here, not: %r (%s)' % (type(s), s)) try: s = s.decode('utf-8') - except UnicodeDecodeError, le: + except UnicodeDecodeError as le: raise TypeError('You are required to pass either a unicode object or a utf-8 string here. You passed a Python string object which contained non-utf-8: %r. The UnicodeDecodeError that resulted from attempting to interpret it as utf-8 was: %s' % (s, le,)) return s @@ -110,13 +110,13 @@ return to_unicode(s).encode('utf-8') def to_unicode_if_string(s): - if isinstance(s, basestring): + if isinstance(s, str): return to_unicode(s) else: return s def to_utf8_if_string(s): - if isinstance(s, basestring): + if isinstance(s, str): return to_utf8(s) else: return s @@ -126,12 +126,12 @@ Raise TypeError if x is a str containing non-utf8 bytes or if x is an iterable which contains such a str. """ - if isinstance(x, basestring): + if isinstance(x, str): return to_unicode(x) try: l = list(x) - except TypeError, e: + except TypeError as e: assert 'is not iterable' in str(e) return x else: @@ -142,12 +142,12 @@ Raise TypeError if x is a str or if x is an iterable which contains a str. """ - if isinstance(x, basestring): + if isinstance(x, str): return to_utf8(x) try: l = list(x) - except TypeError, e: + except TypeError as e: assert 'is not iterable' in str(e) return x else: @@ -155,7 +155,7 @@ def escape(s): """Escape a URL including any /.""" - return urllib.quote(s.encode('utf-8'), safe='~') + return urllib.parse.quote(s.encode('utf-8'), safe='~') def generate_timestamp(): """Get seconds since epoch (UTC).""" @@ -206,7 +206,7 @@ data = {'oauth_consumer_key': self.key, 'oauth_consumer_secret': self.secret} - return urllib.urlencode(data) + return urllib.parse.urlencode(data) class Token(object): @@ -250,13 +250,13 @@ def get_callback_url(self): if self.callback and self.verifier: # Append the oauth_verifier. - parts = urlparse.urlparse(self.callback) + parts = urllib.parse.urlparse(self.callback) scheme, netloc, path, params, query, fragment = parts[:6] if query: query = '%s&oauth_verifier=%s' % (query, self.verifier) else: query = 'oauth_verifier=%s' % self.verifier - return urlparse.urlunparse((scheme, netloc, path, params, + return urllib.parse.urlunparse((scheme, netloc, path, params, query, fragment)) return self.callback @@ -274,7 +274,7 @@ if self.callback_confirmed is not None: data['oauth_callback_confirmed'] = self.callback_confirmed - return urllib.urlencode(data) + return urllib.parse.urlencode(data) @staticmethod def from_string(s): @@ -345,7 +345,7 @@ self.url = to_unicode(url) self.method = method if parameters is not None: - for k, v in parameters.iteritems(): + for k, v in parameters.items(): k = to_unicode(k) v = to_unicode_optional_iterator(v) self[k] = v @@ -357,7 +357,7 @@ def url(self, value): self.__dict__['url'] = value if value is not None: - scheme, netloc, path, params, query, fragment = urlparse.urlparse(value) + scheme, netloc, path, params, query, fragment = urllib.parse.urlparse(value) # Exclude default port numbers. if scheme == 'http' and netloc[-3:] == ':80': @@ -368,7 +368,7 @@ raise ValueError("Unsupported URL %s (%s)." % (value, scheme)) # Normalized URL excludes params, query, and fragment. - self.normalized_url = urlparse.urlunparse((scheme, netloc, path, None, None, None)) + self.normalized_url = urllib.parse.urlunparse((scheme, netloc, path, None, None, None)) else: self.normalized_url = None self.__dict__['url'] = None @@ -382,12 +382,12 @@ def get_nonoauth_parameters(self): """Get any non-OAuth parameters.""" - return dict([(k, v) for k, v in self.iteritems() + return dict([(k, v) for k, v in self.items() if not k.startswith('oauth_')]) def to_header(self, realm=''): """Serialize as a header for an HTTPAuth request.""" - oauth_params = ((k, v) for k, v in self.items() + oauth_params = ((k, v) for k, v in list(self.items()) if k.startswith('oauth_')) stringy_params = ((k, escape(str(v))) for k, v in oauth_params) header_params = ('%s="%s"' % (k, v) for k, v in stringy_params) @@ -402,24 +402,24 @@ def to_postdata(self): """Serialize as post data for a POST request.""" d = {} - for k, v in self.iteritems(): + for k, v in self.items(): d[k.encode('utf-8')] = to_utf8_optional_iterator(v) # tell urlencode to deal with sequence values and map them correctly # to resulting querystring. for example self["k"] = ["v1", "v2"] will # result in 'k=v1&k=v2' and not k=%5B%27v1%27%2C+%27v2%27%5D - return urllib.urlencode(d, True).replace('+', '%20') + return urllib.parse.urlencode(d, True).replace('+', '%20') def to_url(self): """Serialize as a URL for a GET request.""" - base_url = urlparse.urlparse(self.url) + base_url = urllib.parse.urlparse(self.url) try: query = base_url.query except AttributeError: # must be python <2.5 query = base_url[4] query = parse_qs(query) - for k, v in self.items(): + for k, v in list(self.items()): query.setdefault(k, []).append(v) try: @@ -437,8 +437,8 @@ fragment = base_url[5] url = (scheme, netloc, path, params, - urllib.urlencode(query, True), fragment) - return urlparse.urlunparse(url) + urllib.parse.urlencode(query, True), fragment) + return urllib.parse.urlunparse(url) def get_parameter(self, parameter): ret = self.get(parameter) @@ -450,31 +450,31 @@ def get_normalized_parameters(self): """Return a string that contains the parameters that must be signed.""" items = [] - for key, value in self.iteritems(): + for key, value in self.items(): if key == 'oauth_signature': continue # 1.0a/9.1.1 states that kvp must be sorted by key, then by value, # so we unpack sequence values into multiple items for sorting. - if isinstance(value, basestring): + if isinstance(value, str): items.append((to_utf8_if_string(key), to_utf8(value))) else: try: value = list(value) - except TypeError, e: + except TypeError as e: assert 'is not iterable' in str(e) RefactoringTool: Refactored ../python3/example/server.py items.append((to_utf8_if_string(key), to_utf8_if_string(value))) else: items.extend((to_utf8_if_string(key), to_utf8_if_string(item)) for item in value) # Include any query string parameters from the provided URL - query = urlparse.urlparse(self.url)[4] - - url_items = self._split_url_string(query).items() + query = urllib.parse.urlparse(self.url)[4] + + url_items = list(self._split_url_string(query).items()) url_items = [(to_utf8(k), to_utf8(v)) for k, v in url_items if k != 'oauth_signature' ] items.extend(url_items) items.sort() - encoded_str = urllib.urlencode(items) + encoded_str = urllib.parse.urlencode(items) # Encode signature parameters per Oauth Core 1.0 protocol # spec draft 7, section 3.6 # (http://tools.ietf.org/html/draft-hammer-oauth-07#section-3.6) @@ -538,7 +538,7 @@ parameters.update(query_params) # URL parameters. - param_str = urlparse.urlparse(http_url)[4] # query + param_str = urllib.parse.urlparse(http_url)[4] # query url_params = cls._split_url_string(param_str) parameters.update(url_params) @@ -600,15 +600,15 @@ # Split key-value. param_parts = param.split('=', 1) # Remove quotes and unescape the value. - params[param_parts[0]] = urllib.unquote(param_parts[1].strip('\"')) + params[param_parts[0]] = urllib.parse.unquote(param_parts[1].strip('\"')) return params @staticmethod def _split_url_string(param_str): """Turn URL string into parameters.""" parameters = parse_qs(param_str.encode('utf-8'), keep_blank_values=True) - for k, v in parameters.iteritems(): - parameters[k] = urllib.unquote(v[0]) + for k, v in parameters.items(): + parameters[k] = urllib.parse.unquote(v[0]) return parameters @@ -661,12 +661,12 @@ req.sign_request(self.method, self.consumer, self.token) - schema, rest = urllib.splittype(uri) + schema, rest = urllib.parse.splittype(uri) if rest.startswith('//'): hierpart = '//' else: hierpart = '' - host, rest = urllib.splithost(rest) + host, rest = urllib.parse.splithost(rest) realm = schema + ':' + hierpart + host @@ -740,7 +740,7 @@ # Get the signature method object. signature_method = self.signature_methods[signature_method] except: - signature_method_names = ', '.join(self.signature_methods.keys()) + signature_method_names = ', '.join(list(self.signature_methods.keys())) raise Error('Signature method %s not supported try one of the following: %s' % (signature_method, signature_method_names)) return signature_method --- ../python3/example/server.py (original) +++ ../python3/example/server.py (refactored) @@ -22,8 +22,8 @@ THE SOFTWARE. """ -from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer -import urllib +from http.server import BaseHTTPRequestHandler, HTTPServer +import urllib.request, urllib.parse, urllib.error import oauth.oauth as oauth @@ -101,7 +101,7 @@ self.send_error(401, str(err.message)) # return the authenticate header header = oauth.build_authenticate_header(realm=REALM) - for k, v in header.iteritems(): + for k, v in header.items(): self.send_header(k, v) def do_GET(self): @@ -131,7 +131,7 @@ self.end_headers() # return the token self.wfile.write(token.to_string()) - except oauth.OAuthError, err: + except oauth.OAuthError as err: self.send_oauth_error(err) return @@ -148,7 +148,7 @@ self.end_headers() # return the callback url (to show server has it) self.wfile.write(token.get_callback_urlRefactoringTool: Refactored ../python3/example/client.py ()) - except oauth.OAuthError, err: + except oauth.OAuthError as err: self.send_oauth_error(err) return @@ -162,7 +162,7 @@ self.end_headers() # return the token self.wfile.write(token.to_string()) - except oauth.OAuthError, err: + except oauth.OAuthError as err: self.send_oauth_error(err) return @@ -176,7 +176,7 @@ self.end_headers() # return the extra parameters - just for something to return self.wfile.write(str(params)) - except oauth.OAuthError, err: + except oauth.OAuthError as err: self.send_oauth_error(err) return @@ -186,7 +186,7 @@ def main(): try: server = HTTPServer(('', 8080), RequestHandler) - print 'Test server running...' + print('Test server running...') server.serve_forever() except KeyboardInterrupt: server.socket.close() --- ../python3/example/client.py (original) +++ ../python3/example/client.py (refactored) @@ -26,7 +26,7 @@ or find one that works with your web framework. """ -import httplib +import http.client import time import oauth.oauth as oauth @@ -48,13 +48,13 @@ # example client using httplib with headers class SimpleOAuthClient(oauth.OAuthClient): - def __init__(self, server, port=httplib.HTTP_PORT, request_token_url='', access_token_url='', authorization_url=''): + def __init__(self, server, port=http.client.HTTP_PORT, request_token_url='', access_token_url='', authorization_url=''): self.server = server self.port = port self.request_token_url = request_token_url self.access_token_url = access_token_url self.authorization_url = authorization_url - self.connection = httplib.HTTPConnection("%s:%d" % (self.server, self.port)) + self.connection = http.client.HTTPConnection("%s:%d" % (self.server, self.port)) def fetch_request_token(self, oauth_request): # via headers @@ -88,7 +88,7 @@ def run_example(): # setup - print '** OAuth Python Library Example **' + print('** OAuth Python Library Example **') client = SimpleOAuthClient(SERVER, PORT, REQUEST_TOKEN_URL, ACCESS_TOKEN_URL, AUTHORIZATION_URL) consumer = oauth.OAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET) signature_method_plaintext = oauth.OAuthSignatureMethod_PLAINTEXT() @@ -96,70 +96,70 @@ pause() # get request token - print '* Obtain a request token ...' + print('* Obtain a request token ...') pause() oauth_request = oauth.OAuthRequest.from_consumer_and_token(consumer, callback=CALLBACK_URL, http_url=client.request_token_url) oauth_request.sign_request(signature_method_plaintext, consumer, None) - print 'REQUEST (via headers)' - print 'parameters: %s' % str(oauth_request.parameters) + print('REQUEST (via headers)') + print('parameters: %s' % str(oauth_request.parameters)) pause() token = client.fetch_request_token(oauth_request) - print 'GOT' - print 'key: %s' % str(token.key) - print 'secret: %s' % str(token.secret) - print 'callback confirmed? %s' % str(token.callback_confirmed) + print('GOT') + print('key: %s' % str(token.key)) + print('secret: %s' % str(token.secret)) + print('callback confirmed? %s' % str(token.callback_confirmed)) pause() - print '* Authorize the request token ...' + print('* Authorize the request token ...') pause() oauth_request = oauth.OAuthRequest.from_token_and_callback(token=token, http_url=client.authorization_url) - print 'REQUEST (via url query string)' - print 'parameters: %s' % str(oauth_request.parameters) + print('REQUEST (via url query string)') + print('parameters: %s' % str(oauth_request.parameters)) pause() # this will actually occur only on some callback response = client.authorize_token(oauth_request) - print 'GOT' - print response + RefactoringTool: Refactored ../python3/example/appengine_oauth.py RefactoringTool: Files that were modified: RefactoringTool: ../python3/tests/test_oauth.py RefactoringTool: ../python3/setup.py RefactoringTool: ../python3/oauth2/clients/smtp.py RefactoringTool: ../python3/oauth2/clients/imap.py RefactoringTool: ../python3/oauth2/_version.py RefactoringTool: ../python3/oauth2/__init__.py RefactoringTool: ../python3/example/server.py RefactoringTool: ../python3/example/client.py RefactoringTool: ../python3/example/appengine_oauth.py print('GOT') + print(response) # sad way to get the verifier - import urlparse, cgi - query = urlparse.urlparse(response)[4] + import urllib.parse, cgi + query = urllib.parse.urlparse(response)[4] params = cgi.parse_qs(query, keep_blank_values=False) verifier = params['oauth_verifier'][0] - print 'verifier: %s' % verifier + print('verifier: %s' % verifier) pause() # get access token - print '* Obtain an access token ...' + print('* Obtain an access token ...') pause() oauth_request = oauth.OAuthRequest.from_consumer_and_token(consumer, token=token, verifier=verifier, http_url=client.access_token_url) oauth_request.sign_request(signature_method_plaintext, consumer, token) - print 'REQUEST (via headers)' - print 'parameters: %s' % str(oauth_request.parameters) + print('REQUEST (via headers)') + print('parameters: %s' % str(oauth_request.parameters)) pause() token = client.fetch_access_token(oauth_request) - print 'GOT' - print 'key: %s' % str(token.key) - print 'secret: %s' % str(token.secret) + print('GOT') + print('key: %s' % str(token.key)) + print('secret: %s' % str(token.secret)) pause() # access some protected resources - print '* Access protected resources ...' + print('* Access protected resources ...') pause() parameters = {'file': 'vacation.jpg', 'size': 'original'} # resource specific params oauth_request = oauth.OAuthRequest.from_consumer_and_token(consumer, token=token, http_method='POST', http_url=RESOURCE_URL, parameters=parameters) oauth_request.sign_request(signature_method_hmac_sha1, consumer, token) - print 'REQUEST (via post body)' - print 'parameters: %s' % str(oauth_request.parameters) + print('REQUEST (via post body)') + print('parameters: %s' % str(oauth_request.parameters)) pause() params = client.access_resource(oauth_request) - print 'GOT' - print 'non-oauth parameters: %s' % params + print('GOT') + print('non-oauth parameters: %s' % params) pause() def pause(): - print '' + print('') time.sleep(1) if __name__ == '__main__': run_example() - print 'Done.' + print('Done.') --- ../python3/example/appengine_oauth.py (original) +++ ../python3/example/appengine_oauth.py (refactored) @@ -86,7 +86,7 @@ request = self.get_oauth_request() client = self.get_client(request) params = self._server.verify_request(request, client, None) - except Exception, e: + except Exception as e: raise e return client @@ -95,7 +95,7 @@ def get(self): try: client = self.is_valid() - except Exception, e: + except Exception as e: self.error(500) self.response.out.write(e) + exit 0 Executing(%build): /bin/sh -e /usr/src/tmp/rpm-tmp.36392 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd python-module-oauth2-1.5.211 + CFLAGS='-pipe -Wall -g -O2' + export CFLAGS + CXXFLAGS='-pipe -Wall -g -O2' + export CXXFLAGS + FFLAGS='-pipe -Wall -g -O2' + export FFLAGS + /usr/bin/python setup.py build running build running build_py creating build creating build/lib creating build/lib/tests copying tests/test_oauth.py -> build/lib/tests copying tests/__init__.py -> build/lib/tests creating build/lib/oauth2 copying oauth2/_version.py -> build/lib/oauth2 copying oauth2/__init__.py -> build/lib/oauth2 creating build/lib/oauth2/clients copying oauth2/clients/smtp.py -> build/lib/oauth2/clients copying oauth2/clients/imap.py -> build/lib/oauth2/clients copying oauth2/clients/__init__.py -> build/lib/oauth2/clients + pushd ../python3 ~/RPM/BUILD/python3 ~/RPM/BUILD/python-module-oauth2-1.5.211 + CFLAGS='-pipe -Wall -g -O2' + export CFLAGS + CXXFLAGS='-pipe -Wall -g -O2' + export CXXFLAGS + FFLAGS='-pipe -Wall -g -O2' + export FFLAGS + python3 setup.py build running build running build_py creating build creating build/lib creating build/lib/tests copying tests/test_oauth.py -> build/lib/tests copying tests/__init__.py -> build/lib/tests creating build/lib/oauth2 copying oauth2/_version.py -> build/lib/oauth2 copying oauth2/__init__.py -> build/lib/oauth2 creating build/lib/oauth2/clients copying oauth2/clients/smtp.py -> build/lib/oauth2/clients copying oauth2/clients/imap.py -> build/lib/oauth2/clients copying oauth2/clients/__init__.py -> build/lib/oauth2/clients + popd ~/RPM/BUILD/python-module-oauth2-1.5.211 + exit 0 Executing(%install): /bin/sh -e /usr/src/tmp/rpm-tmp.76949 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + /bin/chmod -Rf u+rwX -- /usr/src/tmp/python-module-oauth2-buildroot + : + /bin/rm -rf -- /usr/src/tmp/python-module-oauth2-buildroot + cd python-module-oauth2-1.5.211 + /usr/bin/python setup.py install --skip-build --root=/usr/src/tmp/python-module-oauth2-buildroot --force running install running install_lib creating /usr/src/tmp/python-module-oauth2-buildroot creating /usr/src/tmp/python-module-oauth2-buildroot/usr creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7 creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2 creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients copying build/lib/oauth2/clients/__init__.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients copying build/lib/oauth2/clients/imap.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients copying build/lib/oauth2/clients/smtp.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients copying build/lib/oauth2/__init__.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2 copying build/lib/oauth2/_version.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2 creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/tests copying build/lib/tests/__init__.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/tests copying build/lib/tests/test_oauth.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/tests byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/__init__.py to __init__.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/imap.py to imap.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/smtp.py to smtp.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/__init__.py to __init__.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/_version.py to _version.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/tests/__init__.py to __init__.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/tests/test_oauth.py to test_oauth.pyc running install_egg_info running egg_info creating oauth2.egg-info writing requirements to oauth2.egg-info/requires.txt writing oauth2.egg-info/PKG-INFO writing top-level names to oauth2.egg-info/top_level.txt writing dependency_links to oauth2.egg-info/dependency_links.txt writing manifest file 'oauth2.egg-info/SOURCES.txt' reading manifest file 'oauth2.egg-info/SOURCES.txt' writing manifest file 'oauth2.egg-info/SOURCES.txt' Copying oauth2.egg-info to /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2-1.5.211-py2.7.egg-info running install_scripts + rm -rf /usr/src/tmp/python-module-oauth2-buildroot//usr/lib/python2.7/site-packages/tests + pushd ../python3 ~/RPM/BUILD/python3 ~/RPM/BUILD/python-module-oauth2-1.5.211 + python3 setup.py install --skip-build --root=/usr/src/tmp/python-module-oauth2-buildroot --force running install running install_lib creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3 creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2 creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients copying build/lib/oauth2/clients/__init__.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients copying build/lib/oauth2/clients/imap.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients copying build/lib/oauth2/clients/smtp.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients copying build/lib/oauth2/__init__.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2 copying build/lib/oauth2/_version.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2 creating /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/tests copying build/lib/tests/__init__.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/tests copying build/lib/tests/test_oauth.py -> /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/tests byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/__init__.py to __init__.cpython-35.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/imap.py to imap.cpython-35.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/smtp.py to smtp.cpython-35.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__init__.py to __init__.cpython-35.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/_version.py to _version.cpython-35.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/tests/__init__.py to __init__.cpython-35.pyc byte-compiling /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/tests/test_oauth.py to test_oauth.cpython-35.pyc running install_egg_info running egg_info creating oauth2.egg-info writing top-level names to oauth2.egg-info/top_level.txt writing dependency_links to oauth2.egg-info/dependency_links.txt writing requirements to oauth2.egg-info/requires.txt writing oauth2.egg-info/PKG-INFO writing manifest file 'oauth2.egg-info/SOURCES.txt' reading manifest file 'oauth2.egg-info/SOURCES.txt' writing manifest file 'oauth2.egg-info/SOURCES.txt' Copying oauth2.egg-info to /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2-1.5.211-py3.5.egg-info running install_scripts + popd ~/RPM/BUILD/python-module-oauth2-1.5.211 + rm -rf /usr/src/tmp/python-module-oauth2-buildroot//usr/lib/python3/site-packages/tests + /usr/lib/rpm/brp-alt Cleaning files in /usr/src/tmp/python-module-oauth2-buildroot (auto) Verifying and fixing files in /usr/src/tmp/python-module-oauth2-buildroot (binconfig,pkgconfig,libtool,desktop) Compressing files in /usr/src/tmp/python-module-oauth2-buildroot (auto) Adjusting library links in /usr/src/tmp/python-module-oauth2-buildroot ./usr/lib: Verifying ELF objects in /usr/src/tmp/python-module-oauth2-buildroot (arch=normal,fhs=normal,lfs=relaxed,lint=relaxed,rpath=normal,stack=normal,textrel=normal,unresolved=normal) Bytecompiling python modules in /usr/src/tmp/python-module-oauth2-buildroot using /usr/bin/python unlink /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/__init__.pyc unlink /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/imap.pyc unlink /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/smtp.pyc compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/__init__.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/imap.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/smtp.py unlink /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/__init__.pyc unlink /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/_version.pyc compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/__init__.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/_version.py Bytecompiling python modules with optimization in /usr/src/tmp/python-module-oauth2-buildroot using /usr/bin/python -O compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/__init__.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/imap.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/smtp.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/__init__.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/_version.py Bytecompiling python3 modules in /usr/src/tmp/python-module-oauth2-buildroot using python3 unlink /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__pycache__/__init__.cpython-35.pyc unlink /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__pycache__/_version.cpython-35.pyc unlink /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/__pycache__/__init__.cpython-35.pyc unlink /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/__pycache__/imap.cpython-35.pyc unlink /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/__pycache__/smtp.cpython-35.pyc compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/__init__.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/imap.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/smtp.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__init__.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/_version.py Bytecompiling python3 modules with optimization in /usr/src/tmp/python-module-oauth2-buildroot using python3 -O compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/__init__.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/imap.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/smtp.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__init__.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/_version.py Bytecompiling python3 modules with optimization-2 in /usr/src/tmp/python-module-oauth2-buildroot using python3 -OO compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/__init__.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/imap.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/clients/smtp.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__init__.py compile /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/_version.py Hardlinking identical .pyc and .opt-?.pyc files './usr/lib/python3/site-packages/oauth2/__pycache__/_version.cpython-35.opt-1.pyc' => './usr/lib/python3/site-packages/oauth2/__pycache__/_version.cpython-35.pyc' './usr/lib/python3/site-packages/oauth2/__pycache__/_version.cpython-35.opt-2.pyc' => './usr/lib/python3/site-packages/oauth2/__pycache__/_version.cpython-35.opt-1.pyc' './usr/lib/python3/site-packages/oauth2/clients/__pycache__/smtp.cpython-35.opt-1.pyc' => './usr/lib/python3/site-packages/oauth2/clients/__pycache__/smtp.cpython-35.pyc' './usr/lib/python3/site-packages/oauth2/clients/__pycache__/imap.cpython-35.opt-1.pyc' => './usr/lib/python3/site-packages/oauth2/clients/__pycache__/imap.cpython-35.pyc' './usr/lib/python3/site-packages/oauth2/clients/__pycache__/__init__.cpython-35.opt-1.pyc' => './usr/lib/python3/site-packages/oauth2/clients/__pycache__/__init__.cpython-35.pyc' './usr/lib/python3/site-packages/oauth2/clients/__pycache__/__init__.cpython-35.opt-2.pyc' => './usr/lib/python3/site-packages/oauth2/clients/__pycache__/__init__.cpython-35.opt-1.pyc' Hardlinking identical .pyc and .pyo files './usr/lib/python2.7/site-packages/oauth2/_version.pyo' => './usr/lib/python2.7/site-packages/oauth2/_version.pyc' './usr/lib/python2.7/site-packages/oauth2/clients/smtp.pyo' => './usr/lib/python2.7/site-packages/oauth2/clients/smtp.pyc' './usr/lib/python2.7/site-packages/oauth2/clients/imap.pyo' => './usr/lib/python2.7/site-packages/oauth2/clients/imap.pyc' './usr/lib/python2.7/site-packages/oauth2/clients/__init__.pyo' => './usr/lib/python2.7/site-packages/oauth2/clients/__init__.pyc' Processing files: python-module-oauth2-1.5.211-alt1.1 Executing(%doc): /bin/sh -e /usr/src/tmp/rpm-tmp.44258 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd python-module-oauth2-1.5.211 + DOCDIR=/usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python-module-oauth2-1.5.211 + export DOCDIR + rm -rf /usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python-module-oauth2-1.5.211 + /bin/mkdir -p /usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python-module-oauth2-1.5.211 + cp -prL LICENSE.txt README.md example/ /usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python-module-oauth2-1.5.211 + chmod -R go-w /usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python-module-oauth2-1.5.211 + chmod -R a+rX /usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python-module-oauth2-1.5.211 + exit 0 Finding Provides (using /usr/lib/rpm/find-provides) Executing: /bin/sh -e /usr/src/tmp/rpm-tmp.RHXLSK find-provides: running scripts (alternatives,debuginfo,lib,pam,perl,pkgconfig,python,python3,shell) Finding Requires (using /usr/lib/rpm/find-requires) Executing: /bin/sh -e /usr/src/tmp/rpm-tmp.kAu7Cj find-requires: running scripts (cpp,debuginfo,files,lib,pam,perl,pkgconfig,pkgconfiglib,python,python3,rpmlib,shebang,shell,static,symlinks) /usr/lib/rpm/python.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/__init__.py: line=35 IGNORE (for REQ=slight and deep=8) module=urlparse /usr/lib/rpm/python.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/__init__.py: line=39 IGNORE (for REQ=slight and deep=8) module=cgi /usr/lib/rpm/python.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/__init__.py: line=42 IGNORE (for REQ=slight and deep=8) module=hashlib /usr/lib/rpm/python.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/__init__.py: line=46 IGNORE (for REQ=slight and deep=8) module=sha python.req: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/__init__.py: hiding _version, which SEEMS TO BE SELF-SATISFIED /usr/lib/rpm/python.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/_version.py: line=13 IGNORE (for REQ=slight and deep=8) module=pyutil /usr/lib/rpm/python.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/_version.py: line=17 IGNORE (for REQ=slight and deep=8) module=distutils python.req: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/imap.py: hiding oauth2, which SEEMS TO BE SELF-SATISFIED python.req: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python2.7/site-packages/oauth2/clients/smtp.py: hiding oauth2, which SEEMS TO BE SELF-SATISFIED Provides: python2.7(oauth2), python2.7(oauth2._version), python2.7(oauth2.clients), python2.7(oauth2.clients.imap), python2.7(oauth2.clients.smtp) Requires: /usr/lib/python2.7/site-packages, python-modules, python2.7(httplib2) Processing files: python3-module-oauth2-1.5.211-alt1.1 Executing(%doc): /bin/sh -e /usr/src/tmp/rpm-tmp.13441 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd python-module-oauth2-1.5.211 + DOCDIR=/usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python3-module-oauth2-1.5.211 + export DOCDIR + rm -rf /usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python3-module-oauth2-1.5.211 + /bin/mkdir -p /usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python3-module-oauth2-1.5.211 + cp -prL LICENSE.txt README.md example/ /usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python3-module-oauth2-1.5.211 + chmod -R go-w /usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python3-module-oauth2-1.5.211 + chmod -R a+rX /usr/src/tmp/python-module-oauth2-buildroot/usr/share/doc/python3-module-oauth2-1.5.211 + exit 0 Finding Provides (using /usr/lib/rpm/find-provides) Executing: /bin/sh -e /usr/src/tmp/rpm-tmp.r9wS0V find-provides: running scripts (alternatives,debuginfo,lib,pam,perl,pkgconfig,python,python3,shell) Finding Requires (using /usr/lib/rpm/find-requires) Executing: /bin/sh -e /usr/src/tmp/rpm-tmp.KiLGtB find-requires: running scripts (cpp,debuginfo,files,lib,pam,perl,pkgconfig,pkgconfiglib,python,python3,rpmlib,shebang,shell,static,symlinks) python3.req: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__init__.py: skipping time /usr/lib/rpm/python3.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__init__.py: line=35 IGNORE (for REQ=slight and deep=8) module=urllib /usr/lib/rpm/python3.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__init__.py: line=39 IGNORE (for REQ=slight and deep=8) module=cgi /usr/lib/rpm/python3.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__init__.py: line=42 IGNORE (for REQ=slight and deep=8) module=hashlib /usr/lib/rpm/python3.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__init__.py: line=46 IGNORE (for REQ=slight and deep=8) module=sha /usr/lib/rpm/python3.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/__init__.py: line=48 possible relative import from ., UNIMPLEMENTED /usr/lib/rpm/python3.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/_version.py: line=13 IGNORE (for REQ=slight and deep=8) module=pyutil /usr/lib/rpm/python3.req.py: /usr/src/tmp/python-module-oauth2-buildroot/usr/lib/python3/site-packages/oauth2/_version.py: line=17 IGNORE (for REQ=slight and deep=8) module=distutils Provides: python3(oauth2), python3(oauth2._version), python3(oauth2.clients), python3(oauth2.clients.imap), python3(oauth2.clients.smtp), python3.3(oauth2), python3.3(oauth2._version), python3.3(oauth2.clients), python3.3(oauth2.clients.imap), python3.3(oauth2.clients.smtp) Requires: /usr/lib/python3/site-packages, python3(base64) < 0, python3(binascii) < 0, python3(hmac) < 0, python3(httplib2) < 0, python3(imaplib) < 0, python3(random) < 0, python3(smtplib) < 0, python3(urllib) < 0 Wrote: /usr/src/RPM/RPMS/noarch/python-module-oauth2-1.5.211-alt1.1.noarch.rpm Wrote: /usr/src/RPM/RPMS/noarch/python3-module-oauth2-1.5.211-alt1.1.noarch.rpm 7.04user 1.35system 0:11.91elapsed 70%CPU (0avgtext+0avgdata 46508maxresident)k 0inputs+0outputs (0major+220719minor)pagefaults 0swaps 18.81user 5.04system 0:28.85elapsed 82%CPU (0avgtext+0avgdata 125172maxresident)k 0inputs+0outputs (0major+594699minor)pagefaults 0swaps --- python3-module-oauth2-1.5.211-alt1.1.noarch.rpm.repo 2016-03-15 00:37:06.000000000 +0000 +++ python3-module-oauth2-1.5.211-alt1.1.noarch.rpm.hasher 2019-02-03 01:14:02.551960880 +0000 @@ -1,13 +1,17 @@ /usr/lib/python3/site-packages/oauth2 40755 -/usr/lib/python3/site-packages/oauth2-1.5.211-py3.3.egg-info 40755 -/usr/lib/python3/site-packages/oauth2-1.5.211-py3.3.egg-info/PKG-INFO 100644 -/usr/lib/python3/site-packages/oauth2-1.5.211-py3.3.egg-info/SOURCES.txt 100644 -/usr/lib/python3/site-packages/oauth2-1.5.211-py3.3.egg-info/dependency_links.txt 100644 -/usr/lib/python3/site-packages/oauth2-1.5.211-py3.3.egg-info/requires.txt 100644 -/usr/lib/python3/site-packages/oauth2-1.5.211-py3.3.egg-info/top_level.txt 100644 -/usr/lib/python3/site-packages/oauth2-1.5.211-py3.3.egg-info/zip-safe 100644 +/usr/lib/python3/site-packages/oauth2-1.5.211-py3.5.egg-info 40755 +/usr/lib/python3/site-packages/oauth2-1.5.211-py3.5.egg-info/PKG-INFO 100644 +/usr/lib/python3/site-packages/oauth2-1.5.211-py3.5.egg-info/SOURCES.txt 100644 +/usr/lib/python3/site-packages/oauth2-1.5.211-py3.5.egg-info/dependency_links.txt 100644 +/usr/lib/python3/site-packages/oauth2-1.5.211-py3.5.egg-info/requires.txt 100644 +/usr/lib/python3/site-packages/oauth2-1.5.211-py3.5.egg-info/top_level.txt 100644 +/usr/lib/python3/site-packages/oauth2-1.5.211-py3.5.egg-info/zip-safe 100644 /usr/lib/python3/site-packages/oauth2/__init__.py 100644 /usr/lib/python3/site-packages/oauth2/__pycache__ 40755 -/usr/lib/python3/site-packages/oauth2/__pycache__/_version.cpython-33.pyc 100644 -/usr/lib/python3/site-packages/oauth2/__pycache__/_version.cpython-33.pyo 100644 +/usr/lib/python3/site-packages/oauth2/__pycache__/__init__.cpython-35.opt-1.pyc 100644 +/usr/lib/python3/site-packages/oauth2/__pycache__/__init__.cpython-35.opt-2.pyc 100644 +/usr/lib/python3/site-packages/oauth2/__pycache__/__init__.cpython-35.pyc 100644 +/usr/lib/python3/site-packages/oauth2/__pycache__/_version.cpython-35.opt-1.pyc 100644 +/usr/lib/python3/site-packages/oauth2/__pycache__/_version.cpython-35.opt-2.pyc 100644 +/usr/lib/python3/site-packages/oauth2/__pycache__/_version.cpython-35.pyc 100644 /usr/lib/python3/site-packages/oauth2/_version.py 100644 @@ -16,6 +20,11 @@ /usr/lib/python3/site-packages/oauth2/clients/__pycache__ 40755 -/usr/lib/python3/site-packages/oauth2/clients/__pycache__/imap.cpython-33.pyc 100644 -/usr/lib/python3/site-packages/oauth2/clients/__pycache__/imap.cpython-33.pyo 100644 -/usr/lib/python3/site-packages/oauth2/clients/__pycache__/smtp.cpython-33.pyc 100644 -/usr/lib/python3/site-packages/oauth2/clients/__pycache__/smtp.cpython-33.pyo 100644 +/usr/lib/python3/site-packages/oauth2/clients/__pycache__/__init__.cpython-35.opt-1.pyc 100644 +/usr/lib/python3/site-packages/oauth2/clients/__pycache__/__init__.cpython-35.opt-2.pyc 100644 +/usr/lib/python3/site-packages/oauth2/clients/__pycache__/__init__.cpython-35.pyc 100644 +/usr/lib/python3/site-packages/oauth2/clients/__pycache__/imap.cpython-35.opt-1.pyc 100644 +/usr/lib/python3/site-packages/oauth2/clients/__pycache__/imap.cpython-35.opt-2.pyc 100644 +/usr/lib/python3/site-packages/oauth2/clients/__pycache__/imap.cpython-35.pyc 100644 +/usr/lib/python3/site-packages/oauth2/clients/__pycache__/smtp.cpython-35.opt-1.pyc 100644 +/usr/lib/python3/site-packages/oauth2/clients/__pycache__/smtp.cpython-35.opt-2.pyc 100644 +/usr/lib/python3/site-packages/oauth2/clients/__pycache__/smtp.cpython-35.pyc 100644 /usr/lib/python3/site-packages/oauth2/clients/imap.py 100644 @@ -30,11 +39,10 @@ Requires: /usr/lib/python3/site-packages -Requires: python3.3(base64) -Requires: python3.3(binascii) -Requires: python3.3(hmac) -Requires: python3.3(httplib2) -Requires: python3.3(imaplib) -Requires: python3.3(random) -Requires: python3.3(smtplib) -Requires: python3.3(time) -Requires: python3.3(urllib) +Requires: python3(base64) < 0 +Requires: python3(binascii) < 0 +Requires: python3(hmac) < 0 +Requires: python3(httplib2) < 0 +Requires: python3(imaplib) < 0 +Requires: python3(random) < 0 +Requires: python3(smtplib) < 0 +Requires: python3(urllib) < 0 Requires: rpmlib(PayloadIsLzma)