<86>Apr 14 01:33:10 userdel[80332]: delete user 'rooter' <86>Apr 14 01:33:11 groupadd[80420]: group added to /etc/group: name=rooter, GID=699 <86>Apr 14 01:33:11 groupadd[80420]: group added to /etc/gshadow: name=rooter <86>Apr 14 01:33:11 groupadd[80420]: new group: name=rooter, GID=699 <86>Apr 14 01:33:11 useradd[80457]: new user: name=rooter, UID=699, GID=699, home=/root, shell=/bin/bash <86>Apr 14 01:33:11 userdel[80502]: delete user 'builder' <86>Apr 14 01:33:11 userdel[80502]: removed group 'builder' owned by 'builder' <86>Apr 14 01:33:11 userdel[80502]: removed shadow group 'builder' owned by 'builder' <86>Apr 14 01:33:11 groupadd[80523]: group added to /etc/group: name=builder, GID=700 <86>Apr 14 01:33:11 groupadd[80523]: group added to /etc/gshadow: name=builder <86>Apr 14 01:33:11 groupadd[80523]: new group: name=builder, GID=700 <86>Apr 14 01:33:11 useradd[80536]: new user: name=builder, UID=700, GID=700, home=/usr/src, shell=/bin/bash <13>Apr 14 01:33:14 rpmi: libexpat-2.2.4-alt0.M80P.1 1503871120 installed <13>Apr 14 01:33:14 rpmi: libgdbm-1.8.3-alt10 1454943313 installed <13>Apr 14 01:33:14 rpmi: libtinfo-devel-5.9-alt8 1456756459 installed <13>Apr 14 01:33:14 rpmi: libncurses-devel-5.9-alt8 1456756459 installed <13>Apr 14 01:33:14 rpmi: python-modules-curses-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:14 rpmi: libverto-0.2.6-alt1_6 1455633234 installed <13>Apr 14 01:33:14 rpmi: libkeyutils-1.5.10-alt0.M80P.2 p8+216694.100.6.1 1547827915 installed <13>Apr 14 01:33:14 rpmi: libcom_err-1.42.13-alt2 1449075846 installed <13>Apr 14 01:33:14 rpmi: ca-certificates-2016.02.25-alt1 1462368370 installed <13>Apr 14 01:33:14 rpmi: libcrypto10-1.0.2n-alt0.M80P.1 1512766129 installed <13>Apr 14 01:33:14 rpmi: libssl10-1.0.2n-alt0.M80P.1 1512766129 installed <86>Apr 14 01:33:14 groupadd[86271]: group added to /etc/group: name=_keytab, GID=499 <86>Apr 14 01:33:14 groupadd[86271]: group added to /etc/gshadow: name=_keytab <86>Apr 14 01:33:14 groupadd[86271]: new group: name=_keytab, GID=499 <13>Apr 14 01:33:14 rpmi: libkrb5-1.14.6-alt1.M80P.1 1525355673 installed <13>Apr 14 01:33:15 rpmi: python3-base-3.5.4-alt2.M80P.1 1527753911 installed <13>Apr 14 01:33:15 rpmi: python3-3.5.4-alt2.M80P.1 1527753911 installed <13>Apr 14 01:33:15 rpmi: python-modules-compiler-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:15 rpmi: rpm-build-python3-0.1.10.10-alt1.M80P.1 1530521451 installed <13>Apr 14 01:33:15 rpmi: libpython3-3.5.4-alt2.M80P.1 1527753911 installed <13>Apr 14 01:33:15 rpmi: python3-module-py-1.4.34-alt0.M80P.1 1503506764 installed <13>Apr 14 01:33:16 rpmi: python3-dev-3.5.4-alt2.M80P.1 1527753911 installed <13>Apr 14 01:33:16 rpmi: python-modules-email-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python3-module-pytest-3.2.1-alt0.M80P.1 1503499784 installed <13>Apr 14 01:33:16 rpmi: python3-module-setuptools-1:18.5-alt0.M80P.1 1497527461 installed <13>Apr 14 01:33:16 rpmi: python-modules-unittest-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-modules-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-modules-ctypes-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-modules-encodings-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-modules-multiprocessing-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-modules-logging-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-tools-2to3-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-modules-xml-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-modules-hotshot-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-modules-bsddb-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-dev-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-module-py-1.4.34-alt0.M80P.1 1503506764 installed <13>Apr 14 01:33:16 rpmi: python-modules-json-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:33:16 rpmi: python-module-pytest-3.2.1-alt0.M80P.1 1503499784 installed <13>Apr 14 01:33:16 rpmi: python-module-setuptools-1:18.5-alt0.M80P.1 1497527461 installed Installing python-module-infrae.testbrowser-2.0.2-alt2.1.src.rpm Building target platforms: x86_64 Building for target x86_64 Executing(%prep): /bin/sh -e /usr/src/tmp/rpm-tmp.27412 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + rm -rf python-module-infrae.testbrowser-2.0.2 + echo 'Source #0 (python-module-infrae.testbrowser-2.0.2.tar):' Source #0 (python-module-infrae.testbrowser-2.0.2.tar): + /bin/tar -xf /usr/src/RPM/SOURCES/python-module-infrae.testbrowser-2.0.2.tar + cd python-module-infrae.testbrowser-2.0.2 + /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/src/infrae/testbrowser/wsgi.py RefactoringTool: Refactored ../python3/src/infrae/testbrowser/utils.py --- ../python3/src/infrae/testbrowser/wsgi.py (original) +++ ../python3/src/infrae/testbrowser/wsgi.py (refactored) @@ -2,7 +2,7 @@ # Copyright (c) 2010-2013 Infrae. All rights reserved. # See also LICENSE.txt -import urllib2 +import urllib.request, urllib.error, urllib.parse import io from zope.interface import implements @@ -70,7 +70,7 @@ uri, query = uri.split('?', 1) if '#' in uri: uri, _ = uri.split('#', 1) - environ['PATH_INFO'] = urllib2.unquote(uri) + environ['PATH_INFO'] = urllib.parse.unquote(uri) environ['QUERY_STRING'] = query if data is not None and data_type is not None: environ['wsgi.input'].write(data) --- ../python3/src/infrae/testbrowser/utils.py (original) +++ ../python3/src/infrae/testbrowser/utils.py (refactored) @@ -7,8 +7,9 @@ import mimetypes import operator import os -import urllib -import urlparse +import urllib.request, urllib.parse, urllib.error +import urllib.parse +from functools import reduce _marker = object() @@ -33,40 +34,39 @@ return None return None - return filter(lambda c: c != None, - map(resolve_charset, + return [c for c in map(resolve_charset, reduce(operator.add, - map(lambda c: c.split(), charsets.split(','))))) + [c.split() for c in charsets.split(',')])) if c != None] def charset_encoder(charset, value): """Encoder a value in the given charset. """ - if isinstance(value, unicode): + if isinstance(value, str): return value.encode(charset, 'ignore') return str(value) def resolve_url(url, browser): """Resolve an absolute url given the current browser location. """ - parsed = urlparse.urlparse(urllib.unquote(url)) + parsed = urllib.parse.urlparse(urllib.parse.unquote(url)) if (parsed.scheme in ('', 'http', 'https') and not parsed.path.startswith('/')): # Be sure to always not have any relative links parsed = list(parsed) base = '/'.join(browser.location.split('/')[:-1]) parsed[2] = '/'.join((base, parsed[2])) - return urlparse.urlunparse(parsed) + return urllib.parse.urlunparse(parsed) def resolve_location(url): """Resolve a location out of an url. It does the opposite of resolve_url. """ - parsed = urlparse.urlparse(urllib.unquote(url)) + parsed = urllib.parse.urlparse(urllib.parse.unquote(url)) if parsed.netloc: parsed = list(parsed) parsed[1] = '' parsed[0] = '' - return urlparse.urlunparse(parsed) + return urllib.parse.urlunparse(parsed) def format_auth(user, password): return 'Basic ' + ':'.join((user, password)).encode('base64').strip() @@ -77,20 +77,20 @@ BOUNDARY = '------------uCtemt3iWu00F3QDhiwZ2nIQ$' data = [] if isinstance(fields, dict): - fields = fields.iteritems() + fields = iter(fields.items()) for key, value in fields: data.append('--' + BOUNDARY) - if isinstance(key, unicode): + if isinstance(key, str): key = key.encode(charset) if isinstance(value, File): data.append( 'Content-Disposition: form-data; name="%s"; filename="%s"' % ( - key, unicode(value.filename).encode(charset))) + key, str(value.filename).encode(charset))) data.append('Content-Type: %s' % value.content_type) else: data.append('Content-Disposition: form-data; name="%s"' % key) data.append('') - if isinstance(data, unicode): + if isinstance(data, str): data.append(value.encode(charset)) else: data.append(str(value)) @@ -156,13 +156,13 @@ self._values = values def keys(self): - return map(operator.itemgetter(1), self._values) + return list(map(operator.itemgetter(1), self._values)) def items(self): - return map(operator.itemgeRefactoringTool: No changes to ../python3/src/infrae/testbrowser/tests/test_utils.py RefactoringTool: Refactored ../python3/src/infrae/testbrowser/tests/test_headers.py tter(1, 2), self._values) + return list(map(operator.itemgetter(1, 2), self._values)) def values(self): - return map(operator.itemgetter(2), self._values) + return list(map(operator.itemgetter(2), self._values)) iteritems = items iterkeys = keys @@ -170,16 +170,16 @@ def get(self, key, default=None, multiple=False): key = key.lower() - matches = filter(lambda item: key in item[0], self._values) + matches = [item for item in self._values if key in item[0]] if not matches: return default if len(matches) == 1: if multiple: return [matches[0][2]] return matches[0][2] - exact_matches = map( + exact_matches = list(map( operator.itemgetter(2), - filter(lambda item: key == item[0], matches)) + [item for item in matches if key == item[0]])) if multiple: return exact_matches if len(exact_matches) == 1: @@ -206,16 +206,16 @@ def __eq__(self, other): if isinstance(other, ResultSet): - other = other.keys() - return self.keys() == other + other = list(other.keys()) + return list(self.keys()) == other def __ne__(self, other): if isinstance(other, ResultSet): - other = other.keys() - return self.keys() != other + other = list(other.keys()) + return list(self.keys()) != other def __repr__(self): - return repr(map(operator.itemgetter(1), self._values)) + return repr(list(map(operator.itemgetter(1), self._values))) class Handlers(object): --- ../python3/src/infrae/testbrowser/tests/test_headers.py (original) +++ ../python3/src/infrae/testbrowser/tests/test_headers.py (refactored) @@ -14,17 +14,17 @@ headers = HTTPHeaders() headers['content-type'] = 'text/plain' - self.assertEquals(headers['content-type'], 'text/plain') - self.assertEquals(headers['Content-Type'], 'text/plain') + self.assertEqual(headers['content-type'], 'text/plain') + self.assertEqual(headers['Content-Type'], 'text/plain') headers['Content-Type'] = 'application/octet-stream' - self.assertEquals(headers['content-type'], 'application/octet-stream') - self.assertEquals(headers['Content-Type'], 'application/octet-stream') + self.assertEqual(headers['content-type'], 'application/octet-stream') + self.assertEqual(headers['Content-Type'], 'application/octet-stream') headers.update( - {'Content-Type': 'text/html', 'Content-Length': '42'}.items()) - self.assertEquals(headers['content-type'], 'text/html') - self.assertEquals(headers['content-length'], '42') + list({'Content-Type': 'text/html', 'Content-Length': '42'}.items())) + self.assertEqual(headers['content-type'], 'text/html') + self.assertEqual(headers['content-length'], '42') def test_non_existing_get(self): """Looking a non existing key raises KeyError. @@ -41,15 +41,15 @@ headers = HTTPHeaders() headers['Content-Length'] = '42' - self.assertEquals(headers.has_key('Content-Length'), True) - self.assertEquals(headers.has_key('content-length'), True) - self.failUnless('Content-Length' in headers) - self.failUnless('content-length' in headers) + self.assertEqual('Content-Length' in headers, True) + self.assertEqual('content-length' in headers, True) + self.assertTrue('Content-Length' in headers) + self.assertTrue('content-length' in headers) - self.assertEquals(headers.has_key('Server'), False) - self.assertEquals(headers.has_key('server'), False) - self.failIf('Server' in headers) - self.failIf('server' in headers) + self.assertEqual('Server' in headers, False) + self.assertEqual('server' in headers, False) + self.assertFalse('Server' in headers) + self.assertFalse('server' in headers)RefactoringTool: No changes to ../python3/src/infrae/testbrowser/tests/test_form.py RefactoringTool: Refactored ../python3/src/infrae/testbrowser/tests/test_expressions.py WARNING: couldn't encode ../python3/src/infrae/testbrowser/tests/test_expressions.py's diff for your terminal RefactoringTool: Refactored ../python3/src/infrae/testbrowser/tests/test_browsing.py WARNING: couldn't encode ../python3/src/infrae/testbrowser/tests/test_browsing.py's diff for your terminal RefactoringTool: Refactored ../python3/src/infrae/testbrowser/tests/form.py RefactoringTool: Refactored ../python3/src/infrae/testbrowser/tests/expressions.py WARNING: couldn't encode ../python3/src/infrae/testbrowser/tests/expressions.py's diff for your terminal RefactoringTool: Refactored ../python3/src/infrae/testbrowser/tests/browser.py def test_items(self): """items return a list of tuples containing all headers. Header @@ -59,10 +59,10 @@ headers['content-type'] = 'text/plain' headers['Content-length'] = 42 - self.assertEquals( - headers.items(), + self.assertEqual( + list(headers.items()), [('Content-Length', '42'), ('Content-Type', 'text/plain')]) - self.assertEquals( - list(headers.iteritems()), + self.assertEqual( + list(headers.items()), [('Content-Length', '42'), ('Content-Type', 'text/plain')]) --- ../python3/src/infrae/testbrowser/tests/test_expressions.py (original) +++ ../python3/src/infrae/testbrowser/tests/test_expressions.py (refactored) @@ -29,7 +29,7 @@ browser.inspect.add('values', '//p') # we get a latin1 interpretation of utf-8 self.assertEqual(browser.inspect.values, --- ../python3/src/infrae/testbrowser/tests/test_browsing.py (original) +++ ../python3/src/infrae/testbrowser/tests/test_browsing.py (refactored) @@ -157,7 +157,7 @@ 'application/json') self.assertEqual(browser.html, None) self.assertEqual(browser.xml, None) - self.assertEqual(browser.json, [True, False, 1, u'a']) + self.assertEqual(browser.json, [True, False, 1, 'a']) def test_history(self): with Browser(app.test_app_iter) as browser: @@ -308,7 +308,7 @@ self.assertNotEqual(browser.html, None) self.assertEqual( browser.html.xpath('//li/text()'), --- ../python3/src/infrae/testbrowser/tests/form.py (original) +++ ../python3/src/infrae/testbrowser/tests/form.py (refactored) @@ -82,7 +82,7 @@ # Can only set string values self.assertRaises( AssertionError, setattr, password_field, 'value', ['something']) - password_field.value = u'secret' + password_field.value = 'secret' submit_field = form.get_control('save') self.assertNotEqual(submit_field, None) --- ../python3/src/infrae/testbrowser/tests/expressions.py (original) +++ ../python3/src/infrae/testbrowser/tests/expressions.py (refactored) @@ -74,27 +74,27 @@ ['Home', 'Contact', 'Contact Abroad', 'python']) self.assertEqual( browser.inspect.breadcrumbs, - [u'Home ...', - u'Development ...', - u'Advanced Lisp ...', --- ../python3/src/infrae/testbrowser/tests/browser.py (original) +++ ../python3/src/infrae/testbrowser/tests/browser.py (refactored) @@ -20,7 +20,7 @@ with self.Browser(app.test_app_cookies_server) as browser: self.assertTrue(verifyObject(ICookies, browser.cookies)) self.assertEqual(len(browser.cookies), 0) - self.assertEqual(browser.cookies.keys(), []) + self.assertEqual(list(browser.cookies.keys()), []) self.assertNotIn('browser', browser.cookies) self.assertEqual(repr(browser.cookies), '') browser.open('/page.html') @@ -49,11 +49,11 @@ """ with self.Browser(app.test_app_cookies_client) as browser: self.assertEqual(len(browser.cookies), 0) - self.assertEqual(browser.cookies.keys(), []) + self.assertEqual(list(browser.cookies.keys()), []) self.assertNotIn('food', browser.cookies) browser.open('/page.html') self.assertEqual(len(browser.cookies), 0) - self.assertEqual(browser.cookies.keys(), []) + self.assertEqual(list(browser.cookies.keys()), []) self.assertNotIn('food', browser.cookies) # No cookies are visible self.assertNotEqual(browser.html, None) @@ -84,7 +84,7 @@ # You can clear all cookies browser.cookies.clear() self.assertEqual(len(browser.cookies), 0) - self.assertEqual(browser.cookies.keys(), []) + self.asserRefactoringTool: Refactored ../python3/src/infrae/testbrowser/tests/app.py RefactoringTool: Refactored ../python3/src/infrae/testbrowser/selenium/utils.py tEqual(list(browser.cookies.keys()), []) self.assertNotIn('food', browser.cookies) self.assertNotIn('drink', browser.cookies) browser.reload() @@ -110,6 +110,6 @@ browser.login('admin', 'admin') browser.logout() - self.assertEquals( + self.assertEqual( called, [('login', 'admin', 'admin'), ('logout',), ('close',)]) --- ../python3/src/infrae/testbrowser/tests/app.py (original) +++ ../python3/src/infrae/testbrowser/tests/app.py (refactored) @@ -3,10 +3,10 @@ # See also LICENSE.txt import os -import urlparse +import urllib.parse def encode(value): - if isinstance(value, unicode): + if isinstance(value, str): return value.encode('utf-8') return str(value) @@ -35,9 +35,7 @@ def test_app_headers(environ, start_response): start_response('200 Ok', [('Content-type', 'text/html'),]) - headers = map(lambda k: '
  • %s:%s
  • ' % (k, environ[k]), - filter(lambda k: k.startswith('HTTP_'), - environ.keys())) + headers = ['
  • %s:%s
  • ' % (k, environ[k]) for k in [k for k in list(environ.keys()) if k.startswith('HTTP_')]] return [''] @@ -81,12 +79,12 @@ def test_app_cookies_server(environ, start_response): headers = [('Content-type', 'text/html')] - if 'HTTP_COOKIE' not in environ.keys(): + if 'HTTP_COOKIE' not in list(environ.keys()): # No cookies, set cookies ! headers.append(('Set-Cookie', 'browser=testing;Path=/')) start_response('200 Ok', headers) yield '