86>Jan 19 11:48:00 userdel[21447]: delete user 'rooter' <86>Jan 19 11:48:00 userdel[21447]: removed group 'rooter' owned by 'rooter' <86>Jan 19 11:48:00 userdel[21447]: removed shadow group 'rooter' owned by 'rooter' <86>Jan 19 11:48:00 groupadd[21458]: group added to /etc/group: name=rooter, GID=585 <86>Jan 19 11:48:00 groupadd[21458]: group added to /etc/gshadow: name=rooter <86>Jan 19 11:48:00 groupadd[21458]: new group: name=rooter, GID=585 <86>Jan 19 11:48:00 useradd[21466]: new user: name=rooter, UID=585, GID=585, home=/root, shell=/bin/bash <86>Jan 19 11:48:00 userdel[21492]: delete user 'builder' <86>Jan 19 11:48:00 userdel[21492]: removed group 'builder' owned by 'builder' <86>Jan 19 11:48:00 userdel[21492]: removed shadow group 'builder' owned by 'builder' <86>Jan 19 11:48:00 groupadd[21510]: group added to /etc/group: name=builder, GID=586 <86>Jan 19 11:48:00 groupadd[21510]: group added to /etc/gshadow: name=builder <86>Jan 19 11:48:00 groupadd[21510]: new group: name=builder, GID=586 <86>Jan 19 11:48:00 useradd[21522]: new user: name=builder, UID=586, GID=586, home=/usr/src, shell=/bin/bash <13>Jan 19 11:48:04 rpmi: libgdbm-1.8.3-alt10 1454943334 installed <13>Jan 19 11:48:04 rpmi: libexpat-2.2.4-alt1 1503305345 installed <13>Jan 19 11:48:04 rpmi: libp11-kit-0.23.15-alt1 sisyphus+226408.100.2.1 1554288204 installed <13>Jan 19 11:48:04 rpmi: libtasn1-4.14-alt1 p9+235792.100.2.1 1565425233 installed <13>Jan 19 11:48:04 rpmi: rpm-macros-alternatives-0.5.1-alt1 sisyphus+226946.100.1.1 1554830426 installed <13>Jan 19 11:48:04 rpmi: alternatives-0.5.1-alt1 sisyphus+226946.100.1.1 1554830426 installed <13>Jan 19 11:48:04 rpmi: ca-certificates-2019.10.28-alt1 p9+240634.100.1.1 1573575926 installed <13>Jan 19 11:48:04 rpmi: ca-trust-0.1.2-alt1 p9+233349.100.1.1 1561655062 installed <13>Jan 19 11:48:04 rpmi: p11-kit-trust-0.23.15-alt1 sisyphus+226408.100.2.1 1554288204 installed <13>Jan 19 11:48:04 rpmi: libcrypto1.1-1.1.1d-alt1.1 p9+237853.200.3.1 1569251834 installed <13>Jan 19 11:48:04 rpmi: libssl1.1-1.1.1d-alt1.1 p9+237853.200.3.1 1569251834 installed <13>Jan 19 11:48:04 rpmi: python3-3.7.4-alt2 p9+239459.100.1.1 1571444790 installed <13>Jan 19 11:48:04 rpmi: libpython3-3.7.4-alt2 p9+239459.100.1.1 1571444790 installed <13>Jan 19 11:48:06 rpmi: python3-base-3.7.4-alt2 p9+239459.100.1.1 1571444790 installed <13>Jan 19 11:48:06 rpmi: tests-for-installed-python3-pkgs-0.1.13.1-alt2 1535450458 installed <13>Jan 19 11:48:06 rpmi: rpm-build-python3-0.1.13.1-alt2 1535450458 installed <13>Jan 19 11:48:06 rpmi: rpm-macros-sphinx-1:1.6.5-alt4 sisyphus+228232.100.1.1 1556298645 installed <13>Jan 19 11:48:12 rpmi: python-module-repoze-2.2-alt4.git20140327 sisyphus+228552.100.1.2 1556748368 installed <13>Jan 19 11:48:12 rpmi: python-module-sphinxcontrib-2.1.1-alt2.1.2 sisyphus+227529.1100.1.2 1555924423 installed <13>Jan 19 11:48:12 rpmi: libsqlite3-3.29.0-alt1 p9+237498.100.1.1 1568303696 installed <13>Jan 19 11:48:12 rpmi: python3-module-pkg_resources-1:40.8.0-alt2 sisyphus+229158.200.2.1 1557735221 installed <13>Jan 19 11:48:12 rpmi: python-module-iniconfig-1.0.0-alt1 sisyphus+227494.1100.1.3 1555839106 installed <13>Jan 19 11:48:12 rpmi: python-module-apipkg-1.5-alt1 1531926894 installed <13>Jan 19 11:48:12 rpmi: python-module-imagesize-1.1.0-alt1 sisyphus+229015.100.2.1 1557233756 installed <13>Jan 19 11:48:12 rpmi: python-sphinx-objects.inv-1:2.3.8.20190514-alt1 p9+229421.100.1.1 1557927689 installed <13>Jan 19 11:48:12 rpmi: python-module-google-0.4.2-alt2.1 sisyphus+228356.1500.3.1 1556633057 installed <13>Jan 19 11:48:12 rpmi: python-module-enum34-1.1.6-alt3 1527251693 installed <13>Jan 19 11:48:12 rpmi: libxapian-1.4.5-alt3 sisyphus+222778.100.1.1 1551144773 installed <13>Jan 19 11:48:12 rpmi: libgpg-error-1.36-alt1 sisyphus+225621.300.1.1 1553521082 installed <13>Jan 19 11:48:12 rpmi: libgcrypt20-1.8.4-alt2 sisyphus+229280.100.1.1 1557742126 installed <13>Jan 19 11:48:12 rpmi: libxslt-1.1.33-alt1 sisyphus+226936.100.1.1 1554820937 installed <13>Jan 19 11:48:12 rpmi: python-modules-curses-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:12 rpmi: libtinfo-devel-6.1.20180407-alt2 sisyphus+222164.200.1.1 1550686226 installed <13>Jan 19 11:48:12 rpmi: libncurses-devel-6.1.20180407-alt2 sisyphus+222164.200.1.1 1550686226 installed <13>Jan 19 11:48:12 rpmi: python3-dev-3.7.4-alt2 p9+239459.100.1.1 1571444790 installed <13>Jan 19 11:48:12 rpmi: libverto-0.3.0-alt1_7 sisyphus+225932.100.1.1 1553994919 installed <13>Jan 19 11:48:12 rpmi: libkeyutils-1.6-alt2 sisyphus+226520.100.2.1 1554512089 installed <13>Jan 19 11:48:12 rpmi: libcom_err-1.44.6-alt1 sisyphus+224154.100.1.1 1552091678 installed <86>Jan 19 11:48:12 groupadd[2743]: group added to /etc/group: name=_keytab, GID=499 <86>Jan 19 11:48:12 groupadd[2743]: group added to /etc/gshadow: name=_keytab <86>Jan 19 11:48:12 groupadd[2743]: new group: name=_keytab, GID=499 <13>Jan 19 11:48:12 rpmi: libkrb5-1.17.1-alt1 p9+242852.100.2.1 1576572639 installed <13>Jan 19 11:48:12 rpmi: libtirpc-1.0.3-alt1 1532008017 installed <13>Jan 19 11:48:12 rpmi: libnsl2-1.1.0-alt1_1 1511548749 installed <13>Jan 19 11:48:12 rpmi: python-modules-compiler-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:12 rpmi: python-modules-email-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:12 rpmi: python-modules-unittest-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:12 rpmi: python-modules-encodings-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-modules-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-modules-nis-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-module-six-1.12.0-alt1 sisyphus+219665.100.2.1 1548148570 installed <13>Jan 19 11:48:13 rpmi: python-module-pkg_resources-1:40.8.0-alt2 sisyphus+229158.200.2.1 1557735221 installed <13>Jan 19 11:48:13 rpmi: python-modules-ctypes-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-modules-json-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-modules-xml-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-modules-multiprocessing-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-modules-logging-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-modules-hotshot-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-module-chardet-3.0.4-alt1 sisyphus+227476.1700.1.2 1555756717 installed <13>Jan 19 11:48:13 rpmi: python-tools-2to3-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-module-whoosh-2.7.4-alt1 1527697941 installed <13>Jan 19 11:48:13 rpmi: python-module-webencodings-0.5.1-alt1.1 1517943573 installed <13>Jan 19 11:48:13 rpmi: python-module-webob-1.8.5-alt1 sisyphus.219072.100 1547030251 installed <13>Jan 19 11:48:13 rpmi: python-module-more-itertools-1:5.0.0-alt2 sisyphus+226536.200.1.1 1554329977 installed <13>Jan 19 11:48:13 rpmi: python-modules-bsddb-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-strict-2.7.16-alt1 sisyphus+226365.200.2.1 1554143277 installed <13>Jan 19 11:48:13 rpmi: python-modules-distutils-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:13 rpmi: python-module-pycparser-2.19-alt1 sisyphus+228366.1000.2.3 1556706938 installed <13>Jan 19 11:48:13 rpmi: python-module-cffi-1.12.3-alt1 sisyphus+229040.200.3.1 1557316452 installed <13>Jan 19 11:48:13 rpmi: python-module-asn1crypto-0.24.0-alt1 sisyphus+227473.1300.1.2 1555756512 installed <13>Jan 19 11:48:13 rpmi: python-module-PyStemmer-1.0.1-alt1.2.1 1321388303 installed <13>Jan 19 11:48:13 rpmi: python-module-snowballstemmer-1.2.0-alt2.1 1457859319 installed <13>Jan 19 11:48:13 rpmi: python-module-cssselect-0.9.1-alt1.2 sisyphus+227479.1100.1.2 1555757152 installed <13>Jan 19 11:48:13 rpmi: python-module-html5lib-1:0.999999999-alt4.qa1 sisyphus+227493.600.1.3 1555835341 installed <13>Jan 19 11:48:13 rpmi: python-module-lxml-4.3.3-alt1.1 sisyphus+225625.33200.91.1 1555314727 installed <13>Jan 19 11:48:14 rpmi: python-module-docutils-0.14-alt2 1535729778 installed <13>Jan 19 11:48:14 rpmi: python-module-idna-2.8-alt1 sisyphus+227494.400.1.3 1555838720 installed <13>Jan 19 11:48:14 rpmi: python-module-ntlm-1.1.0-alt1.2 sisyphus+228512.100.1.1 1556654575 installed <13>Jan 19 11:48:14 rpmi: python-module-pytz-1:2016.10-alt1 1484291011 installed <13>Jan 19 11:48:15 rpmi: python-module-babel-1:2.6.0-alt1 sisyphus+228351.2400.6.2 1556652168 installed <13>Jan 19 11:48:15 rpmi: python-module-attrs-19.1.0-alt1 sisyphus+227473.2100.1.2 1555756986 installed <13>Jan 19 11:48:15 rpmi: python-module-ipaddress-1.0.18-alt1.1 sisyphus+227494.1700.1.3 1555839523 installed <13>Jan 19 11:48:15 rpmi: python-module-cryptography-2.6.1-alt1 sisyphus+225625.24400.91.1 1555298600 installed <13>Jan 19 11:48:15 rpmi: python-module-OpenSSL-18.0.0-alt1 1532996168 installed <13>Jan 19 11:48:15 rpmi: python-module-simplejson-3.15.0-alt1.qa1 sisyphus+225625.16100.91.1 1555292381 installed <13>Jan 19 11:48:15 rpmi: python-module-ndg-0.4.2-alt1.qa1 sisyphus+227504.1300.1.2 1555853234 installed <13>Jan 19 11:48:15 rpmi: python-module-ndg-httpsclient-0.4.2-alt1.qa1 sisyphus+227504.1300.1.2 1555853234 installed <13>Jan 19 11:48:15 rpmi: python-module-backports-3.5.0.1-alt1.1.1 1517645428 installed <13>Jan 19 11:48:15 rpmi: python-module-backports.ssl_match_hostname-3.5.0.1-alt1.1.1 1517645428 installed <13>Jan 19 11:48:15 rpmi: python-module-urllib3-2:1.24.3-alt1 sisyphus+228978.100.1.1 1557126149 installed <13>Jan 19 11:48:15 rpmi: python-module-requests-2.21.0-alt1 sisyphus+228370.100.2.2 1556711628 installed <13>Jan 19 11:48:15 rpmi: python-module-typing-3.6.6-alt2 sisyphus+220108.100.1.1 1548749697 installed <13>Jan 19 11:48:15 rpmi: python-module-markupsafe-0.23-alt1.2.1.1 sisyphus+225625.12200.91.1 1555289337 installed <13>Jan 19 11:48:15 rpmi: python-module-jinja2-2.10-alt1 1521724576 installed <13>Jan 19 11:48:15 rpmi: python-modules-sqlite3-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:15 rpmi: python-module-SQLAlchemy-1.2.15-alt1 sisyphus+225625.4500.91.1 1555284142 installed <13>Jan 19 11:48:15 rpmi: python-module-py-1.8.0-alt2 sisyphus+228349.1400.4.1 1556631070 installed <13>Jan 19 11:48:15 rpmi: python-module-funcsigs-1.0.2-alt2 sisyphus+228355.2600.2.1 1556560236 installed <13>Jan 19 11:48:15 rpmi: python-module-scandir-1.10.0-alt1 sisyphus+225192.100.1.2 1552968870 installed <13>Jan 19 11:48:15 rpmi: python-module-pathlib2-2.3.3-alt1 sisyphus+228364.300.4.1 1556886257 installed <13>Jan 19 11:48:15 rpmi: python-module-atomicwrites-1.3.0-alt1 sisyphus+227473.2000.1.3 1555763467 installed <13>Jan 19 11:48:15 rpmi: python-module-repoze.lru-0.6-alt2.git20140202.2 sisyphus+228533.100.1.1 1556656200 installed <13>Jan 19 11:48:15 rpmi: python-module-xapian-1.4.5-alt3 sisyphus+225625.23000.91.1 1555296582 installed <13>Jan 19 11:48:15 rpmi: python-module-pluggy-0.11.0-alt1 sisyphus+229116.100.1.1 1557316655 installed <13>Jan 19 11:48:15 rpmi: python-module-pytest-3.10.1-alt5 sisyphus+228366.2000.2.3 1556707871 installed <13>Jan 19 11:48:15 rpmi: python-module-sphinxcontrib-websupport-1.0.1-alt3.qa1 sisyphus+227529.1200.1.2 1555924506 installed <13>Jan 19 11:48:15 rpmi: python-module-alabaster-0.7.6-alt3 sisyphus+228351.700.4.1 1556637370 installed <13>Jan 19 11:48:15 rpmi: python-module-Pygments-2.2.0-alt2 1526455576 installed <13>Jan 19 11:48:16 rpmi: python-module-sphinx-1:1.6.5-alt4 sisyphus+228232.100.1.1 1556298645 installed <13>Jan 19 11:48:16 rpmi: libnsl2-devel-1.1.0-alt1_1 1511548749 installed <13>Jan 19 11:48:16 rpmi: python-dev-2.7.16-alt1 sisyphus+226365.200.2.1 1554143304 installed <13>Jan 19 11:48:16 rpmi: python-module-setuptools-1:40.8.0-alt2 sisyphus+229158.200.2.1 1557735221 installed <13>Jan 19 11:48:16 rpmi: python-module-routes-2.4.1-alt1 sisyphus+227525.1400.1.2 1555924482 installed <13>Jan 19 11:48:16 rpmi: python-module-nose-1:1.3.7-alt4.git20160316 sisyphus+229068.100.1.1 1557255939 installed <13>Jan 19 11:48:16 rpmi: python-module-pysqlite2-2.8.3-alt1 1526055403 installed <13>Jan 19 11:48:16 rpmi: python3-module-setuptools-1:40.8.0-alt2 sisyphus+229158.200.2.1 1557735221 installed Building target platforms: i586 Building for target i586 Wrote: /usr/src/in/nosrpm/python-module-webhelpers-1.3-alt2.1.1.1.nosrc.rpm Installing python-module-webhelpers-1.3-alt2.1.1.1.src.rpm Building target platforms: i586 Building for target i586 Executing(%prep): /bin/sh -e /usr/src/tmp/rpm-tmp.35405 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + rm -rf python-module-webhelpers-1.3 + echo 'Source #0 (WebHelpers-1.3.tar.gz):' Source #0 (WebHelpers-1.3.tar.gz): + /bin/gzip -dc /usr/src/RPM/SOURCES/WebHelpers-1.3.tar.gz + /bin/tar -xf - + cd python-module-webhelpers-1.3 + /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/unfinished/multimedia.py RefactoringTool: Refactored ../python3/unfinished/logging_optparse.py RefactoringTool: No changes to ../python3/unfinished/document.py RefactoringTool: Refactored ../python3/unfinished/disabled_test_pylonslib_minify.py --- ../python3/unfinished/multimedia.py (original) +++ ../python3/unfinished/multimedia.py (refactored) @@ -87,7 +87,7 @@ """ try: im = Image.open(image_path) - except IOError, e: + except IOError as e: if str(e) == "cannot identify image file": return None else: @@ -118,7 +118,7 @@ im = im.convert() # Convert GIF palette to RGB mode. try: im.thumbnail((width, height), Image.ANTIALIAS) - except IOError, e: + except IOError as e: reason = str(e) if RX_DECODER_NOT_AVAILABLE.search(reason): return None # PIL error, cannot thumbnail. @@ -184,9 +184,9 @@ return os.path.join(dir, new_name) def test(): - print "Height for 600x480 @ width 200 is", choose_height(200, 600, 480) - print "Path 200 for a/foo.jpg is", get_thumb_path('a/foo.jpg', 200) - print "Path 200 for a/foo.png is", get_thumb_path('a/foo.png', 200) + print("Height for 600x480 @ width 200 is", choose_height(200, 600, 480)) + print("Path 200 for a/foo.jpg is", get_thumb_path('a/foo.jpg', 200)) + print("Path 200 for a/foo.png is", get_thumb_path('a/foo.png', 200)) if __name__ == "__main__": test() @@ -328,7 +328,7 @@ width = 200 dst = make_pdf_thumbnail2(source_file, width) - print "Thumbnail made:", dst + print("Thumbnail made:", dst) #ps_cmd = "save pop currentglobal true setglobal false/product where{pop product(Ghostscript)search{pop pop pop revision 600 ge{pop true}if}{pop}ifelse}if{/pdfdict where{pop pdfdict begin/pdfshowpage_setpage[pdfdict/pdfshowpage_setpage get{dup type/nametype eq{dup/OutputFile eq{pop/AntiRotationHack}{dup/MediaBox eq revision 650 ge and{/THB.CropHack{1 index/CropBox pget{2 index exch/MediaBox exch put}if}def/THB.CropHack cvx}if}ifelse}if}forall]cvx def end}if}if setglobal" --- ../python3/unfinished/logging_optparse.py (original) +++ ../python3/unfinished/logging_optparse.py (refactored) @@ -215,5 +215,5 @@ if logger == "__main__": # Set root logger to same level. logging.getLogger().setLevel(level) - except LogLevelError, e: + except LogLevelError as e: parser.error("log level '%s' not defined" % e.level) --- ../python3/unfinished/disabled_test_pylonslib_minify.py (original) +++ ../python3/unfinished/disabled_test_pylonslib_minify.py (refactored) @@ -79,42 +79,42 @@ # minify and combine js_source = self.minify.javascript_link('/deep/a.js', '/b.js', combined=True, minified=True) css_source = self.minify.stylesheet_link('/deep/a.css', '/b.css', combined=True, minified=True) - self.assert_('"/a.b.COMBINED.min.css"' in css_source) - self.assert_('"/a.b.COMBINED.min.js"' in js_source) + self.assertTrue('"/a.b.COMBINED.min.css"' in css_source) + self.assertTrue('"/a.b.COMBINED.min.js"' in js_source) # combine js_source = self.minify.javascript_link('/deep/a.js', '/b.js', combined=True) css_source = self.minify.stylesheet_link('/deep/a.css', '/b.css', combined=True) - self.assert_('"/a.b.COMBINED.css"' in css_source) - self.assert_('"/a.b.COMBINED.js"' in js_source) + self.assertTrue('"/a.b.COMBINED.css"' in css_source) + self.assertTrue('"/a.b.COMBINED.js"' in js_source) # minify js_source = self.minify.javascript_link('/deep/a.js', '/b.js', minified=True) css_source = self.minify.stylesheet_link('/deep/a.css', '/b.css', minified=True) - self.assert_('"/deep/a.min.css"' in css_source) - self.assert_('"/b.min.css"' in css_source) - self.assert_('"/deep/a.min.js"' in js_source) - self.assert_('"/b.min.js"' in js_source) + self.assertTrue('"/deep/a.min.css"' in css_source) + self.assertTrue('"/b.min.css"' in css_source) + self.assertTrue('"/deep/a.min.js"' in js_source) + self.assertTrue('"/b.min.js"' in js_source) # root minify and combined js_source = self.minify.RefactoringTool: Refactored ../python3/unfinished/containers.py RefactoringTool: Refactored ../python3/unfinished/baseN.py RefactoringTool: No changes to ../python3/unfinished/sanitize_filename.py RefactoringTool: No changes to ../python3/unfinished/opener.py RefactoringTool: No changes to ../python3/unfinished/number_to_human_size.py RefactoringTool: No changes to ../python3/tests/util.py RefactoringTool: Refactored ../python3/tests/test_tools.py javascript_link('/c.js', '/b.js', combined=True, minified=True) css_source = self.minify.stylesheet_link('/c.css', '/b.css', combined=True, minified=True) - self.assert_('"/c.b.COMBINED.min.css"' in css_source) - self.assert_('"/c.b.COMBINED.min.js"' in js_source) + self.assertTrue('"/c.b.COMBINED.min.css"' in css_source) + self.assertTrue('"/c.b.COMBINED.min.js"' in js_source) # root minify js_source = self.minify.javascript_link('/c.js', '/b.js', minified=True) css_source = self.minify.stylesheet_link('/c.css', '/b.css', minified=True) - self.assert_('"/b.min.css"' in css_source) - self.assert_('"/b.min.js"' in js_source) - self.assert_('"/c.min.js"' in js_source) - self.assert_('"/c.min.js"' in js_source) + self.assertTrue('"/b.min.css"' in css_source) + self.assertTrue('"/b.min.js"' in js_source) + self.assertTrue('"/c.min.js"' in js_source) + self.assertTrue('"/c.min.js"' in js_source) # both root minify and combined js_source = self.minify.javascript_link('/deep/a.js', '/deep/d.js', combined=True, minified=True) css_source = self.minify.stylesheet_link('/deep/a.css', '/deep/d.css', combined=True, minified=True) - self.assert_('"/deep/a.d.COMBINED.min.css"' in css_source) - self.assert_('"/deep/a.d.COMBINED.min.js"' in js_source) + self.assertTrue('"/deep/a.d.COMBINED.min.css"' in css_source) + self.assertTrue('"/deep/a.d.COMBINED.min.js"' in js_source) # Cleanup -- done by .tearDown() #self.purge_files('a.b.COMBINED.min.js', 'a.b.COMBINED.min.css') --- ../python3/unfinished/containers.py (original) +++ ../python3/unfinished/containers.py (refactored) @@ -16,7 +16,7 @@ if n > 0: extension = [fill] * n lis.extend(extension) - return zip(*data) + return list(zip(*data)) def izip_fill(*iterables, **kw): """Like itertools.izip but use a default value for the missing elements @@ -26,18 +26,18 @@ ``default`` is the default value (default ``None``, must be a keyword arg. """ - iterables = map(iter, iterables) + iterables = list(map(iter, iterables)) default = kw.pop('default', None) if kw: raise TypeError("unrecognized keyword arguments") columns = len(iterables) - columns_range = range(columns) + columns_range = list(range(columns)) while True: found_data = False row = [None] * columns for i in columns_range: try: - row[i] = iterables[i].next() + row[i] = next(iterables[i]) found_data = True except StopIteration: row[i] = default --- ../python3/unfinished/baseN.py (original) +++ ../python3/unfinished/baseN.py (refactored) @@ -59,7 +59,7 @@ s = list(s) alphabet = list(alphabet) base = len(alphabet) - inverse_alphabet = dict(zip(alphabet, xrange(0, base))) + inverse_alphabet = dict(list(zip(alphabet, list(range(0, base))))) n = 0 exp = 0 for i in reversed(s): --- ../python3/tests/test_tools.py (original) +++ ../python3/tests/test_tools.py (refactored) @@ -74,50 +74,50 @@ } result_values = {} - for k, v in result_values_templates.iteritems(): + for k, v in result_values_templates.items(): result_values[k] = Template(v).substitute(raw_values) self.assertEqual(result_values["email_result"], auto_link(raw_values['email_raw'], 'email_addresses')) - self.assertEqual(u"hello %(email_result)s" % result_values, auto_link("hello %(email_raw)s" % raw_values, 'email_addresses')) - self.assertEqual(u"Go to %(link_result)s" % result_values, auto_link("Go to %(link_raw)s" % raw_values, 'urls')) - self.assertEqual(u"Go to %(link_raw)s" % raw_values, auto_link("Go to %(link_raw)s" % raw_values, 'email_addresses')) - self.assertEqual(u"Go to %(link_result)s and say hello to %(email_result)s" % result_values, auto_link("Go to %(link_raw)s and say hello to %(email_raw)s" % raw_values)) - self.assertEqual(u"
Link %(link_result)s
" % result_values, auto_link(literal("Link %(link_raw)s
") % raw_values)) - self.assertEqual(u"%(link_result)s Link
" % result_values, auto_link(literal("%(link_raw)s Link
") % raw_values)) - self.assertEqual(u"Link %(link_result_with_options)s
" % result_values, auto_link(literal("Link %(link_raw)s
") % raw_values, 'all', target='_blank')) - self.assertEqual(u"Go to %(link_result)s." % result_values, auto_link("Go to %(link_raw)s." % raw_values)) - self.assertEqual(u"Go to %(link_result)s, then say hello to %(email_result)s.
" % result_values, auto_link(literal("Go to %(link_raw)s, then say hello to %(email_raw)s.
") % raw_values)) - self.assertEqual(u"Go to %(link2_result)s" % result_values, auto_link("Go to %(link2_raw)s" % raw_values, 'urls')) - self.assertEqual(u"Go to %(link2_raw)s" % raw_values, auto_link("Go to %(link2_raw)s" % raw_values, 'email_addresses')) - self.assertEqual(u"Link %(link2_result)s
" % result_values, auto_link(literal("Link %(link2_raw)s
") % raw_values)) - self.assertEqual(u"%(link2_result)s Link
" % result_values, auto_link(literal("%(link2_raw)s Link
") % raw_values)) - self.assertEqual(u"Go to %(link2_result)s." % result_values, auto_link(literal("Go to %(link2_raw)s.") % raw_values)) - self.assertEqual(u"Say hello to %(email_result)s, then go to %(link2_result)s.
" % result_values, auto_link(literal("Say hello to %(email_raw)s, then go to %(link2_raw)s.
") % raw_values)) - self.assertEqual(u"Go to %(link3_result)s" % result_values, auto_link("Go to %(link3_raw)s" % raw_values, 'urls')) - self.assertEqual(u"Go to %(link3_raw)s" % raw_values, auto_link("Go to %(link3_raw)s" % raw_values, 'email_addresses')) - self.assertEqual(u"Link %(link3_result)s
" % result_values, auto_link(literal("Link %(link3_raw)s
") % raw_values)) - self.assertEqual(u"%(link3_result)s Link
" % result_values, auto_link(literal("%(link3_raw)s Link
") % raw_values)) - self.assertEqual(u"Go to %(link3_result)s." % result_values, auto_link("Go to %(link3_raw)s." % raw_values)) - self.assertEqual(u"Go to %(link3_result)s. seriously, %(link3_result)s? i think I'll say hello to %(email_result)s. instead.
" % result_values, auto_link(literal("Go to %(link3_raw)s. seriously, %(link3_raw)s? i think I'll say hello to %(email_raw)s. instead.
") % raw_values)) - self.assertEqual(u"Link %(link4_result)s
" % result_values, auto_link(literal("Link %(link4_raw)s
") % raw_values)) - self.assertEqual(u"%(link4_result)s Link
" % result_values, auto_link(literal("%(link4_raw)s Link
") % raw_values)) - self.assertEqual(u"%(link5_result)s Link
" % result_values, auto_link(literal("%(link5_raw)s Link
") % raw_values)) - self.assertEqual(u"%(link6_result)s Link
" % result_values, auto_link(literal("%(link6_raw)s Link
") % raw_values)) - self.assertEqual(u"%(link7_result)s Link
" % result_values, auto_link(literal("%(link7_raw)s Link
") % raw_values)) - self.assertEqual(u"Go to %(link8_result)s" % result_values, auto_link("Go to %(link8_raw)s" % raw_values, 'urls')) - self.assertEqual(u"Go to %(link8_raw)s" % raw_values, auto_link("Go to %(link8_raw)s" % raw_values, 'email_addresses')) - self.assertEqual(u"Link %(link8_result)s
" % result_values, auto_link(literal("Link %(link8_raw)s
") % raw_values)) - self.assertEqual(u"%(link8_result)s Link
" % result_values, auto_link(literal("%(link8_raw)s Link
") % raw_values)) - self.assertEqual(u"Go to %(link8_result)s." % result_values, auto_link("Go to %(link8_raw)s." % raw_values)) - self.assertEqual(u"Go to %(link8_result)s. seriously, %(link8_result)s? i think I'll say hello to %(email_result)s. instead.
" % result_values, auto_link(literal("Go to %(link8_raw)s. seriously, %(link8_raw)s? i think I'll say hello to %(email_raw)s. instead.
") % raw_values)) - self.assertEqual(u"Go to %(link9_result)s" % result_values, auto_link("Go to %(link9_raw)s" % raw_values, 'urls')) - self.assertEqual(u"Go to %(link9_raw)s" % raw_values, auto_link("Go to %(link9_raw)s" % raw_values, 'email_addresses')) - self.assertEqual(u"Link %(link9_result)s
" % result_values, auto_link(literal("Link %(link9_raw)s
") % raw_values)) - self.assertEqual(u"%(link9_result)s Link
" % result_values, auto_link(literal("%(link9_raw)s Link
") % raw_values)) - self.assertEqual(u"Go to %(link9_result)s." % result_values, auto_link("Go to %(link9_raw)s." % raw_values)) - self.assertEqual(u"Go to %(link9_result)s. seriously, %(link9_result)s? i think I'll say hello to %(email_result)s. instead.
" % result_values, auto_link(literal("Go to %(link9_raw)s. seriously, %(link9_raw)s? i think I'll say hello to %(email_raw)s. instead.
") % raw_values)) - self.assertEqual(u"", auto_link(None)) - self.assertEqual(u"", auto_link("")) + self.assertEqual("hello %(email_result)s" % result_values, auto_link("hello %(email_raw)s" % raw_values, 'email_addresses')) + self.assertEqual("Go to %(link_result)s" % result_values, auto_link("Go to %(link_raw)s" % raw_values, 'urls')) + self.assertEqual("Go to %(link_raw)s" % raw_values, auto_link("Go to %(link_raw)s" % raw_values, 'email_addresses')) + self.assertEqual("Go to %(link_result)s and say hello to %(email_result)s" % result_values, auto_link("Go to %(link_raw)s and say hello to %(email_raw)s" % raw_values)) + self.assertEqual("Link %(link_result)s
" % result_values, auto_link(literal("Link %(link_raw)s
") % raw_values)) + self.assertEqual("%(link_result)s Link
" % result_values, auto_link(literal("%(link_raw)s Link
") % raw_values)) + self.assertEqual("Link %(link_result_with_options)s
" % result_values, auto_link(literal("Link %(link_raw)s
") % raw_values, 'all', target='_blank')) + self.assertEqual("Go to %(link_result)s." % result_values, auto_link("Go to %(link_raw)s." % raw_values)) + self.assertEqual("Go to %(link_result)s, then say hello to %(email_result)s.
" % result_values, auto_link(literal("Go to %(link_raw)s, then say hello to %(email_raw)s.
") % raw_values)) + self.assertEqual("Go to %(link2_result)s" % result_values, auto_link("Go to %(link2_raw)s" % raw_values, 'urls')) + self.assertEqual("Go to %(link2_raw)s" % raw_values, auto_link("Go to %(link2_raw)s" % raw_values, 'email_addresses')) + self.assertEqual("Link %(link2_result)s
" % result_values, auto_link(literal("Link %(link2_raw)s
") % raw_values)) + self.assertEqual("%(link2_result)s Link
" % result_values, auto_link(literal("%(link2_raw)s Link
") % raw_values)) + self.assertEqual("Go to %(link2_result)s." % result_values, auto_link(literal("Go to %(link2_raw)s.") % raw_values)) + self.assertEqual("Say hello to %(email_result)s, then go to %(link2_result)s.
" % result_values, auto_link(literal("Say hello to %(email_raw)s, then go to %(link2_raw)s.
") % raw_values)) + self.assertEqual("Go to %(link3_result)s" % result_values, auto_link("Go to %(link3_raw)s" % raw_values, 'urls')) + self.assertEqual("Go to %(link3_raw)s" % raw_values, auto_link("Go to %(link3_raw)s" % raw_values, 'email_addresses')) + self.assertEqual("Link %(link3_result)s
" % result_values, auto_link(literal("Link %(link3_raw)s
") % raw_values)) + self.assertEqual("%(link3_result)s Link
" % result_values, auto_link(literal("%(link3_raw)s Link
") % raw_values)) + self.assertEqual("Go to %(link3_result)s." % result_values, auto_link("Go to %(link3_raw)s." % raw_values)) + self.assertEqual("Go to %(link3_result)s. seriously, %(link3_result)s? i think I'll say hello to %(email_result)s. instead.
" % result_values, auto_link(literal("Go to %(link3_raw)s. seriously, %(link3_raw)s? i think I'll say hello to %(email_raw)s. instead.
") % raw_values)) + self.assertEqual("Link %(link4_result)s
" % result_values, auto_link(literal("Link %(link4_raw)s
") % raw_values)) + self.assertEqual("%(link4_result)s Link
" % result_values, auto_link(literal("%(link4_raw)s Link
") % raw_values)) + self.assertEqual("%(link5_result)s Link
" % result_values, auto_link(literal("%(link5_raw)s Link
") % raw_values)) + self.assertEqual("%(link6_result)s Link
" % result_values, auto_link(literal("%(link6_raw)s Link
") % raw_values)) + self.assertEqual("%(link7_result)s Link
" % result_values, auto_link(literal("%(link7_raw)s Link
") % raw_values)) + self.assertEqual("Go to %(link8_result)s" % result_values, auto_link("Go to %(link8_raw)s" % raw_values, 'urls')) + self.assertEqual("Go to %(link8_raw)s" % raw_values, auto_link("Go to %(link8_raw)s" % raw_values, 'email_addresses')) + self.assertEqual("Link %(link8_result)s
" % result_values, auto_link(literal("Link %(link8_raw)s
") % raw_values)) + self.assertEqual("%(link8_result)s Link
" % result_values, auto_link(literal("%(link8_raw)s Link
") % raw_values)) + self.assertEqual("Go to %(link8_result)s." % result_values, auto_link("Go to %(link8_raw)s." % raw_values)) + self.assertEqual("Go to %(link8_result)s. seriously, %(link8_result)s? i think I'll say hello to %(email_result)s. instead.
" % result_values, auto_link(literal("Go to %(link8_raw)s. seriously, %(link8_raw)s? i think I'll say hello to %(email_raw)s. instead.
") % raw_values)) + self.assertEqual("Go to %(link9_result)s" % result_values, auto_link("Go to %(link9_raw)s" % raw_values, 'urls')) + self.assertEqual("Go to %(link9_raw)s" % raw_values, auto_link("Go to %(link9_raw)s" % raw_values, 'email_addresses')) + self.assertEqual("Link %(link9_result)s
" % result_values, auto_link(literal("Link %(link9_raw)s
") % raw_values)) + self.assertEqual("%(link9_result)s Link
" % result_values, auto_link(literal("%(link9_raw)s Link
") % raw_values)) + self.assertEqual("Go to %(link9_result)s." % result_values, auto_link("Go to %(link9_raw)s." % raw_values)) + self.assertEqual("Go to %(link9_result)s. seriously, %(link9_result)s? i think I'll say hello to %(email_result)s. instead.
" % result_values, auto_link(literal("Go to %(link9_raw)s. seriously, %(link9_raw)s? i think I'll say hello to %(email_raw)s. instead.
") % raw_values)) + self.assertEqual("", auto_link(None)) + self.assertEqual("", auto_link("")) # Failing test: PylonsHQ bug #657 #self.assertEqual(u'<www.google.com>', auto_link("