86>Apr 14 01:12:45 userdel[79291]: delete user 'rooter' <86>Apr 14 01:12:45 userdel[79291]: removed group 'rooter' owned by 'rooter' <86>Apr 14 01:12:45 groupadd[79417]: group added to /etc/group: name=rooter, GID=675 <86>Apr 14 01:12:45 groupadd[79417]: group added to /etc/gshadow: name=rooter <86>Apr 14 01:12:45 groupadd[79417]: new group: name=rooter, GID=675 <86>Apr 14 01:12:45 useradd[79433]: new user: name=rooter, UID=675, GID=675, home=/root, shell=/bin/bash <86>Apr 14 01:12:45 userdel[79595]: delete user 'builder' <86>Apr 14 01:12:45 userdel[79595]: removed group 'builder' owned by 'builder' <86>Apr 14 01:12:45 userdel[79595]: removed shadow group 'builder' owned by 'builder' <86>Apr 14 01:12:45 groupadd[79619]: group added to /etc/group: name=builder, GID=676 <86>Apr 14 01:12:45 groupadd[79619]: group added to /etc/gshadow: name=builder <86>Apr 14 01:12:45 groupadd[79619]: new group: name=builder, GID=676 <86>Apr 14 01:12:45 useradd[79639]: new user: name=builder, UID=676, GID=676, home=/usr/src, shell=/bin/bash <13>Apr 14 01:12:47 rpmi: libexpat-2.2.4-alt0.M80P.1 1503871120 installed <13>Apr 14 01:12:47 rpmi: libgdbm-1.8.3-alt10 1454943313 installed <13>Apr 14 01:12:47 rpmi: libtinfo-devel-5.9-alt8 1456756459 installed <13>Apr 14 01:12:47 rpmi: libncurses-devel-5.9-alt8 1456756459 installed <13>Apr 14 01:12:47 rpmi: python-modules-curses-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:47 rpmi: libverto-0.2.6-alt1_6 1455633234 installed <13>Apr 14 01:12:47 rpmi: libkeyutils-1.5.10-alt0.M80P.2 p8+216694.100.6.1 1547827915 installed <13>Apr 14 01:12:47 rpmi: libcom_err-1.42.13-alt2 1449075846 installed <13>Apr 14 01:12:47 rpmi: ca-certificates-2016.02.25-alt1 1462368370 installed <13>Apr 14 01:12:47 rpmi: libcrypto10-1.0.2n-alt0.M80P.1 1512766129 installed <13>Apr 14 01:12:47 rpmi: libssl10-1.0.2n-alt0.M80P.1 1512766129 installed <86>Apr 14 01:12:47 groupadd[86181]: group added to /etc/group: name=_keytab, GID=499 <86>Apr 14 01:12:47 groupadd[86181]: group added to /etc/gshadow: name=_keytab <86>Apr 14 01:12:47 groupadd[86181]: new group: name=_keytab, GID=499 <13>Apr 14 01:12:47 rpmi: libkrb5-1.14.6-alt1.M80P.1 1525355673 installed <13>Apr 14 01:12:48 rpmi: python3-base-3.5.4-alt2.M80P.1 1527753911 installed <13>Apr 14 01:12:48 rpmi: python-modules-compiler-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python3-3.5.4-alt2.M80P.1 1527753911 installed <13>Apr 14 01:12:48 rpmi: python-modules-email-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: rpm-build-python3-0.1.10.10-alt1.M80P.1 1530521451 installed <13>Apr 14 01:12:48 rpmi: python-modules-unittest-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-modules-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-modules-encodings-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-modules-xml-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-modules-hotshot-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-modules-bsddb-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-modules-ctypes-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-modules-multiprocessing-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-modules-logging-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-dev-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 01:12:48 rpmi: python-tools-2to3-2.7.11-alt6.M80P.1 1527682470 installed Installing python-module-meld3-0.6.5-alt1.2.1.1.src.rpm Building target platforms: x86_64 Building for target x86_64 Executing(%prep): /bin/sh -e /usr/src/tmp/rpm-tmp.10873 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + rm -rf meld3-0.6.5 + echo 'Source #0 (meld3-0.6.5.tar):' Source #0 (meld3-0.6.5.tar): + /bin/tar -xf /usr/src/RPM/SOURCES/meld3-0.6.5.tar + cd meld3-0.6.5 + /bin/chmod -c -Rf u+rwX,go-w . + cp -fR . ../python3 + pushd ../python3 ~/RPM/BUILD/python3 ~/RPM/BUILD/meld3-0.6.5 + echo 'Patch #0 (meld3-0.6.5-alt-hotshot.patch):' Patch #0 (meld3-0.6.5-alt-hotshot.patch): + /usr/bin/patch -p0 patching file meld3/test_getiterator.py + echo 'Patch #1 (meld3-0.6.5-alt-mimetools.patch):' Patch #1 (meld3-0.6.5-alt-mimetools.patch): + /usr/bin/patch -p0 patching file meld3/meld3.py + find -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: No changes to ./setup.py RefactoringTool: Refactored ./meld3/meld3.py --- ./meld3/meld3.py (original) +++ ./meld3/meld3.py (refactored) @@ -1,9 +1,9 @@ -import htmlentitydefs +import html.entities import os import re import types from email.message import Message -from StringIO import StringIO +from io import StringIO try: from elementtree.ElementTree import TreeBuilder @@ -29,7 +29,7 @@ from xml.etree.ElementTree import ElementPath # HTMLTreeBuilder does not exist in python 2.5 standard elementtree -from HTMLParser import HTMLParser +from html.parser import HTMLParser AUTOCLOSE = "p", "li", "tr", "th", "td", "head", "body" IGNOREEND = "img", "hr", "meta", "link", "br" is_not_ascii = re.compile(eval(r'u"[\u0080-\uffff]"')).search @@ -206,10 +206,10 @@ self.attrib[key] = value def keys(self): - return self.attrib.keys() + return list(self.attrib.keys()) def items(self): - return self.attrib.items() + return list(self.attrib.items()) def getiterator(self, *ignored_args, **ignored_kw): # we ignore any tag= passed in to us, because it's too painful @@ -512,12 +512,12 @@ def attributes(self, **kw): """ Set attributes on this node. """ - for k, v in kw.items(): + for k, v in list(kw.items()): # prevent this from getting to the parser if possible - if not isinstance(k, types.StringTypes): - raise ValueError, 'do not set non-stringtype as key: %s' % k - if not isinstance(v, types.StringTypes): - raise ValueError, 'do not set non-stringtype as val: %s' % v + if not isinstance(k, (str,)): + raise ValueError('do not set non-stringtype as key: %s' % k) + if not isinstance(v, (str,)): + raise ValueError('do not set non-stringtype as val: %s' % v) self.attrib[k] = kw[k] # output methods @@ -757,7 +757,7 @@ if '{' + key == _MELD_ID: meldid = attrib_in[key] if self.meldids.get(meldid): - raise ValueError, ('Repeated meld id "%s" in source' % + raise ValueError('Repeated meld id "%s" in source' % meldid) self.meldids[meldid] = 1 return XMLTreeBuilder._start(self, tag, attrib_in) @@ -773,7 +773,7 @@ if _MELD_ID == attrib: meldid = attrib_in[i+1] if self.meldids.get(meldid): - raise ValueError, ('Repeated meld id "%s" in source' % + raise ValueError('Repeated meld id "%s" in source' % meldid) self.meldids[meldid] = 1 return XMLTreeBuilder._start_list(self, tag, attrib_in) @@ -829,7 +829,7 @@ if k == _MELD_SHORT_ID: k = _MELD_ID if self.meldids.get(v): - raise ValueError, ('Repeated meld id "%s" in source' % + raise ValueError('Repeated meld id "%s" in source' % v) self.meldids[v] = 1 else: @@ -856,10 +856,10 @@ if 0 <= char < 128: self.builder.data(chr(char)) else: - self.builder.data(unichr(char)) + self.builder.data(chr(char)) def handle_entityref(self, name): - entity = htmlentitydefs.entitydefs.get(name) + entity = html.entities.entitydefs.get(name) if entity: if len(entity) == 1: entity = ord(entity) @@ -868,14 +868,14 @@ if 0 <= entity < 128: self.builder.data(chr(entity)) else: - self.builder.data(unichr(entity)) + self.builder.data(chr(entity)) else: self.unknown_entityref(name) def handle_data(self, data): if isinstance(data, type('')) and is_not_ascii(data): # convert to unicode, but only if necessary - data = unicode(data,RefactoringTool: Refactored ./meld3/test_getiterator.py RefactoringTool: Refactored ./meld3/zptprofile.py RefactoringTool: Refactored ./meld3/testclone.py RefactoringTool: Refactored ./meld3/test_meld3.py self.encoding, "ignore") + data = str(data, self.encoding, "ignore") self.builder.data(data) def unknown_entityref(self, name): @@ -920,7 +920,7 @@ def _both_case(mapping): # Add equivalent upper-case keys to mapping. - lc_keys = mapping.keys() + lc_keys = list(mapping.keys()) for k in lc_keys: mapping[k.upper()] = mapping[k] @@ -985,7 +985,7 @@ if attrib is not None: if len(attrib) > 1: - attrib_keys = attrib.keys() + attrib_keys = list(attrib.keys()) attrib_keys.sort() else: attrib_keys = attrib @@ -1086,7 +1086,7 @@ if attrib is not None: if len(attrib) > 1: - attrib_keys = attrib.keys() + attrib_keys = list(attrib.keys()) attrib_keys.sort() else: @@ -1150,7 +1150,7 @@ if tag[:_XHTML_PREFIX_LEN] == _XHTML_PREFIX: tag = tag[_XHTML_PREFIX_LEN:] if node.attrib: - items = node.attrib.items() + items = list(node.attrib.items()) else: items = [] # must always be sortable. xmlns_items = [] # new namespaces in this scope @@ -1256,7 +1256,7 @@ try: name, pubid, system = doctype except (ValueError, TypeError): - raise ValueError, ("doctype must be supplied as a 3-tuple in the form " + raise ValueError("doctype must be supplied as a 3-tuple in the form " "(name, pubid, system) e.g. '%s'" % doctype.xhtml) write('\n' % (name, pubid, system)) @@ -1343,7 +1343,7 @@ def search(name): if not "." in name: - raise ValueError("unloadable datatype name: " + `name`) + raise ValueError("unloadable datatype name: " + repr(name)) components = name.split('.') start = components[0] g = globals() --- ./meld3/test_getiterator.py (original) +++ ./meld3/test_getiterator.py (refactored) @@ -1,6 +1,6 @@ import profile import pstats -import meld3 +from . import meld3 # get rid of the noise of setting up an encoding # in profile output '.'.encode('utf-8') @@ -35,7 +35,7 @@ def run(root): clone = root.clone() - print clone.getiterator() + print(clone.getiterator()) if __name__ == '__main__': profiler= profile.Profile("logfile.dat") --- ./meld3/zptprofile.py (original) +++ ./meld3/zptprofile.py (refactored) @@ -73,10 +73,10 @@ number = 50 result = t.repeat(repeat, number) best = min(result) - print "%d loops " % repeat + print("%d loops " % repeat) usec = best * 1e6 / number msec = usec / 1000 - print "best of %d: %.*g msec per loop" % (repeat, 8, msec) + print("best of %d: %.*g msec per loop" % (repeat, 8, msec)) --- ./meld3/testclone.py (original) +++ ./meld3/testclone.py (refactored) @@ -1,4 +1,4 @@ -import meld3 +from . import meld3 import time import timeit @@ -26,7 +26,7 @@ best = min(result) usec = best * 1e6 / number msec = usec / 1000 - print "%s best of %d: %.*g msec per loop" % (name, repeat, 8, msec) + print("%s best of %d: %.*g msec per loop" % (name, repeat, 8, msec)) t = timeit.Timer("meld3.chelper.clone(clonable, parent)", "from __main__ import meld3, clonable, parent") --- ./meld3/test_meld3.py (original) +++ ./meld3/test_meld3.py (refactored) @@ -1,5 +1,5 @@ import unittest -from StringIO import StringIO +from io import StringIO import re _SIMPLE_XML = r""" @@ -304,11 +304,11 @@ class MeldAPITests(unittest.TestCase): def _makeElement(self, string): - from meld3 import parse_xmlstring + from .meld3 import parse_xmlstring return parse_xmlstring(string) def _makeElementFromHTML(self, string): - from meld3 import parse_htmlstring + from .meld3 import parse_htmlstring return parse_htmlstring(string) def test_findmeld(self): @@ -423,7 +423,7 @@ self.assertEqual(favoritecolor[1].attrib.get('checked'), None) def test_replace_removes_all_elements(self): - from meld3 import Replace + from .meld3 import Replace root = self._makeElement(_SIMPLE_XML) L = root.findmeld('list') L.replace('this is a textual replacement') @@ -432,7 +432,7 @@ self.assertEqual(len(root.getchildren()), 1) def test_replace_replaces_the_right_element(self): - from meld3 import Replace + from .meld3 import Replace root = self._makeElement(_SIMPLE_XML) D = root.findmeld('description') D.replace('this is a textual replacement') @@ -453,7 +453,7 @@ self.assertEqual(D.structure, False) def test_content(self): - from meld3 import Replace + from .meld3 import Replace root = self._makeElement(_SIMPLE_XML) D = root.findmeld('description') D.content('this is a textual replacement') @@ -477,7 +477,7 @@ self.assertEqual(T.structure, False) def test_attributes(self): - from meld3 import _MELD_ID + from .meld3 import _MELD_ID root = self._makeElement(_COMPLEX_XHTML) D = root.findmeld('form1') D.attributes(foo='bar', baz='1', g='2', action='#') @@ -492,7 +492,7 @@ class MeldElementInterfaceTests(unittest.TestCase): def _getTargetClass(self): - from meld3 import _MeldElementInterface + from .meld3 import _MeldElementInterface return _MeldElementInterface def _makeOne(self, *arg, **kw): @@ -501,7 +501,7 @@ def test_repeat(self): root = self._makeOne('root', {}) - from meld3 import _MELD_ID + from .meld3 import _MELD_ID item = self._makeOne('item', {_MELD_ID:'item'}) record = self._makeOne('record', {_MELD_ID:'record'}) name = self._makeOne('name', {_MELD_ID:'name'}) @@ -546,7 +546,7 @@ self.assertEqual(replacenode.parent, el) self.assertEqual(replacenode.text, 'hello') self.assertEqual(replacenode.structure, False) - from meld3 import Replace + from .meld3 import Replace self.assertEqual(replacenode.tag, Replace) def test_content_simple_structure(self): @@ -557,23 +557,23 @@ self.assertEqual(replacenode.parent, el) self.assertEqual(replacenode.text, 'hello') self.assertEqual(replacenode.structure, True) - from meld3 import Replace + from .meld3 import Replace self.assertEqual(replacenode.tag, Replace) def test_findmeld_simple(self): - from meld3 import _MELD_ID + from .meld3 import _MELD_ID el = self._makeOne('div', {_MELD_ID:'thediv'}) self.assertEqual(el.findmeld('thediv'), el) def test_findmeld_simple_oneleveldown(self): - from meld3 import _MELD_ID + from .meld3 import _MELD_ID el = self._makeOne('div', {_MELD_ID:'thediv'}) span = self._makeOne('span', {_MELD_ID:'thespan'}) el.append(span) self.assertEqual(el.findmeld('thespan'), span) def test_findmeld_simple_twolevelsdown(self): - from meld3 import _MELD_ID + from .meld3 import _MELD_ID el = self._makeOne('div', {_MELD_ID:'thediv'}) span = self._makeOne('span', {_MELD_ID:'thespan'}) a = self._makeOne('a', {_MELD_ID:'thea'}) @@ -690,10 +690,10 @@ self.assertEqual(div[0][0][0].text, div2[0][0][0].text) self.assertEqual(div[0][0][0].tail, div2[0][0][0].tail) - self.failIfEqual(id(div), id(div2)) - self.failIfEqual(id(div[0]), id(div2[0])) - self.failIfEqual(id(div[0][0]), id(div2[0][0])) - self.failIfEqual(id(div[0][0][0]), id(div2[0][0][0])) + self.assertNotEqual(id(div), id(div2)) + self.assertNotEqual(id(div[0]), id(div2[0])) + self.assertNotEqual(id(div[0][0]), id(div2[0][0])) + self.assertNotEqual(id(div[0][0][0]), id(div2[0][0][0])) def test_deparent_noparent(self): div = self._makeOne('div', {}) @@ -747,7 +747,7 @@ self.assertEqual(len(parent._children), 0) def test_lineage(self): - from meld3 import _MELD_ID + from .meld3 import _MELD_ID div1 = self._makeOne('div', {_MELD_ID:'div1'}) span1 = self._makeOne('span', {_MELD_ID:'span1'}) span2 = self._makeOne('span', {_MELD_ID:'span2'}) @@ -804,15 +804,15 @@ self.assertEqual(r, '