I: pbuilder: network access will be disabled during build I: Current time: Sun Oct 31 14:59:26 -12 2021 I: pbuilder-time-stamp: 1635735566 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/buster-reproducible-base.tgz] I: copying local configuration I: mounting /proc filesystem I: mounting /sys filesystem I: creating /{dev,run}/shm I: mounting /dev/pts filesystem I: redirecting /dev/ptmx to /dev/pts/ptmx I: policy-rc.d already exists I: Copying source file I: copying [python-dsv_1.4.1-7.dsc] I: copying [./python-dsv_1.4.1.orig.tar.gz] I: copying [./python-dsv_1.4.1-7.debian.tar.xz] I: Extracting source gpgv: unknown type of key resource 'trustedkeys.kbx' gpgv: keyblock resource '/var/lib/jenkins/.gnupg/trustedkeys.kbx': General error gpgv: Signature made Tue Feb 26 15:02:12 2019 -12 gpgv: using RSA key 7C3AB9CFD230BD30DD009C591E7091B1F14A64A2 gpgv: Can't check signature: No public key dpkg-source: warning: failed to verify signature on ./python-dsv_1.4.1-7.dsc dpkg-source: info: extracting python-dsv in python-dsv-1.4.1 dpkg-source: info: unpacking python-dsv_1.4.1.orig.tar.gz dpkg-source: info: unpacking python-dsv_1.4.1-7.debian.tar.xz dpkg-source: info: using patch list from debian/patches/series dpkg-source: info: applying 01-leave-env-alone.patch dpkg-source: info: applying 02-wx-namespace-transition.patch dpkg-source: info: applying 03-avoid-unicoditis.patch dpkg-source: info: applying 04-wx3.0-compat.patch I: Not using root during the build. I: Installing the build-deps I: user script /srv/workspace/pbuilder/14441/tmp/hooks/D02_print_environment starting I: set BUILDDIR='/build' BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' BUILDUSERNAME='pbuilder1' BUILD_ARCH='arm64' DEBIAN_FRONTEND='noninteractive' DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=8' DISTRIBUTION='' HOME='/var/lib/jenkins' HOST_ARCH='arm64' IFS=' ' LANG='C' LANGUAGE='en_US:en' LC_ALL='C' MAIL='/var/mail/root' OPTIND='1' PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' PBCURRENTCOMMANDLINEOPERATION='build' PBUILDER_OPERATION='build' PBUILDER_PKGDATADIR='/usr/share/pbuilder' PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' PBUILDER_SYSCONFDIR='/etc' PPID='14441' PS1='# ' PS2='> ' PS4='+ ' PWD='/' SHELL='/bin/bash' SHLVL='2' SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/tmp.woatUril8q/pbuilderrc_ov61 --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/buster-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.woatUril8q/b1 --logfile b1/build.log python-dsv_1.4.1-7.dsc' SUDO_GID='117' SUDO_UID='110' SUDO_USER='jenkins' TERM='unknown' TZ='/usr/share/zoneinfo/Etc/GMT+12' USER='root' USERNAME='root' _='/usr/bin/systemd-run' http_proxy='http://192.168.101.16:3128' I: uname -a Linux codethink-sled13-arm64 4.4.0-190-generic #220-Ubuntu SMP Fri Aug 28 23:03:33 UTC 2020 aarch64 GNU/Linux I: ls -l /bin total 4928 -rwxr-xr-x 1 root root 1216928 Apr 17 2019 bash -rwxr-xr-x 3 root root 34808 Jul 10 2019 bunzip2 -rwxr-xr-x 3 root root 34808 Jul 10 2019 bzcat lrwxrwxrwx 1 root root 6 Jul 10 2019 bzcmp -> bzdiff -rwxr-xr-x 1 root root 2227 Jul 10 2019 bzdiff lrwxrwxrwx 1 root root 6 Jul 10 2019 bzegrep -> bzgrep -rwxr-xr-x 1 root root 4877 Jun 24 2019 bzexe lrwxrwxrwx 1 root root 6 Jul 10 2019 bzfgrep -> bzgrep -rwxr-xr-x 1 root root 3641 Jul 10 2019 bzgrep -rwxr-xr-x 3 root root 34808 Jul 10 2019 bzip2 -rwxr-xr-x 1 root root 14264 Jul 10 2019 bzip2recover lrwxrwxrwx 1 root root 6 Jul 10 2019 bzless -> bzmore -rwxr-xr-x 1 root root 1297 Jul 10 2019 bzmore -rwxr-xr-x 1 root root 35576 Feb 28 2019 cat -rwxr-xr-x 1 root root 60256 Feb 28 2019 chgrp -rwxr-xr-x 1 root root 56096 Feb 28 2019 chmod -rwxr-xr-x 1 root root 64368 Feb 28 2019 chown -rwxr-xr-x 1 root root 134632 Feb 28 2019 cp -rwxr-xr-x 1 root root 129536 Jan 17 2019 dash -rwxr-xr-x 1 root root 97136 Feb 28 2019 date -rwxr-xr-x 1 root root 76736 Feb 28 2019 dd -rwxr-xr-x 1 root root 93752 Feb 28 2019 df -rwxr-xr-x 1 root root 138848 Feb 28 2019 dir -rwxr-xr-x 1 root root 75984 Jan 9 2019 dmesg lrwxrwxrwx 1 root root 8 Sep 26 2018 dnsdomainname -> hostname lrwxrwxrwx 1 root root 8 Sep 26 2018 domainname -> hostname -rwxr-xr-x 1 root root 31368 Feb 28 2019 echo -rwxr-xr-x 1 root root 28 Jan 7 2019 egrep -rwxr-xr-x 1 root root 27256 Feb 28 2019 false -rwxr-xr-x 1 root root 28 Jan 7 2019 fgrep -rwxr-xr-x 1 root root 68792 Jan 9 2019 findmnt -rwsr-xr-x 1 root root 34824 Apr 22 2020 fusermount -rwxr-xr-x 1 root root 174304 Jan 7 2019 grep -rwxr-xr-x 2 root root 2345 Jan 5 2019 gunzip -rwxr-xr-x 1 root root 6375 Jan 5 2019 gzexe -rwxr-xr-x 1 root root 89656 Jan 5 2019 gzip -rwxr-xr-x 1 root root 18440 Sep 26 2018 hostname -rwxr-xr-x 1 root root 64472 Feb 28 2019 ln -rwxr-xr-x 1 root root 52544 Jul 26 2018 login -rwxr-xr-x 1 root root 138848 Feb 28 2019 ls -rwxr-xr-x 1 root root 108552 Jan 9 2019 lsblk -rwxr-xr-x 1 root root 76840 Feb 28 2019 mkdir -rwxr-xr-x 1 root root 64480 Feb 28 2019 mknod -rwxr-xr-x 1 root root 39736 Feb 28 2019 mktemp -rwxr-xr-x 1 root root 38840 Jan 9 2019 more -rwsr-xr-x 1 root root 47112 Jan 9 2019 mount -rwxr-xr-x 1 root root 14344 Jan 9 2019 mountpoint -rwxr-xr-x 1 root root 138736 Feb 28 2019 mv lrwxrwxrwx 1 root root 8 Sep 26 2018 nisdomainname -> hostname lrwxrwxrwx 1 root root 14 Feb 14 2019 pidof -> /sbin/killall5 -rwxr-xr-x 1 root root 35560 Feb 28 2019 pwd lrwxrwxrwx 1 root root 4 Apr 17 2019 rbash -> bash -rwxr-xr-x 1 root root 43712 Feb 28 2019 readlink -rwxr-xr-x 1 root root 68440 Feb 28 2019 rm -rwxr-xr-x 1 root root 39624 Feb 28 2019 rmdir -rwxr-xr-x 1 root root 19144 Jan 21 2019 run-parts -rwxr-xr-x 1 root root 114016 Dec 22 2018 sed lrwxrwxrwx 1 root root 4 Oct 24 02:48 sh -> dash -rwxr-xr-x 1 root root 31384 Feb 28 2019 sleep -rwxr-xr-x 1 root root 72480 Feb 28 2019 stty -rwsr-xr-x 1 root root 59424 Jan 9 2019 su -rwxr-xr-x 1 root root 31416 Feb 28 2019 sync -rwxr-xr-x 1 root root 449416 Apr 23 2019 tar -rwxr-xr-x 1 root root 10560 Jan 21 2019 tempfile -rwxr-xr-x 1 root root 88968 Feb 28 2019 touch -rwxr-xr-x 1 root root 27256 Feb 28 2019 true -rwxr-xr-x 1 root root 14264 Apr 22 2020 ulockmgr_server -rwsr-xr-x 1 root root 30728 Jan 9 2019 umount -rwxr-xr-x 1 root root 31384 Feb 28 2019 uname -rwxr-xr-x 2 root root 2345 Jan 5 2019 uncompress -rwxr-xr-x 1 root root 138848 Feb 28 2019 vdir -rwxr-xr-x 1 root root 34824 Jan 9 2019 wdctl -rwxr-xr-x 1 root root 946 Jan 21 2019 which lrwxrwxrwx 1 root root 8 Sep 26 2018 ypdomainname -> hostname -rwxr-xr-x 1 root root 1983 Jan 5 2019 zcat -rwxr-xr-x 1 root root 1677 Jan 5 2019 zcmp -rwxr-xr-x 1 root root 5879 Jan 5 2019 zdiff -rwxr-xr-x 1 root root 29 Jan 5 2019 zegrep -rwxr-xr-x 1 root root 29 Jan 5 2019 zfgrep -rwxr-xr-x 1 root root 2080 Jan 5 2019 zforce -rwxr-xr-x 1 root root 7584 Jan 5 2019 zgrep -rwxr-xr-x 1 root root 2205 Jan 5 2019 zless -rwxr-xr-x 1 root root 1841 Jan 5 2019 zmore -rwxr-xr-x 1 root root 4552 Jan 5 2019 znew I: user script /srv/workspace/pbuilder/14441/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy Version: 0.invalid.0 Architecture: arm64 Maintainer: Debian Pbuilder Team Description: Dummy package to satisfy dependencies with aptitude - created by pbuilder This package was created automatically by pbuilder to satisfy the build-dependencies of the package being currently built. Depends: 2to3, debhelper (>= 9~), dh-python, python-all, python-setuptools, python3-all, python3-setuptools dpkg-deb: building package 'pbuilder-satisfydepends-dummy' in '/tmp/satisfydepends-aptitude/pbuilder-satisfydepends-dummy.deb'. Selecting previously unselected package pbuilder-satisfydepends-dummy. (Reading database ... 19168 files and directories currently installed.) Preparing to unpack .../pbuilder-satisfydepends-dummy.deb ... Unpacking pbuilder-satisfydepends-dummy (0.invalid.0) ... dpkg: pbuilder-satisfydepends-dummy: dependency problems, but configuring anyway as you requested: pbuilder-satisfydepends-dummy depends on 2to3; however: Package 2to3 is not installed. pbuilder-satisfydepends-dummy depends on debhelper (>= 9~); however: Package debhelper is not installed. pbuilder-satisfydepends-dummy depends on dh-python; however: Package dh-python is not installed. pbuilder-satisfydepends-dummy depends on python-all; however: Package python-all is not installed. pbuilder-satisfydepends-dummy depends on python-setuptools; however: Package python-setuptools is not installed. pbuilder-satisfydepends-dummy depends on python3-all; however: Package python3-all is not installed. pbuilder-satisfydepends-dummy depends on python3-setuptools; however: Package python3-setuptools is not installed. Setting up pbuilder-satisfydepends-dummy (0.invalid.0) ... Reading package lists... Building dependency tree... Reading state information... Initializing package states... Writing extended state information... Building tag database... pbuilder-satisfydepends-dummy is already installed at the requested version (0.invalid.0) pbuilder-satisfydepends-dummy is already installed at the requested version (0.invalid.0) The following NEW packages will be installed: 2to3{a} autoconf{a} automake{a} autopoint{a} autotools-dev{a} bsdmainutils{a} debhelper{a} dh-autoreconf{a} dh-python{a} dh-strip-nondeterminism{a} dwz{a} file{a} gettext{a} gettext-base{a} groff-base{a} intltool-debian{a} libarchive-zip-perl{a} libbsd0{a} libcroco3{a} libelf1{a} libexpat1{a} libfile-stripnondeterminism-perl{a} libglib2.0-0{a} libicu63{a} libmagic-mgc{a} libmagic1{a} libmpdec2{a} libncurses6{a} libpipeline1{a} libpython-stdlib{a} libpython2-stdlib{a} libpython2.7-minimal{a} libpython2.7-stdlib{a} libpython3-stdlib{a} libpython3.7-minimal{a} libpython3.7-stdlib{a} libreadline7{a} libsigsegv2{a} libssl1.1{a} libtool{a} libuchardet0{a} libxml2{a} m4{a} man-db{a} mime-support{a} po-debconf{a} python{a} python-all{a} python-minimal{a} python-pkg-resources{a} python-setuptools{a} python2{a} python2-minimal{a} python2.7{a} python2.7-minimal{a} python3{a} python3-all{a} python3-distutils{a} python3-lib2to3{a} python3-minimal{a} python3-pkg-resources{a} python3-setuptools{a} python3.7{a} python3.7-minimal{a} readline-common{a} sensible-utils{a} The following packages are RECOMMENDED but will NOT be installed: curl libarchive-cpio-perl libglib2.0-data libgpm2 libltdl-dev libmail-sendmail-perl lynx shared-mime-info wget xdg-user-dirs 0 packages upgraded, 66 newly installed, 0 to remove and 0 not upgraded. Need to get 29.9 MB of archives. After unpacking 119 MB will be used. Writing extended state information... Get: 1 http://deb.debian.org/debian buster/main arm64 libbsd0 arm64 0.9.1-2 [97.4 kB] Get: 2 http://deb.debian.org/debian buster/main arm64 bsdmainutils arm64 11.1.2+b1 [185 kB] Get: 3 http://deb.debian.org/debian buster/main arm64 libuchardet0 arm64 0.0.6-3 [65.0 kB] Get: 4 http://deb.debian.org/debian buster/main arm64 groff-base arm64 1.22.4-3 [869 kB] Get: 5 http://deb.debian.org/debian buster/main arm64 libpipeline1 arm64 1.5.1-2 [29.8 kB] Get: 6 http://deb.debian.org/debian buster/main arm64 man-db arm64 2.8.5-2 [1258 kB] Get: 7 http://deb.debian.org/debian buster/main arm64 libpython2.7-minimal arm64 2.7.16-2+deb10u1 [395 kB] Get: 8 http://deb.debian.org/debian buster/main arm64 python2.7-minimal arm64 2.7.16-2+deb10u1 [1292 kB] Get: 9 http://deb.debian.org/debian buster/main arm64 python2-minimal arm64 2.7.16-1 [41.4 kB] Get: 10 http://deb.debian.org/debian buster/main arm64 python-minimal arm64 2.7.16-1 [21.0 kB] Get: 11 http://deb.debian.org/debian buster/main arm64 libssl1.1 arm64 1.1.1d-0+deb10u3 [1382 kB] Get: 12 http://deb.debian.org/debian buster/main arm64 mime-support all 3.62 [37.2 kB] Get: 13 http://deb.debian.org/debian buster/main arm64 libexpat1 arm64 2.2.6-2+deb10u1 [85.4 kB] Get: 14 http://deb.debian.org/debian buster/main arm64 readline-common all 7.0-5 [70.6 kB] Get: 15 http://deb.debian.org/debian buster/main arm64 libreadline7 arm64 7.0-5 [134 kB] Get: 16 http://deb.debian.org/debian buster/main arm64 libpython2.7-stdlib arm64 2.7.16-2+deb10u1 [1890 kB] Get: 17 http://deb.debian.org/debian buster/main arm64 python2.7 arm64 2.7.16-2+deb10u1 [305 kB] Get: 18 http://deb.debian.org/debian buster/main arm64 libpython2-stdlib arm64 2.7.16-1 [20.8 kB] Get: 19 http://deb.debian.org/debian buster/main arm64 libpython-stdlib arm64 2.7.16-1 [20.8 kB] Get: 20 http://deb.debian.org/debian buster/main arm64 python2 arm64 2.7.16-1 [41.6 kB] Get: 21 http://deb.debian.org/debian buster/main arm64 python arm64 2.7.16-1 [22.8 kB] Get: 22 http://deb.debian.org/debian buster/main arm64 libpython3.7-minimal arm64 3.7.3-2+deb10u2 [588 kB] Get: 23 http://deb.debian.org/debian buster/main arm64 python3.7-minimal arm64 3.7.3-2+deb10u2 [1404 kB] Get: 24 http://deb.debian.org/debian buster/main arm64 python3-minimal arm64 3.7.3-1 [36.6 kB] Get: 25 http://deb.debian.org/debian buster/main arm64 libmpdec2 arm64 2.4.2-2 [77.7 kB] Get: 26 http://deb.debian.org/debian buster/main arm64 libpython3.7-stdlib arm64 3.7.3-2+deb10u2 [1641 kB] Get: 27 http://deb.debian.org/debian buster/main arm64 python3.7 arm64 3.7.3-2+deb10u2 [330 kB] Get: 28 http://deb.debian.org/debian buster/main arm64 libpython3-stdlib arm64 3.7.3-1 [20.0 kB] Get: 29 http://deb.debian.org/debian buster/main arm64 python3 arm64 3.7.3-1 [61.5 kB] Get: 30 http://deb.debian.org/debian buster/main arm64 sensible-utils all 0.0.12 [15.8 kB] Get: 31 http://deb.debian.org/debian buster/main arm64 libmagic-mgc arm64 1:5.35-4+deb10u1 [242 kB] Get: 32 http://deb.debian.org/debian buster/main arm64 libmagic1 arm64 1:5.35-4+deb10u1 [115 kB] Get: 33 http://deb.debian.org/debian buster/main arm64 file arm64 1:5.35-4+deb10u1 [66.4 kB] Get: 34 http://deb.debian.org/debian buster/main arm64 gettext-base arm64 0.19.8.1-9 [120 kB] Get: 35 http://deb.debian.org/debian buster/main arm64 python3-lib2to3 all 3.7.3-1 [76.7 kB] Get: 36 http://deb.debian.org/debian buster/main arm64 2to3 all 3.7.3-1 [20.8 kB] Get: 37 http://deb.debian.org/debian buster/main arm64 libsigsegv2 arm64 2.12-2 [32.3 kB] Get: 38 http://deb.debian.org/debian buster/main arm64 m4 arm64 1.4.18-2 [198 kB] Get: 39 http://deb.debian.org/debian buster/main arm64 autoconf all 2.69-11 [341 kB] Get: 40 http://deb.debian.org/debian buster/main arm64 autotools-dev all 20180224.1 [77.0 kB] Get: 41 http://deb.debian.org/debian buster/main arm64 automake all 1:1.16.1-4 [771 kB] Get: 42 http://deb.debian.org/debian buster/main arm64 autopoint all 0.19.8.1-9 [434 kB] Get: 43 http://deb.debian.org/debian buster/main arm64 libtool all 2.4.6-9 [547 kB] Get: 44 http://deb.debian.org/debian buster/main arm64 dh-autoreconf all 19 [16.9 kB] Get: 45 http://deb.debian.org/debian buster/main arm64 libarchive-zip-perl all 1.64-1 [96.8 kB] Get: 46 http://deb.debian.org/debian buster/main arm64 libfile-stripnondeterminism-perl all 1.1.2-1 [19.8 kB] Get: 47 http://deb.debian.org/debian buster/main arm64 dh-strip-nondeterminism all 1.1.2-1 [13.0 kB] Get: 48 http://deb.debian.org/debian buster/main arm64 libelf1 arm64 0.176-1.1 [160 kB] Get: 49 http://deb.debian.org/debian buster/main arm64 dwz arm64 0.12-3 [71.7 kB] Get: 50 http://deb.debian.org/debian buster/main arm64 libglib2.0-0 arm64 2.58.3-2+deb10u2 [1185 kB] Get: 51 http://deb.debian.org/debian buster/main arm64 libicu63 arm64 63.1-6+deb10u1 [8151 kB] Get: 52 http://deb.debian.org/debian buster/main arm64 libxml2 arm64 2.9.4+dfsg1-7+b3 [623 kB] Get: 53 http://deb.debian.org/debian buster/main arm64 libcroco3 arm64 0.6.12-3 [140 kB] Get: 54 http://deb.debian.org/debian buster/main arm64 libncurses6 arm64 6.1+20181013-2+deb10u2 [92.6 kB] Get: 55 http://deb.debian.org/debian buster/main arm64 gettext arm64 0.19.8.1-9 [1261 kB] Get: 56 http://deb.debian.org/debian buster/main arm64 intltool-debian all 0.35.0+20060710.5 [26.8 kB] Get: 57 http://deb.debian.org/debian buster/main arm64 po-debconf all 1.0.21 [248 kB] Get: 58 http://deb.debian.org/debian buster/main arm64 debhelper all 12.1.1 [1016 kB] Get: 59 http://deb.debian.org/debian buster/main arm64 python3-distutils all 3.7.3-1 [142 kB] Get: 60 http://deb.debian.org/debian buster/main arm64 dh-python all 3.20190308 [99.3 kB] Get: 61 http://deb.debian.org/debian buster/main arm64 python-all arm64 2.7.16-1 [1044 B] Get: 62 http://deb.debian.org/debian buster/main arm64 python-pkg-resources all 40.8.0-1 [182 kB] Get: 63 http://deb.debian.org/debian buster/main arm64 python-setuptools all 40.8.0-1 [382 kB] Get: 64 http://deb.debian.org/debian buster/main arm64 python3-all arm64 3.7.3-1 [1068 B] Get: 65 http://deb.debian.org/debian buster/main arm64 python3-pkg-resources all 40.8.0-1 [153 kB] Get: 66 http://deb.debian.org/debian buster/main arm64 python3-setuptools all 40.8.0-1 [306 kB] Fetched 29.9 MB in 8s (3784 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libbsd0:arm64. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19168 files and directories currently installed.) Preparing to unpack .../00-libbsd0_0.9.1-2_arm64.deb ... Unpacking libbsd0:arm64 (0.9.1-2) ... Selecting previously unselected package bsdmainutils. Preparing to unpack .../01-bsdmainutils_11.1.2+b1_arm64.deb ... Unpacking bsdmainutils (11.1.2+b1) ... Selecting previously unselected package libuchardet0:arm64. Preparing to unpack .../02-libuchardet0_0.0.6-3_arm64.deb ... Unpacking libuchardet0:arm64 (0.0.6-3) ... Selecting previously unselected package groff-base. Preparing to unpack .../03-groff-base_1.22.4-3_arm64.deb ... Unpacking groff-base (1.22.4-3) ... Selecting previously unselected package libpipeline1:arm64. Preparing to unpack .../04-libpipeline1_1.5.1-2_arm64.deb ... Unpacking libpipeline1:arm64 (1.5.1-2) ... Selecting previously unselected package man-db. Preparing to unpack .../05-man-db_2.8.5-2_arm64.deb ... Unpacking man-db (2.8.5-2) ... Selecting previously unselected package libpython2.7-minimal:arm64. Preparing to unpack .../06-libpython2.7-minimal_2.7.16-2+deb10u1_arm64.deb ... Unpacking libpython2.7-minimal:arm64 (2.7.16-2+deb10u1) ... Selecting previously unselected package python2.7-minimal. Preparing to unpack .../07-python2.7-minimal_2.7.16-2+deb10u1_arm64.deb ... Unpacking python2.7-minimal (2.7.16-2+deb10u1) ... Selecting previously unselected package python2-minimal. Preparing to unpack .../08-python2-minimal_2.7.16-1_arm64.deb ... Unpacking python2-minimal (2.7.16-1) ... Selecting previously unselected package python-minimal. Preparing to unpack .../09-python-minimal_2.7.16-1_arm64.deb ... Unpacking python-minimal (2.7.16-1) ... Selecting previously unselected package libssl1.1:arm64. Preparing to unpack .../10-libssl1.1_1.1.1d-0+deb10u3_arm64.deb ... Unpacking libssl1.1:arm64 (1.1.1d-0+deb10u3) ... Selecting previously unselected package mime-support. Preparing to unpack .../11-mime-support_3.62_all.deb ... Unpacking mime-support (3.62) ... Selecting previously unselected package libexpat1:arm64. Preparing to unpack .../12-libexpat1_2.2.6-2+deb10u1_arm64.deb ... Unpacking libexpat1:arm64 (2.2.6-2+deb10u1) ... Selecting previously unselected package readline-common. Preparing to unpack .../13-readline-common_7.0-5_all.deb ... Unpacking readline-common (7.0-5) ... Selecting previously unselected package libreadline7:arm64. Preparing to unpack .../14-libreadline7_7.0-5_arm64.deb ... Unpacking libreadline7:arm64 (7.0-5) ... Selecting previously unselected package libpython2.7-stdlib:arm64. Preparing to unpack .../15-libpython2.7-stdlib_2.7.16-2+deb10u1_arm64.deb ... Unpacking libpython2.7-stdlib:arm64 (2.7.16-2+deb10u1) ... Selecting previously unselected package python2.7. Preparing to unpack .../16-python2.7_2.7.16-2+deb10u1_arm64.deb ... Unpacking python2.7 (2.7.16-2+deb10u1) ... Selecting previously unselected package libpython2-stdlib:arm64. Preparing to unpack .../17-libpython2-stdlib_2.7.16-1_arm64.deb ... Unpacking libpython2-stdlib:arm64 (2.7.16-1) ... Selecting previously unselected package libpython-stdlib:arm64. Preparing to unpack .../18-libpython-stdlib_2.7.16-1_arm64.deb ... Unpacking libpython-stdlib:arm64 (2.7.16-1) ... Setting up libpython2.7-minimal:arm64 (2.7.16-2+deb10u1) ... Setting up python2.7-minimal (2.7.16-2+deb10u1) ... Setting up python2-minimal (2.7.16-1) ... Selecting previously unselected package python2. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 20631 files and directories currently installed.) Preparing to unpack .../python2_2.7.16-1_arm64.deb ... Unpacking python2 (2.7.16-1) ... Setting up python-minimal (2.7.16-1) ... Selecting previously unselected package python. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 20664 files and directories currently installed.) Preparing to unpack .../python_2.7.16-1_arm64.deb ... Unpacking python (2.7.16-1) ... Selecting previously unselected package libpython3.7-minimal:arm64. Preparing to unpack .../libpython3.7-minimal_3.7.3-2+deb10u2_arm64.deb ... Unpacking libpython3.7-minimal:arm64 (3.7.3-2+deb10u2) ... Selecting previously unselected package python3.7-minimal. Preparing to unpack .../python3.7-minimal_3.7.3-2+deb10u2_arm64.deb ... Unpacking python3.7-minimal (3.7.3-2+deb10u2) ... Setting up libssl1.1:arm64 (1.1.1d-0+deb10u3) ... Setting up libpython3.7-minimal:arm64 (3.7.3-2+deb10u2) ... Setting up libexpat1:arm64 (2.2.6-2+deb10u1) ... Setting up python3.7-minimal (3.7.3-2+deb10u2) ... Selecting previously unselected package python3-minimal. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 20918 files and directories currently installed.) Preparing to unpack .../python3-minimal_3.7.3-1_arm64.deb ... Unpacking python3-minimal (3.7.3-1) ... Selecting previously unselected package libmpdec2:arm64. Preparing to unpack .../libmpdec2_2.4.2-2_arm64.deb ... Unpacking libmpdec2:arm64 (2.4.2-2) ... Selecting previously unselected package libpython3.7-stdlib:arm64. Preparing to unpack .../libpython3.7-stdlib_3.7.3-2+deb10u2_arm64.deb ... Unpacking libpython3.7-stdlib:arm64 (3.7.3-2+deb10u2) ... Selecting previously unselected package python3.7. Preparing to unpack .../python3.7_3.7.3-2+deb10u2_arm64.deb ... Unpacking python3.7 (3.7.3-2+deb10u2) ... Selecting previously unselected package libpython3-stdlib:arm64. Preparing to unpack .../libpython3-stdlib_3.7.3-1_arm64.deb ... Unpacking libpython3-stdlib:arm64 (3.7.3-1) ... Setting up python3-minimal (3.7.3-1) ... Selecting previously unselected package python3. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 21330 files and directories currently installed.) Preparing to unpack .../00-python3_3.7.3-1_arm64.deb ... Unpacking python3 (3.7.3-1) ... Selecting previously unselected package sensible-utils. Preparing to unpack .../01-sensible-utils_0.0.12_all.deb ... Unpacking sensible-utils (0.0.12) ... Selecting previously unselected package libmagic-mgc. Preparing to unpack .../02-libmagic-mgc_1%3a5.35-4+deb10u1_arm64.deb ... Unpacking libmagic-mgc (1:5.35-4+deb10u1) ... Selecting previously unselected package libmagic1:arm64. Preparing to unpack .../03-libmagic1_1%3a5.35-4+deb10u1_arm64.deb ... Unpacking libmagic1:arm64 (1:5.35-4+deb10u1) ... Selecting previously unselected package file. Preparing to unpack .../04-file_1%3a5.35-4+deb10u1_arm64.deb ... Unpacking file (1:5.35-4+deb10u1) ... Selecting previously unselected package gettext-base. Preparing to unpack .../05-gettext-base_0.19.8.1-9_arm64.deb ... Unpacking gettext-base (0.19.8.1-9) ... Selecting previously unselected package python3-lib2to3. Preparing to unpack .../06-python3-lib2to3_3.7.3-1_all.deb ... Unpacking python3-lib2to3 (3.7.3-1) ... Selecting previously unselected package 2to3. Preparing to unpack .../07-2to3_3.7.3-1_all.deb ... Unpacking 2to3 (3.7.3-1) ... Selecting previously unselected package libsigsegv2:arm64. Preparing to unpack .../08-libsigsegv2_2.12-2_arm64.deb ... Unpacking libsigsegv2:arm64 (2.12-2) ... Selecting previously unselected package m4. Preparing to unpack .../09-m4_1.4.18-2_arm64.deb ... Unpacking m4 (1.4.18-2) ... Selecting previously unselected package autoconf. Preparing to unpack .../10-autoconf_2.69-11_all.deb ... Unpacking autoconf (2.69-11) ... Selecting previously unselected package autotools-dev. Preparing to unpack .../11-autotools-dev_20180224.1_all.deb ... Unpacking autotools-dev (20180224.1) ... Selecting previously unselected package automake. Preparing to unpack .../12-automake_1%3a1.16.1-4_all.deb ... Unpacking automake (1:1.16.1-4) ... Selecting previously unselected package autopoint. Preparing to unpack .../13-autopoint_0.19.8.1-9_all.deb ... Unpacking autopoint (0.19.8.1-9) ... Selecting previously unselected package libtool. Preparing to unpack .../14-libtool_2.4.6-9_all.deb ... Unpacking libtool (2.4.6-9) ... Selecting previously unselected package dh-autoreconf. Preparing to unpack .../15-dh-autoreconf_19_all.deb ... Unpacking dh-autoreconf (19) ... Selecting previously unselected package libarchive-zip-perl. Preparing to unpack .../16-libarchive-zip-perl_1.64-1_all.deb ... Unpacking libarchive-zip-perl (1.64-1) ... Selecting previously unselected package libfile-stripnondeterminism-perl. Preparing to unpack .../17-libfile-stripnondeterminism-perl_1.1.2-1_all.deb ... Unpacking libfile-stripnondeterminism-perl (1.1.2-1) ... Selecting previously unselected package dh-strip-nondeterminism. Preparing to unpack .../18-dh-strip-nondeterminism_1.1.2-1_all.deb ... Unpacking dh-strip-nondeterminism (1.1.2-1) ... Selecting previously unselected package libelf1:arm64. Preparing to unpack .../19-libelf1_0.176-1.1_arm64.deb ... Unpacking libelf1:arm64 (0.176-1.1) ... Selecting previously unselected package dwz. Preparing to unpack .../20-dwz_0.12-3_arm64.deb ... Unpacking dwz (0.12-3) ... Selecting previously unselected package libglib2.0-0:arm64. Preparing to unpack .../21-libglib2.0-0_2.58.3-2+deb10u2_arm64.deb ... Unpacking libglib2.0-0:arm64 (2.58.3-2+deb10u2) ... Selecting previously unselected package libicu63:arm64. Preparing to unpack .../22-libicu63_63.1-6+deb10u1_arm64.deb ... Unpacking libicu63:arm64 (63.1-6+deb10u1) ... Selecting previously unselected package libxml2:arm64. Preparing to unpack .../23-libxml2_2.9.4+dfsg1-7+b3_arm64.deb ... Unpacking libxml2:arm64 (2.9.4+dfsg1-7+b3) ... Selecting previously unselected package libcroco3:arm64. Preparing to unpack .../24-libcroco3_0.6.12-3_arm64.deb ... Unpacking libcroco3:arm64 (0.6.12-3) ... Selecting previously unselected package libncurses6:arm64. Preparing to unpack .../25-libncurses6_6.1+20181013-2+deb10u2_arm64.deb ... Unpacking libncurses6:arm64 (6.1+20181013-2+deb10u2) ... Selecting previously unselected package gettext. Preparing to unpack .../26-gettext_0.19.8.1-9_arm64.deb ... Unpacking gettext (0.19.8.1-9) ... Selecting previously unselected package intltool-debian. Preparing to unpack .../27-intltool-debian_0.35.0+20060710.5_all.deb ... Unpacking intltool-debian (0.35.0+20060710.5) ... Selecting previously unselected package po-debconf. Preparing to unpack .../28-po-debconf_1.0.21_all.deb ... Unpacking po-debconf (1.0.21) ... Selecting previously unselected package debhelper. Preparing to unpack .../29-debhelper_12.1.1_all.deb ... Unpacking debhelper (12.1.1) ... Selecting previously unselected package python3-distutils. Preparing to unpack .../30-python3-distutils_3.7.3-1_all.deb ... Unpacking python3-distutils (3.7.3-1) ... Selecting previously unselected package dh-python. Preparing to unpack .../31-dh-python_3.20190308_all.deb ... Unpacking dh-python (3.20190308) ... Selecting previously unselected package python-all. Preparing to unpack .../32-python-all_2.7.16-1_arm64.deb ... Unpacking python-all (2.7.16-1) ... Selecting previously unselected package python-pkg-resources. Preparing to unpack .../33-python-pkg-resources_40.8.0-1_all.deb ... Unpacking python-pkg-resources (40.8.0-1) ... Selecting previously unselected package python-setuptools. Preparing to unpack .../34-python-setuptools_40.8.0-1_all.deb ... Unpacking python-setuptools (40.8.0-1) ... Selecting previously unselected package python3-all. Preparing to unpack .../35-python3-all_3.7.3-1_arm64.deb ... Unpacking python3-all (3.7.3-1) ... Selecting previously unselected package python3-pkg-resources. Preparing to unpack .../36-python3-pkg-resources_40.8.0-1_all.deb ... Unpacking python3-pkg-resources (40.8.0-1) ... Selecting previously unselected package python3-setuptools. Preparing to unpack .../37-python3-setuptools_40.8.0-1_all.deb ... Unpacking python3-setuptools (40.8.0-1) ... Setting up libpipeline1:arm64 (1.5.1-2) ... Setting up mime-support (3.62) ... Setting up libmagic-mgc (1:5.35-4+deb10u1) ... Setting up libarchive-zip-perl (1.64-1) ... Setting up libglib2.0-0:arm64 (2.58.3-2+deb10u2) ... No schema files found: doing nothing. Setting up libmagic1:arm64 (1:5.35-4+deb10u1) ... Setting up gettext-base (0.19.8.1-9) ... Setting up file (1:5.35-4+deb10u1) ... Setting up libicu63:arm64 (63.1-6+deb10u1) ... Setting up autotools-dev (20180224.1) ... Setting up libncurses6:arm64 (6.1+20181013-2+deb10u2) ... Setting up libsigsegv2:arm64 (2.12-2) ... Setting up autopoint (0.19.8.1-9) ... Setting up sensible-utils (0.0.12) ... Setting up libuchardet0:arm64 (0.0.6-3) ... Setting up libmpdec2:arm64 (2.4.2-2) ... Setting up libbsd0:arm64 (0.9.1-2) ... Setting up libelf1:arm64 (0.176-1.1) ... Setting up readline-common (7.0-5) ... Setting up libxml2:arm64 (2.9.4+dfsg1-7+b3) ... Setting up libreadline7:arm64 (7.0-5) ... Setting up libfile-stripnondeterminism-perl (1.1.2-1) ... Setting up libpython3.7-stdlib:arm64 (3.7.3-2+deb10u2) ... Setting up libtool (2.4.6-9) ... Setting up m4 (1.4.18-2) ... Setting up libpython2.7-stdlib:arm64 (2.7.16-2+deb10u1) ... Setting up bsdmainutils (11.1.2+b1) ... update-alternatives: using /usr/bin/bsd-write to provide /usr/bin/write (write) in auto mode update-alternatives: using /usr/bin/bsd-from to provide /usr/bin/from (from) in auto mode Setting up libcroco3:arm64 (0.6.12-3) ... Setting up autoconf (2.69-11) ... Setting up dwz (0.12-3) ... Setting up groff-base (1.22.4-3) ... Setting up libpython3-stdlib:arm64 (3.7.3-1) ... Setting up automake (1:1.16.1-4) ... update-alternatives: using /usr/bin/automake-1.16 to provide /usr/bin/automake (automake) in auto mode Setting up python3.7 (3.7.3-2+deb10u2) ... Setting up gettext (0.19.8.1-9) ... Setting up python2.7 (2.7.16-2+deb10u1) ... Setting up libpython2-stdlib:arm64 (2.7.16-1) ... Setting up python3 (3.7.3-1) ... Setting up man-db (2.8.5-2) ... Not building database; man-db/auto-update is not 'true'. Setting up python2 (2.7.16-1) ... Setting up intltool-debian (0.35.0+20060710.5) ... Setting up libpython-stdlib:arm64 (2.7.16-1) ... Setting up python3-lib2to3 (3.7.3-1) ... Setting up python (2.7.16-1) ... Setting up python3-pkg-resources (40.8.0-1) ... Setting up python3-distutils (3.7.3-1) ... Setting up dh-python (3.20190308) ... Setting up python3-setuptools (40.8.0-1) ... Setting up python-pkg-resources (40.8.0-1) ... Setting up po-debconf (1.0.21) ... Setting up python3-all (3.7.3-1) ... Setting up python-all (2.7.16-1) ... Setting up 2to3 (3.7.3-1) ... Setting up python-setuptools (40.8.0-1) ... Setting up dh-autoreconf (19) ... Setting up debhelper (12.1.1) ... Setting up dh-strip-nondeterminism (1.1.2-1) ... Processing triggers for libc-bin (2.28-10) ... Reading package lists... Building dependency tree... Reading state information... Reading extended state information... Initializing package states... Writing extended state information... Building tag database... -> Finished parsing the build-deps I: Building the package I: Running cd /build/python-dsv-1.4.1/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b dpkg-buildpackage: info: source package python-dsv dpkg-buildpackage: info: source version 1.4.1-7 dpkg-buildpackage: info: source distribution unstable dpkg-buildpackage: info: source changed by Aaron M. Ucko dpkg-source --before-build . dpkg-buildpackage: info: host architecture arm64 debian/rules clean dh clean --with python2,python3 --buildsystem=pybuild debian/rules override_dh_auto_clean make[1]: Entering directory '/build/python-dsv-1.4.1' [ ! -f DSV/DSV.py.bak ] || mv -v DSV/DSV.py.bak DSV/DSV.py dh_auto_clean I: pybuild base:217: python2.7 setup.py clean running clean removing '/build/python-dsv-1.4.1/.pybuild/cpython2_2.7_dsv/build' (and everything under it) 'build/bdist.linux-arm64' does not exist -- can't clean it 'build/scripts-2.7' does not exist -- can't clean it I: pybuild base:217: python3.7 setup.py clean running clean removing '/build/python-dsv-1.4.1/.pybuild/cpython3_3.7_dsv/build' (and everything under it) 'build/bdist.linux-arm64' does not exist -- can't clean it 'build/scripts-3.7' does not exist -- can't clean it make[1]: Leaving directory '/build/python-dsv-1.4.1' dh_clean -O--buildsystem=pybuild debian/rules binary dh binary --with python2,python3 --buildsystem=pybuild dh_update_autotools_config -O--buildsystem=pybuild dh_auto_configure -O--buildsystem=pybuild I: pybuild base:217: python2.7 setup.py config running config I: pybuild base:217: python3.7 setup.py config running config dh_auto_build -O--buildsystem=pybuild I: pybuild base:217: /usr/bin/python setup.py build running build running build_py creating /build/python-dsv-1.4.1/.pybuild/cpython2_2.7_dsv/build/DSV copying DSV/DSV.py -> /build/python-dsv-1.4.1/.pybuild/cpython2_2.7_dsv/build/DSV copying DSV/__init__.py -> /build/python-dsv-1.4.1/.pybuild/cpython2_2.7_dsv/build/DSV I: pybuild pybuild:272: 2to3 -w DSV/DSV.py RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: Refactored DSV/DSV.py --- DSV/DSV.py (original) +++ DSV/DSV.py (refactored) @@ -130,6 +130,7 @@ import copy import exceptions import string +from functools import reduce ## RedHat 8.0 (or rather GTK2?) sets LANG = en_us.UTF-8 and apparently some ## older apps (including wxGTK) can't handle this. The fix is to set LANG=C ## before running the app. Thanks to Ahmad Baitalmal for supplying this info. @@ -147,10 +148,10 @@ except ImportError: wx = None -class InvalidDelimiter(exceptions.StandardError): pass -class InvalidTextQualifier(exceptions.StandardError): pass -class InvalidData(exceptions.StandardError): pass -class InvalidNumberOfColumns(exceptions.StandardError): pass +class InvalidDelimiter(exceptions.Exception): pass +class InvalidTextQualifier(exceptions.Exception): pass +class InvalidData(exceptions.Exception): pass +class InvalidNumberOfColumns(exceptions.Exception): pass # ------------------------------------------------------------------------------ def guessTextQualifier(input): @@ -177,7 +178,7 @@ regexp = re.compile('(?:(?:^|\n)(?P["\']).*?(?P=b_quote))|' '(?:(?P.)(?P["\']).*?(?P=quote)(?=(?P=delim)|\n))|' '(?:(?P["\']).*?(?P=e_quote)$)', re.M | re.S) - matches = filter(lambda i: reduce(lambda a, b: a + b, i), regexp.findall(data)) + matches = [i for i in regexp.findall(data) if reduce(lambda a, b: a + b, i)] if not matches: return None quotes = {} @@ -189,7 +190,7 @@ quotes[key] = quotes.get(key, 0) + 1 return reduce(lambda a, b, quotes = quotes: - (quotes[a] > quotes[b]) and a or b, quotes.keys()) + (quotes[a] > quotes[b]) and a or b, list(quotes.keys())) # ------------------------------------------------------------------------------ def guessDelimiter(input, textQualifier = '"'): @@ -248,8 +249,8 @@ metafrequency[freq] = metafrequency.get(freq, 0) + 1 # value is the mode charFrequency[char] = metafrequency - for char in charFrequency.keys(): - items = charFrequency[char].items() + for char in list(charFrequency.keys()): + items = list(charFrequency[char].items()) if len(items) == 1 and items[0][0] == 0: continue # get the mode of the frequencies if len(items) > 1: @@ -262,7 +263,7 @@ modes[char] = items[0] # build a list of possible delimiters - modeList = modes.items() + modeList = list(modes.items()) total = float(chunkLength * iteration) consistency = 1.0 # (rows of consistent data) / (number of rows) = 100% threshold = 0.9 # minimum consistency threshold @@ -274,7 +275,7 @@ consistency -= 0.01 if len(delims) == 1: - return delims.keys()[0] + return list(delims.keys())[0] # analyze another chunkLength lines start = end @@ -289,20 +290,20 @@ regexp = re.compile('%s(.*?)%s' % (textQualifier, textQualifier), re.S) for line in input: inQuotes = "".join(regexp.findall(line)) - for d in delims.keys(): + for d in list(delims.keys()): if not d in inQuotes: del delims[d] if len(delims) == 1: - return delims.keys()[0] + return list(delims.keys())[0] # if there's *still* more than one, fall back to a 'preferred' list if len(delims) > 1: for d in ['\t', ',', ';', ' ', ':']: - if d in delims.keys(): + if d in list(delims.keys()): return d # finally, just return the first damn character in the list - return delims.keys()[0] + return list(delims.keys())[0] # ------------------------------------------------------------------------------ def modeOfLengths(input): @@ -321,7 +322,7 @@ l = len(row) freq[l] = freq.get(l, 0) + 1 - return reduce(lambda a, b, freq = freq: (freq[a] > freq[b]) and a or b, freq.keys()) + return reduce(lambda a, b, freq = freq: (freq[a] > freq[b]) and a or b, list(freq.keys())) # ------------------------------------------------------------------------------ def guessHeaders(input, columns = 0): @@ -345,7 +346,7 @@ # Finally, a 'vote' is taken at the end for each column, adding or subtracting from # the likelihood of the first row being a header. - if type(input) != type([]): raise InvalidData, "list expected." + if type(input) != type([]): raise InvalidData("list expected.") if len(input) < 2: return 0 if not columns: @@ -357,7 +358,7 @@ for row in input[1:]: if len(row) != columns: continue # skip rows that have irregular number of columns - for col in columnTypes.keys(): + for col in list(columnTypes.keys()): try: try: # is it a built-in type (besides string)? @@ -378,7 +379,7 @@ # finally, compare results against first row and vote on whether it's a header hasHeader = 0 - for col, colType in columnTypes.items(): + for col, colType in list(columnTypes.items()): if type(colType) == type(0): # it's a length if len(input[0][col]) != colType: hasHeader += 1 @@ -431,7 +432,7 @@ # filter out empty lines # data = filter(lambda i: "".join(i), data) - data = filter(string.join, data) + data = list(filter(string.join, data)) return data # ------------------------------------------------------------------------------ @@ -486,15 +487,15 @@ list of lists of data """ if type(input) != type([]): - raise InvalidData, "expected list of lists of strings" + raise InvalidData("expected list of lists of strings") # Try to convert Unicode delimiters back to ASCII (wxPython can be # overenthusiastic), but ultimately support either. try: delimiter = delimiter.encode() except: pass - if (type(delimiter) != str and type(delimiter) != unicode) or not delimiter: - raise InvalidDelimiter, `delimiter` + if (type(delimiter) != str and type(delimiter) != str) or not delimiter: + raise InvalidDelimiter(repr(delimiter)) ## if textQualifier: ## # fieldRex=re.compile('(?:(?:[,]|^)"(.*?)"(?=[,]|$))|(?:(?:[,]|^)([^",]*?)(?=[,]|$))') @@ -561,10 +562,10 @@ record.append(accu) else: #record = map(lambda x: x.strip(), line.split(delimiter)) - record = map(string.strip, line.split(delimiter)) + record = list(map(string.strip, line.split(delimiter))) if stripall: # 1.4.1 - record = map(string.strip, record) + record = list(map(string.strip, record)) newdata.append(record) # (end of replacement code) @@ -582,18 +583,18 @@ maxColumns = max([len(line) for line in newdata]) # consistency check - for record in xrange(len(newdata)): + for record in range(len(newdata)): length = len(newdata[record]) difference = length - columns if difference: if errorHandler is None: - raise InvalidNumberOfColumns, "Expected %d, got %d" % (columns, length) + raise InvalidNumberOfColumns("Expected %d, got %d" % (columns, length)) else: newdata[record] = errorHandler(record, input[record], newdata[record], columns, maxColumns) # remove null values from data # newdata = filter(lambda i: i, newdata) - newdata = filter(None, newdata) + newdata = [_f for _f in newdata if _f] return newdata @@ -618,19 +619,19 @@ if not textQualifier or type(delimiter) != type(''): raise InvalidTextQualifier # double-up all text qualifiers in data (i.e. can't becomes can''t) - data = map(lambda i, q = textQualifier: - map(lambda j, q = q: str(j).replace(q, q * 2), i), - input) RefactoringTool: Files that were modified: RefactoringTool: DSV/DSV.py + data = list(map(lambda i, q = textQualifier: + list(map(lambda j, q = q: str(j).replace(q, q * 2), i)), + input)) if quoteall: # quote every data value - data = map(lambda i, q = textQualifier: - map(lambda j, q = q: q + j + q, i), - data) + data = list(map(lambda i, q = textQualifier: + list(map(lambda j, q = q: q + j + q, i)), + data)) else: # quote only the values that contain qualifiers, delimiters or newlines - data = map(lambda i, q = textQualifier, d = delimiter: - map(lambda j, q = q, d = d: ((j.find(q) != -1 or j.find(d) != -1 + data = list(map(lambda i, q = textQualifier, d = delimiter: + list(map(lambda j, q = q, d = d: ((j.find(q) != -1 or j.find(d) != -1 or j.find('\n') != -1) - and (q + j + q)) or j, i), data) + and (q + j + q)) or j, i)), data)) # assemble each line with delimiters data = [delimiter.join(line) for line in data] @@ -718,7 +719,7 @@ self.delimChecks = {} - for label, value in delims.items(): + for label, value in list(delims.items()): self.delimChecks[value] = wx.CheckBox(self, -1, label) delimGridSizer.Add(self.delimChecks[value], 0, wx.ALL, 3) wx.EVT_CHECKBOX(self, self.delimChecks[value].GetId(), self.Validate) @@ -731,7 +732,7 @@ self.otherDelim = wx.TextCtrl(self, -1, size = (20, -1)) wx.EVT_TEXT(self, self.otherDelim.GetId(), self.OnCustomDelim) - if self.delimChecks.has_key(delimiter): + if delimiter in self.delimChecks: self.delimChecks[delimiter].SetValue(True) elif delimiter is not None: self.delimChecks['Other'].SetValue(True) @@ -860,7 +861,7 @@ self.BuildPreview() def Validate(self, event = None): - hasDelimiter = reduce(lambda a, b: a + b, [cb.GetValue() for cb in self.delimChecks.values()]) + hasDelimiter = reduce(lambda a, b: a + b, [cb.GetValue() for cb in list(self.delimChecks.values())]) if hasDelimiter == 1 and self.delimChecks['Other'].GetValue(): hasDelimiter = self.otherDelim.GetValue() != "" self.BuildPreview() @@ -881,8 +882,8 @@ textQualifier = self.textQualifierChoice.GetStringSelection() if textQualifier == '{None}': textQualifier = None other = self.otherDelim.GetValue() - delimiter = map(lambda i, other = other: i[0] != 'Other' and i[0] or other, - filter(lambda i: i[1].GetValue(), self.delimChecks.items())) + delimiter = list(map(lambda i, other = other: i[0] != 'Other' and i[0] or other, + [i for i in list(self.delimChecks.items()) if i[1].GetValue()])) delimiter = "".join(delimiter) rows = self.previewRows.GetValue() @@ -893,8 +894,8 @@ textQualifier = textQualifier, delimiter = delimiter, errorHandler = padRow) - except InvalidDelimiter, e: - previewData = map(lambda i: [i], newdata[:rows]) + except InvalidDelimiter as e: + previewData = [[i] for i in newdata[:rows]] rows = min(rows, len(previewData)) hasHeaders = self.hasHeaderRow.GetValue() @@ -1042,9 +1043,9 @@ # ------------------------------------------------------------------------------ if __name__ == '__main__': if wx is None: - print "\nYou need wxPython to run this sample*." - print "\n*Note that wxPython is _not_ necessary to use this module, but it is required" - print "to use the wizard dialog (which the sample requires)." + print("\nYou need wxPython to run this sample*.") + print("\n*Note that wxPython is _not_ necessary to use this module, but it is required") + print("to use the wizard dialog (which the sample requires).") raise SystemExit @@ -1073,16 +1074,16 @@ headers, data = results if 0: # print the output to stdout if headers: - print headers - print 80*'=' + print(headers) + print(80*'=') for row in data: - print row + print(row) if 0: # for testing export functionality if headers: - print exportDSV([headers] + data) + print(exportDSV([headers] + data)) else: - print exportDSV(data) + print(exportDSV(data)) else: dlg.Destroy() I: pybuild base:217: /usr/bin/python3 setup.py build running build running build_py creating /build/python-dsv-1.4.1/.pybuild/cpython3_3.7_dsv/build/DSV copying DSV/DSV.py -> /build/python-dsv-1.4.1/.pybuild/cpython3_3.7_dsv/build/DSV copying DSV/__init__.py -> /build/python-dsv-1.4.1/.pybuild/cpython3_3.7_dsv/build/DSV dh_auto_test -O--buildsystem=pybuild I: pybuild base:217: cd /build/python-dsv-1.4.1/.pybuild/cpython2_2.7_dsv/build; python2.7 -m unittest discover -v ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK I: pybuild base:217: cd /build/python-dsv-1.4.1/.pybuild/cpython3_3.7_dsv/build; python3.7 -m unittest discover -v ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK dh_testroot -O--buildsystem=pybuild dh_prep -O--buildsystem=pybuild dh_auto_install -O--buildsystem=pybuild I: pybuild base:217: /usr/bin/python setup.py install --root /build/python-dsv-1.4.1/debian/python-dsv running install running build running build_py copying DSV/DSV.py -> /build/python-dsv-1.4.1/.pybuild/cpython2_2.7_dsv/build/DSV running install_lib creating /build/python-dsv-1.4.1/debian/python-dsv/usr creating /build/python-dsv-1.4.1/debian/python-dsv/usr/lib creating /build/python-dsv-1.4.1/debian/python-dsv/usr/lib/python2.7 creating /build/python-dsv-1.4.1/debian/python-dsv/usr/lib/python2.7/dist-packages creating /build/python-dsv-1.4.1/debian/python-dsv/usr/lib/python2.7/dist-packages/DSV copying /build/python-dsv-1.4.1/.pybuild/cpython2_2.7_dsv/build/DSV/DSV.py -> /build/python-dsv-1.4.1/debian/python-dsv/usr/lib/python2.7/dist-packages/DSV copying /build/python-dsv-1.4.1/.pybuild/cpython2_2.7_dsv/build/DSV/__init__.py -> /build/python-dsv-1.4.1/debian/python-dsv/usr/lib/python2.7/dist-packages/DSV byte-compiling /build/python-dsv-1.4.1/debian/python-dsv/usr/lib/python2.7/dist-packages/DSV/DSV.py to DSV.pyc byte-compiling /build/python-dsv-1.4.1/debian/python-dsv/usr/lib/python2.7/dist-packages/DSV/__init__.py to __init__.pyc running install_egg_info Writing /build/python-dsv-1.4.1/debian/python-dsv/usr/lib/python2.7/dist-packages/DSV-1.4.1.egg-info I: pybuild base:217: /usr/bin/python3 setup.py install --root /build/python-dsv-1.4.1/debian/python3-dsv running install running build running build_py running install_lib creating /build/python-dsv-1.4.1/debian/python3-dsv/usr creating /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib creating /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib/python3.7 creating /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib/python3.7/dist-packages creating /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib/python3.7/dist-packages/DSV creating /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib/python3.7/dist-packages/DSV/__pycache__ copying /build/python-dsv-1.4.1/.pybuild/cpython3_3.7_dsv/build/DSV/__pycache__/__init__.cpython-37.pyc -> /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib/python3.7/dist-packages/DSV/__pycache__ copying /build/python-dsv-1.4.1/.pybuild/cpython3_3.7_dsv/build/DSV/__init__.py -> /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib/python3.7/dist-packages/DSV copying /build/python-dsv-1.4.1/.pybuild/cpython3_3.7_dsv/build/DSV/DSV.py -> /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib/python3.7/dist-packages/DSV byte-compiling /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib/python3.7/dist-packages/DSV/__init__.py to __init__.cpython-37.pyc byte-compiling /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib/python3.7/dist-packages/DSV/DSV.py to DSV.cpython-37.pyc running install_egg_info Writing /build/python-dsv-1.4.1/debian/python3-dsv/usr/lib/python3.7/dist-packages/DSV-1.4.1.egg-info dh_installdocs -O--buildsystem=pybuild dh_installchangelogs -O--buildsystem=pybuild dh_python2 -O--buildsystem=pybuild dh_python3 -O--buildsystem=pybuild dh_installinit -O--buildsystem=pybuild dh_perl -O--buildsystem=pybuild dh_link -O--buildsystem=pybuild dh_strip_nondeterminism -O--buildsystem=pybuild dh_compress -O--buildsystem=pybuild dh_fixperms -O--buildsystem=pybuild dh_missing -O--buildsystem=pybuild dh_installdeb -O--buildsystem=pybuild dh_gencontrol -O--buildsystem=pybuild dpkg-gencontrol: warning: Provides field of package python3-dsv: substitution variable ${python3:Provides} used, but is not defined dpkg-gencontrol: warning: package python-dsv: substitution variable ${python:Versions} unused, but is defined dh_md5sums -O--buildsystem=pybuild dh_builddeb -O--buildsystem=pybuild dpkg-deb: building package 'python3-dsv' in '../python3-dsv_1.4.1-7_all.deb'. dpkg-deb: building package 'python-dsv' in '../python-dsv_1.4.1-7_all.deb'. dpkg-genbuildinfo --build=binary dpkg-genchanges --build=binary >../python-dsv_1.4.1-7_arm64.changes dpkg-genchanges: info: binary-only upload (no source code included) dpkg-source --after-build . dpkg-buildpackage: info: binary-only upload (no source included) I: copying local configuration I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env I: removing directory /srv/workspace/pbuilder/14441 and its subdirectories I: Current time: Sun Oct 31 15:00:17 -12 2021 I: pbuilder-time-stamp: 1635735617