<86>Dec 6 00:23:42 userdel[554333]: delete user 'rooter' <86>Dec 6 00:23:42 userdel[554333]: removed group 'rooter' owned by 'rooter' <86>Dec 6 00:23:42 groupadd[554347]: group added to /etc/group: name=rooter, GID=939 <86>Dec 6 00:23:42 groupadd[554347]: group added to /etc/gshadow: name=rooter <86>Dec 6 00:23:42 groupadd[554347]: new group: name=rooter, GID=939 <86>Dec 6 00:23:42 useradd[554355]: new user: name=rooter, UID=939, GID=939, home=/root, shell=/bin/bash <86>Dec 6 00:23:42 userdel[554371]: delete user 'builder' <86>Dec 6 00:23:42 userdel[554371]: removed group 'builder' owned by 'builder' <86>Dec 6 00:23:42 userdel[554371]: removed shadow group 'builder' owned by 'builder' <86>Dec 6 00:23:42 groupadd[554382]: group added to /etc/group: name=builder, GID=940 <86>Dec 6 00:23:42 groupadd[554382]: group added to /etc/gshadow: name=builder <86>Dec 6 00:23:42 groupadd[554382]: new group: name=builder, GID=940 <86>Dec 6 00:23:42 useradd[554392]: new user: name=builder, UID=940, GID=940, home=/usr/src, shell=/bin/bash /usr/src/in/srpm/python3-module-MultipartPostHandler2-0.1.5-alt1.git20140925.3.src.rpm: The use of such a license name is ambiguous: LGPL <13>Dec 6 00:23:44 rpmi: libgdbm-1.8.3-alt10 sisyphus+278100.1600.1.1 1626058413 installed <13>Dec 6 00:23:44 rpmi: libexpat-2.2.10-alt1 sisyphus+276608.100.1.2 1625153355 installed <13>Dec 6 00:23:44 rpmi: libp11-kit-0.23.15-alt2 sisyphus+287552.300.2.1 1634541413 installed <13>Dec 6 00:23:44 rpmi: libtasn1-4.17.0-alt2 sisyphus+285706.100.1.1 1632328563 installed <13>Dec 6 00:23:44 rpmi: rpm-macros-alternatives-0.5.1-alt1 sisyphus+278157.100.2.1 1626055790 installed <13>Dec 6 00:23:44 rpmi: alternatives-0.5.1-alt1 sisyphus+278157.100.2.1 1626055790 installed <13>Dec 6 00:23:44 rpmi: ca-certificates-2021.10.06-alt1 sisyphus+286526.200.1.1 1633528578 installed <13>Dec 6 00:23:44 rpmi: ca-trust-0.1.2-alt1 sisyphus+233348.100.1.1 1561653823 installed <13>Dec 6 00:23:44 rpmi: p11-kit-trust-0.23.15-alt2 sisyphus+287552.300.2.1 1634541413 installed <13>Dec 6 00:23:44 rpmi: libcrypto1.1-1.1.1l-alt2 sisyphus+287339.100.1.1 1634383589 installed <13>Dec 6 00:23:44 rpmi: libssl1.1-1.1.1l-alt2 sisyphus+287339.100.1.1 1634383589 installed <13>Dec 6 00:23:44 rpmi: python3-3.9.9-alt1 sisyphus+291125.100.2.1 1638385948 installed <13>Dec 6 00:23:44 rpmi: python3-base-3.9.9-alt1 sisyphus+291125.100.2.1 1638385948 installed <13>Dec 6 00:23:44 rpmi: tests-for-installed-python3-pkgs-0.1.18-alt1 sisyphus+290420.100.1.1 1637593698 installed <13>Dec 6 00:23:44 rpmi: rpm-build-python3-0.1.18-alt1 sisyphus+290420.100.1.1 1637593698 installed <13>Dec 6 00:23:45 rpmi: libpython-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed <13>Dec 6 00:23:45 rpmi: python2-base-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed <13>Dec 6 00:23:45 rpmi: python-modules-encodings-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed <13>Dec 6 00:23:45 rpmi: python-modules-compiler-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed <13>Dec 6 00:23:45 rpmi: python-modules-email-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed <13>Dec 6 00:23:45 rpmi: python-modules-unittest-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed <13>Dec 6 00:23:46 rpmi: python-modules-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed <13>Dec 6 00:23:46 rpmi: libffi7-1:3.3-alt2 sisyphus+287337.160.5.1 1634396592 installed <13>Dec 6 00:23:46 rpmi: python-modules-ctypes-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed <13>Dec 6 00:23:46 rpmi: python-modules-multiprocessing-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed <13>Dec 6 00:23:46 rpmi: python-modules-logging-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed <13>Dec 6 00:23:46 rpmi: python-tools-2to3-2.7.18-alt8 sisyphus+286676.100.1.1 1633726916 installed Building target platforms: x86_64 Building for target x86_64 Wrote: /usr/src/in/nosrpm/python3-module-MultipartPostHandler2-0.1.5-alt1.git20140925.3.nosrc.rpm (w1.gzdio) <13>Dec 6 00:23:47 rpmi: python3-module-pkg_resources-1:58.4.0-alt1 sisyphus+288641.100.2.1 1635771377 installed <13>Dec 6 00:23:47 rpmi: libpython3-3.9.9-alt1 sisyphus+291125.100.2.1 1638385948 installed <13>Dec 6 00:23:47 rpmi: libncurses-6.3.20211106-alt1 sisyphus+289273.100.1.1 1636477028 installed <13>Dec 6 00:23:47 rpmi: libtinfo-devel-6.3.20211106-alt1 sisyphus+289273.100.1.1 1636477028 installed <13>Dec 6 00:23:47 rpmi: libncurses-devel-6.3.20211106-alt1 sisyphus+289273.100.1.1 1636477028 installed <13>Dec 6 00:23:47 rpmi: python3-dev-3.9.9-alt1 sisyphus+291125.100.2.1 1638385948 installed <13>Dec 6 00:23:47 rpmi: python3-module-setuptools-1:58.4.0-alt1 sisyphus+288641.100.2.1 1635771377 installed Installing python3-module-MultipartPostHandler2-0.1.5-alt1.git20140925.3.src.rpm Building target platforms: x86_64 Building for target x86_64 Executing(%prep): /bin/sh -e /usr/src/tmp/rpm-tmp.93483 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + rm -rf python3-module-MultipartPostHandler2-0.1.5 + echo 'Source #0 (python3-module-MultipartPostHandler2-0.1.5.tar):' Source #0 (python3-module-MultipartPostHandler2-0.1.5.tar): + /bin/tar -xf /usr/src/RPM/SOURCES/python3-module-MultipartPostHandler2-0.1.5.tar + cd python3-module-MultipartPostHandler2-0.1.5 + /bin/chmod -c -Rf u+rwX,go-w . + 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 ./examples/MultipartPostHandler-example.py RefactoringTool: Refactored ./MultipartPostHandler.py RefactoringTool: Files that were modified: RefactoringTool: ./setup.py RefactoringTool: ./examples/MultipartPostHandler-example.py RefactoringTool: ./MultipartPostHandler.py --- ./examples/MultipartPostHandler-example.py (original) +++ ./examples/MultipartPostHandler-example.py (refactored) @@ -5,10 +5,10 @@ """ def main(): - import tempfile, sys, os, urllib2, MultipartPostHandler + import tempfile, sys, os, urllib.request, urllib.error, urllib.parse, MultipartPostHandler validatorURL = "http://validator.w3.org/check" - opener = urllib2.build_opener(MultipartPostHandler.MultipartPostHandler) + opener = urllib.request.build_opener(MultipartPostHandler.MultipartPostHandler) def validateFile(url): temp = tempfile.mkstemp(suffix=".html") @@ -16,7 +16,7 @@ params = { "ss" : "0", # show source "doctype" : "Inline", "uploaded_file" : open(temp[1], "rb") } - print(opener.open(validatorURL, params).read()) + print((opener.open(validatorURL, params).read())) os.remove(temp[1]) if len(sys.argv[1:]) > 0: --- ./MultipartPostHandler.py (original) +++ ./MultipartPostHandler.py (refactored) @@ -51,12 +51,12 @@ opener.open("http://wwww.bobsite.com/upload/", params) """ -import urllib -import urllib2 +import urllib.request, urllib.parse, urllib.error +import urllib.request, urllib.error, urllib.parse import mimetypes import email.generator import os, stat -from cStringIO import StringIO +from io import StringIO class Callable: def __init__(self, anycallable): @@ -66,8 +66,8 @@ # assigning a sequence. doseq = 1 -class MultipartPostHandler(urllib2.BaseHandler): - handler_order = urllib2.HTTPHandler.handler_order - 10 # needs to run first +class MultipartPostHandler(urllib.request.BaseHandler): + handler_order = urllib.request.HTTPHandler.handler_order - 10 # needs to run first def http_request(self, request): data = request.get_data() @@ -75,23 +75,23 @@ v_files = [] v_vars = [] try: - for(key, value) in data.items(): + for(key, value) in list(data.items()): if type(value) == file: v_files.append((key, value)) else: v_vars.append((key, value)) except TypeError: systype, value, traceback = sys.exc_info() - raise TypeError, "not a valid non-string sequence or mapping object", traceback + raise TypeError("not a valid non-string sequence or mapping object").with_traceback(traceback) if len(v_files) == 0: - data = urllib.urlencode(v_vars, doseq) + data = urllib.parse.urlencode(v_vars, doseq) else: boundary, data = self.multipart_encode(v_vars, v_files) contenttype = 'multipart/form-data; boundary=%s' % boundary if(request.has_header('Content-Type') and request.get_header('Content-Type').find('multipart/form-data') != 0): - print "Replacing %s with %s" % (request.get_header('content-type'), 'multipart/form-data') + print("Replacing %s with %s" % (request.get_header('content-type'), 'multipart/form-data')) request.add_unredirected_header('Content-Type', contenttype) request.add_data(data) + exit 0 Executing(%build): /bin/sh -e /usr/src/tmp/rpm-tmp.26366 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd python3-module-MultipartPostHandler2-0.1.5 + CFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto' + export CFLAGS + CXXFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto' + export CXXFLAGS + FFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto' + export FFLAGS + /usr/bin/python3 setup.py build --debug running build running build_py creating build creating build/lib copying MultipartPostHandler.py -> build/lib + exit 0 Executing(%install): /bin/sh -e /usr/src/tmp/rpm-tmp.26366 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + /bin/chmod -Rf u+rwX -- /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot + : + /bin/rm -rf -- /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot + PATH=/usr/libexec/rpm-build:/usr/src/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games + cd python3-module-MultipartPostHandler2-0.1.5 + CFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto' + export CFLAGS + CXXFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto' + export CXXFLAGS + FFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto' + export FFLAGS + /usr/bin/python3 setup.py install --skip-build --root=/usr/src/tmp/python3-module-MultipartPostHandler2-buildroot --force running install /usr/lib64/python3/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running install_lib creating /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot creating /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr creating /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/lib creating /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/lib/python3 creating /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/lib/python3/site-packages copying build/lib/MultipartPostHandler.py -> /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/lib/python3/site-packages byte-compiling /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/lib/python3/site-packages/MultipartPostHandler.py to MultipartPostHandler.cpython-39.pyc running install_egg_info running egg_info creating MultipartPostHandler2.egg-info writing MultipartPostHandler2.egg-info/PKG-INFO writing dependency_links to MultipartPostHandler2.egg-info/dependency_links.txt writing top-level names to MultipartPostHandler2.egg-info/top_level.txt writing manifest file 'MultipartPostHandler2.egg-info/SOURCES.txt' reading manifest file 'MultipartPostHandler2.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'MultipartPostHandler2.egg-info/SOURCES.txt' Copying MultipartPostHandler2.egg-info to /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/lib/python3/site-packages/MultipartPostHandler2-0.1.5-py3.9.egg-info running install_scripts + /usr/lib/rpm/brp-alt Cleaning files in /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot (auto) Verifying and fixing files in /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot (binconfig,pkgconfig,libtool,desktop,gnuconfig) Checking contents of files in /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/ (default) Compressing files in /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot (auto) Adjusting library links in /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot ./usr/lib: (from :0) Verifying ELF objects in /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot (arch=normal,fhs=normal,lfs=relaxed,lint=relaxed,rpath=normal,stack=normal,textrel=normal,unresolved=normal) Bytecompiling python3 modules in /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot using /usr/bin/python3 unlink /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/lib/python3/site-packages/__pycache__/MultipartPostHandler.cpython-39.pyc compile /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/lib/python3/site-packages/MultipartPostHandler.py Bytecompiling python3 modules with optimization in /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot using /usr/bin/python3 -O compile /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/lib/python3/site-packages/MultipartPostHandler.py Bytecompiling python3 modules with optimization-2 in /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot using /usr/bin/python3 -OO compile /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/lib/python3/site-packages/MultipartPostHandler.py Hardlinking identical .pyc and .opt-?.pyc files './usr/lib/python3/site-packages/__pycache__/MultipartPostHandler.cpython-39.opt-1.pyc' => './usr/lib/python3/site-packages/__pycache__/MultipartPostHandler.cpython-39.pyc' Processing files: python3-module-MultipartPostHandler2-0.1.5-alt1.git20140925.3 Executing(%doc): /bin/sh -e /usr/src/tmp/rpm-tmp.48786 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd python3-module-MultipartPostHandler2-0.1.5 + DOCDIR=/usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/share/doc/python3-module-MultipartPostHandler2-0.1.5 + export DOCDIR + rm -rf /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/share/doc/python3-module-MultipartPostHandler2-0.1.5 + /bin/mkdir -p /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/share/doc/python3-module-MultipartPostHandler2-0.1.5 + cp -prL README.txt examples/MultipartPostHandler-example.py /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/share/doc/python3-module-MultipartPostHandler2-0.1.5 + chmod -R go-w /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/share/doc/python3-module-MultipartPostHandler2-0.1.5 + chmod -R a+rX /usr/src/tmp/python3-module-MultipartPostHandler2-buildroot/usr/share/doc/python3-module-MultipartPostHandler2-0.1.5 + exit 0 Finding Provides (using /usr/lib/rpm/find-provides) Executing: /bin/sh -e /usr/src/tmp/rpm-tmp.wybZ1C 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.mmotX7 find-requires: running scripts (cpp,debuginfo,files,lib,pam,perl,pkgconfig,pkgconfiglib,python,python3,rpmlib,shebang,shell,static,symlinks,systemd-services) Provides: python3(MultipartPostHandler) Requires: /usr/lib/python3/site-packages, python3(email.generator) < 0, python3(io) < 0, python3(mimetypes) < 0, python3(os) < 0, python3(stat) < 0, python3(urllib.error) < 0, python3(urllib.parse) < 0, python3(urllib.request) < 0 Wrote: /usr/src/RPM/RPMS/noarch/python3-module-MultipartPostHandler2-0.1.5-alt1.git20140925.3.noarch.rpm (w2.lzdio) 1.95user 0.37system 0:04.12elapsed 56%CPU (0avgtext+0avgdata 25568maxresident)k 0inputs+0outputs (0major+168487minor)pagefaults 0swaps /.out/python3-module-MultipartPostHandler2-0.1.5-alt1.git20140925.3.noarch.rpm: The use of such a license name is ambiguous: LGPL 6.51user 3.51system 0:11.05elapsed 90%CPU (0avgtext+0avgdata 104640maxresident)k 0inputs+0outputs (46241major+558497minor)pagefaults 0swaps