Warning: Permanently added '2620:52:3:1:dead:beef:cafe:c193' (ED25519) to the list of known hosts.

You can reproduce this build on your computer by running:

  sudo dnf install copr-rpmbuild
  /usr/bin/copr-rpmbuild --verbose --drop-resultdir --task-url https://copr.fedorainfracloud.org/backend/get-build-task/8753681-fedora-rawhide-x86_64 --chroot fedora-rawhide-x86_64


Version: 1.2
PID: 8508
Logging PID: 8509
Task:
{'allow_user_ssh': False,
 'appstream': False,
 'background': True,
 'build_id': 8753681,
 'buildroot_pkgs': [],
 'chroot': 'fedora-rawhide-x86_64',
 'enable_net': False,
 'fedora_review': False,
 'git_hash': '62748717fc44de56347d64a8e3c7606f6879170f',
 'git_repo': 'https://copr-dist-git.fedorainfracloud.org/git/lbalhar/python-attrs_rawhide/python-extractcode',
 'isolation': 'default',
 'memory_reqs': 2048,
 'package_name': 'python-extractcode',
 'package_version': '31.0.0-6',
 'project_dirname': 'python-attrs_rawhide',
 'project_name': 'python-attrs_rawhide',
 'project_owner': 'lbalhar',
 'repo_priority': None,
 'repos': [{'baseurl': 'https://download.copr.fedorainfracloud.org/results/lbalhar/python-attrs_rawhide/fedora-rawhide-x86_64/',
            'id': 'copr_base',
            'name': 'Copr repository',
            'priority': None}],
 'sandbox': 'lbalhar/python-attrs_rawhide--lbalhar',
 'source_json': {},
 'source_type': None,
 'ssh_public_keys': None,
 'storage': 0,
 'submitter': 'lbalhar',
 'tags': [],
 'task_id': '8753681-fedora-rawhide-x86_64',
 'timeout': 18000,
 'uses_devel_repo': False,
 'with_opts': [],
 'without_opts': []}

Running: git clone https://copr-dist-git.fedorainfracloud.org/git/lbalhar/python-attrs_rawhide/python-extractcode /var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode --depth 500 --no-single-branch --recursive

cmd: ['git', 'clone', 'https://copr-dist-git.fedorainfracloud.org/git/lbalhar/python-attrs_rawhide/python-extractcode', '/var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode', '--depth', '500', '--no-single-branch', '--recursive']
cwd: .
rc: 0
stdout: 
stderr: Cloning into '/var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode'...

Running: git checkout 62748717fc44de56347d64a8e3c7606f6879170f --

cmd: ['git', 'checkout', '62748717fc44de56347d64a8e3c7606f6879170f', '--']
cwd: /var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode
rc: 0
stdout: 
stderr: Note: switching to '62748717fc44de56347d64a8e3c7606f6879170f'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 6274871 automatic import of python-extractcode

Running: dist-git-client sources

cmd: ['dist-git-client', 'sources']
cwd: /var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode
rc: 0
stdout: 
stderr: INFO: Reading stdout from command: git rev-parse --abbrev-ref HEAD
INFO: Reading stdout from command: git rev-parse HEAD
INFO: Reading sources specification file: sources
INFO: Downloading extractcode-31.0.0.tar.gz
INFO: Reading stdout from command: curl --help all
INFO: Calling: curl -H Pragma: -o extractcode-31.0.0.tar.gz --location --connect-timeout 60 --retry 3 --retry-delay 10 --remote-time --show-error --fail --retry-all-errors https://copr-dist-git.fedorainfracloud.org/repo/pkgs/lbalhar/python-attrs_rawhide/python-extractcode/extractcode-31.0.0.tar.gz/md5/a1d9e1a8484b0c298433bc5e8b490b41/extractcode-31.0.0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
/usr/bin/tail: /var/lib/copr-rpmbuild/main.log: file truncated
100 10.7M  100 10.7M    0     0  15.0M      0 --:--:-- --:--:-- --:--:-- 15.0M
INFO: Reading stdout from command: md5sum extractcode-31.0.0.tar.gz

Running (timeout=18000): unbuffer mock --spec /var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode/python-extractcode.spec --sources /var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode --resultdir /var/lib/copr-rpmbuild/results --uniqueext 1741783375.735297 -r /var/lib/copr-rpmbuild/results/configs/child.cfg
INFO: mock.py version 6.1 starting (python version = 3.13.0, NVR = mock-6.1-1.fc41), args: /usr/libexec/mock/mock --spec /var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode/python-extractcode.spec --sources /var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode --resultdir /var/lib/copr-rpmbuild/results --uniqueext 1741783375.735297 -r /var/lib/copr-rpmbuild/results/configs/child.cfg
Start(bootstrap): init plugins
INFO: tmpfs initialized
INFO: selinux enabled
INFO: chroot_scan: initialized
INFO: compress_logs: initialized
Finish(bootstrap): init plugins
Start: init plugins
INFO: tmpfs initialized
INFO: selinux enabled
INFO: chroot_scan: initialized
INFO: compress_logs: initialized
Finish: init plugins
INFO: Signal handler active
Start: run
INFO: Start(/var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode/python-extractcode.spec)  Config(fedora-rawhide-x86_64)
Start: clean chroot
Finish: clean chroot
Mock Version: 6.1
INFO: Mock Version: 6.1
Start(bootstrap): chroot init
INFO: mounting tmpfs at /var/lib/mock/fedora-rawhide-x86_64-bootstrap-1741783375.735297/root.
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled package manager cache
Start(bootstrap): cleaning package manager metadata
Finish(bootstrap): cleaning package manager metadata
INFO: Guessed host environment type: unknown
INFO: Using container image: registry.fedoraproject.org/fedora:rawhide
INFO: Pulling image: registry.fedoraproject.org/fedora:rawhide
INFO: Tagging container image as mock-bootstrap-43613a28-9835-4ffd-a10d-17b83366a150
INFO: Checking that 7ffee05e4c079468022cd4c17d274753c82ae019510041790171a5dfb59284af image matches host's architecture
INFO: Copy content of container 7ffee05e4c079468022cd4c17d274753c82ae019510041790171a5dfb59284af to /var/lib/mock/fedora-rawhide-x86_64-bootstrap-1741783375.735297/root
INFO: mounting 7ffee05e4c079468022cd4c17d274753c82ae019510041790171a5dfb59284af with podman image mount
INFO: image 7ffee05e4c079468022cd4c17d274753c82ae019510041790171a5dfb59284af as /var/lib/containers/storage/overlay/6ac31c290ab8c43b34498753b5636c7001f47cb622b5e41520fa205ae6ca6d34/merged
INFO: umounting image 7ffee05e4c079468022cd4c17d274753c82ae019510041790171a5dfb59284af (/var/lib/containers/storage/overlay/6ac31c290ab8c43b34498753b5636c7001f47cb622b5e41520fa205ae6ca6d34/merged) with podman image umount
INFO: Removing image mock-bootstrap-43613a28-9835-4ffd-a10d-17b83366a150
INFO: Package manager dnf5 detected and used (fallback)
INFO: Not updating bootstrap chroot, bootstrap_image_ready=True
Start(bootstrap): creating root cache
Finish(bootstrap): creating root cache
Finish(bootstrap): chroot init
Start: chroot init
INFO: mounting tmpfs at /var/lib/mock/fedora-rawhide-x86_64-1741783375.735297/root.
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled package manager cache
Start: cleaning package manager metadata
Finish: cleaning package manager metadata
INFO: enabled HW Info plugin
INFO: Package manager dnf5 detected and used (direct choice)
INFO: Buildroot is handled by package management downloaded with a bootstrap image:
  rpm-4.20.1-1.fc43.x86_64
  rpm-sequoia-1.7.0-5.fc43.x86_64
  dnf5-5.2.11.0-1.fc43.x86_64
  dnf5-plugins-5.2.11.0-1.fc43.x86_64
Start: installing minimal buildroot with dnf5
Updating and loading repositories:
 fedora                                 100% |  11.2 MiB/s |  21.7 MiB |  00m02s
 Copr repository                        100% | 113.0 KiB/s |   7.2 KiB |  00m00s
Repositories loaded.
Package                            Arch   Version                    Repository      Size
Installing group/module packages:
 bash                              x86_64 5.2.37-3.fc43              fedora       8.2 MiB
 bzip2                             x86_64 1.0.8-20.fc42              fedora      99.3 KiB
 coreutils                         x86_64 9.6-2.fc43                 fedora       5.4 MiB
 cpio                              x86_64 2.15-2.fc41                fedora       1.1 MiB
 diffutils                         x86_64 3.10-9.fc42                fedora       1.6 MiB
 fedora-release-common             noarch 43-0.7                     fedora      20.3 KiB
 findutils                         x86_64 1:4.10.0-5.fc42            fedora       1.9 MiB
 gawk                              x86_64 5.3.1-1.fc42               fedora       1.7 MiB
 glibc-minimal-langpack            x86_64 2.41.9000-2.fc43           fedora       0.0   B
 grep                              x86_64 3.11-10.fc42               fedora       1.0 MiB
 gzip                              x86_64 1.13-3.fc42                fedora     392.9 KiB
 info                              x86_64 7.2-3.fc42                 fedora     357.9 KiB
 patch                             x86_64 2.7.6-26.fc42              fedora     258.7 KiB
 redhat-rpm-config                 noarch 342-2.fc42                 fedora     186.8 KiB
 rpm-build                         x86_64 4.20.1-1.fc43              fedora     168.7 KiB
 sed                               x86_64 4.9-4.fc42                 fedora     857.3 KiB
 shadow-utils                      x86_64 2:4.17.0-4.fc42            fedora       4.0 MiB
 tar                               x86_64 2:1.35-5.fc42              fedora       3.0 MiB
 unzip                             x86_64 6.0-66.fc42                fedora     390.3 KiB
 util-linux                        x86_64 2.40.4-7.fc43              fedora       3.4 MiB
 which                             x86_64 2.23-1.fc42                fedora      83.4 KiB
 xz                                x86_64 1:5.6.3-3.fc42             fedora       1.2 MiB
Installing dependencies:
 add-determinism                   x86_64 0.6.0-1.fc43               fedora       2.5 MiB
 alternatives                      x86_64 1.31-3.fc42                fedora      66.2 KiB
 ansible-srpm-macros               noarch 1-17.1.fc42                fedora      35.7 KiB
 audit-libs                        x86_64 4.0.3-2.fc42               fedora     351.3 KiB
 binutils                          x86_64 2.44-3.fc43                fedora      25.9 MiB
 build-reproducibility-srpm-macros noarch 0.6.0-1.fc43               fedora     735.0   B
 bzip2-libs                        x86_64 1.0.8-20.fc42              fedora      84.6 KiB
 ca-certificates                   noarch 2024.2.69_v8.0.401-5.fc42  fedora       2.6 MiB
 coreutils-common                  x86_64 9.6-2.fc43                 fedora      11.1 MiB
 crypto-policies                   noarch 20250305-1.gita35b0fa.fc43 fedora     136.4 KiB
 curl                              x86_64 8.13.0~rc1-1.fc43          fedora     461.0 KiB
 cyrus-sasl-lib                    x86_64 2.1.28-30.fc42             fedora       2.3 MiB
 debugedit                         x86_64 5.1-5.fc43                 fedora     192.7 KiB
 dwz                               x86_64 0.15-9.fc42                fedora     291.0 KiB
 ed                                x86_64 1.21-2.fc42                fedora     146.5 KiB
 efi-srpm-macros                   noarch 6-2.fc42                   fedora      40.1 KiB
 elfutils                          x86_64 0.192-8.fc42               fedora       2.7 MiB
 elfutils-debuginfod-client        x86_64 0.192-8.fc42               fedora      83.9 KiB
 elfutils-default-yama-scope       noarch 0.192-8.fc42               fedora       1.8 KiB
 elfutils-libelf                   x86_64 0.192-8.fc42               fedora       1.2 MiB
 elfutils-libs                     x86_64 0.192-8.fc42               fedora     675.0 KiB
 fedora-gpg-keys                   noarch 43-0.1                     fedora     128.2 KiB
 fedora-release                    noarch 43-0.7                     fedora       0.0   B
 fedora-release-identity-basic     noarch 43-0.7                     fedora     719.0   B
 fedora-repos                      noarch 43-0.1                     fedora       4.9 KiB
 fedora-repos-rawhide              noarch 43-0.1                     fedora       2.2 KiB
 file                              x86_64 5.46-1.fc42                fedora     100.2 KiB
 file-libs                         x86_64 5.46-1.fc42                fedora      11.9 MiB
 filesystem                        x86_64 3.18-38.fc43               fedora     112.0   B
 filesystem-srpm-macros            noarch 3.18-38.fc43               fedora      38.2 KiB
 fonts-srpm-macros                 noarch 1:2.0.5-21.fc42            fedora      55.8 KiB
 forge-srpm-macros                 noarch 0.4.0-2.fc42               fedora      38.9 KiB
 fpc-srpm-macros                   noarch 1.3-14.fc42                fedora     144.0   B
 gdb-minimal                       x86_64 16.2-1.fc43                fedora      13.3 MiB
 gdbm-libs                         x86_64 1:1.23-9.fc42              fedora     129.9 KiB
 ghc-srpm-macros                   noarch 1.9.2-2.fc42               fedora     779.0   B
 glibc                             x86_64 2.41.9000-2.fc43           fedora       6.7 MiB
 glibc-common                      x86_64 2.41.9000-2.fc43           fedora       1.0 MiB
 glibc-gconv-extra                 x86_64 2.41.9000-2.fc43           fedora       7.2 MiB
 gmp                               x86_64 1:6.3.0-3.fc43             fedora     819.2 KiB
 gnat-srpm-macros                  noarch 6-7.fc42                   fedora       1.0 KiB
 go-srpm-macros                    noarch 3.6.0-6.fc42               fedora      60.8 KiB
 jansson                           x86_64 2.14-2.fc42                fedora      93.1 KiB
 json-c                            x86_64 0.18-2.fc42                fedora      86.7 KiB
 kernel-srpm-macros                noarch 1.0-25.fc42                fedora       1.9 KiB
 keyutils-libs                     x86_64 1.6.3-5.fc42               fedora      58.3 KiB
 krb5-libs                         x86_64 1.21.3-5.fc42              fedora       2.3 MiB
 libacl                            x86_64 2.3.2-3.fc42               fedora      38.3 KiB
 libarchive                        x86_64 3.7.7-3.fc43               fedora     930.6 KiB
 libattr                           x86_64 2.5.2-5.fc42               fedora      27.1 KiB
 libblkid                          x86_64 2.40.4-7.fc43              fedora     262.4 KiB
 libbrotli                         x86_64 1.1.0-6.fc42               fedora     841.3 KiB
 libcap                            x86_64 2.73-2.fc42                fedora     207.1 KiB
 libcap-ng                         x86_64 0.8.5-4.fc42               fedora      72.9 KiB
 libcom_err                        x86_64 1.47.2-3.fc42              fedora      67.1 KiB
 libcurl                           x86_64 8.13.0~rc1-1.fc43          fedora     862.4 KiB
 libeconf                          x86_64 0.7.6-1.fc43               fedora      64.6 KiB
 libevent                          x86_64 2.1.12-15.fc42             fedora     903.1 KiB
 libfdisk                          x86_64 2.40.4-7.fc43              fedora     372.3 KiB
 libffi                            x86_64 3.4.7-2.fc43               fedora      82.6 KiB
 libgcc                            x86_64 15.0.1-0.9.fc43            fedora     266.6 KiB
 libgomp                           x86_64 15.0.1-0.9.fc43            fedora     535.9 KiB
 libidn2                           x86_64 2.3.8-1.fc43               fedora     552.5 KiB
 libmount                          x86_64 2.40.4-7.fc43              fedora     356.2 KiB
 libnghttp2                        x86_64 1.65.0-1.fc43              fedora     162.2 KiB
 libpkgconf                        x86_64 2.3.0-2.fc42               fedora      78.1 KiB
 libpsl                            x86_64 0.21.5-5.fc42              fedora      76.4 KiB
 libselinux                        x86_64 3.8-1.fc42                 fedora     193.1 KiB
 libsemanage                       x86_64 3.8-1.fc42                 fedora     308.4 KiB
 libsepol                          x86_64 3.8-1.fc42                 fedora     826.0 KiB
 libsmartcols                      x86_64 2.40.4-7.fc43              fedora     180.4 KiB
 libssh                            x86_64 0.11.1-4.fc42              fedora     565.5 KiB
 libssh-config                     noarch 0.11.1-4.fc42              fedora     277.0   B
 libstdc++                         x86_64 15.0.1-0.9.fc43            fedora       2.8 MiB
 libtasn1                          x86_64 4.20.0-1.fc43              fedora     176.3 KiB
 libtool-ltdl                      x86_64 2.5.4-4.fc42               fedora      70.1 KiB
 libunistring                      x86_64 1.1-9.fc42                 fedora       1.7 MiB
 libuuid                           x86_64 2.40.4-7.fc43              fedora      37.3 KiB
 libverto                          x86_64 0.3.2-10.fc42              fedora      25.4 KiB
 libxcrypt                         x86_64 4.4.38-6.fc43              fedora     284.5 KiB
 libxml2                           x86_64 2.12.9-2.fc42              fedora       1.7 MiB
 libzstd                           x86_64 1.5.7-1.fc43               fedora     807.8 KiB
 lua-libs                          x86_64 5.4.7-3.fc43               fedora     276.9 KiB
 lua-srpm-macros                   noarch 1-15.fc42                  fedora       1.3 KiB
 lz4-libs                          x86_64 1.10.0-2.fc42              fedora     157.4 KiB
 mpfr                              x86_64 4.2.1-6.fc42               fedora     831.9 KiB
 ncurses-base                      noarch 6.5-5.20250125.fc42        fedora     326.8 KiB
 ncurses-libs                      x86_64 6.5-5.20250125.fc42        fedora     946.3 KiB
 ocaml-srpm-macros                 noarch 10-4.fc42                  fedora       1.9 KiB
 openblas-srpm-macros              noarch 2-19.fc42                  fedora     112.0   B
 openldap                          x86_64 2.6.9-3.fc42               fedora     655.1 KiB
 openssl-libs                      x86_64 1:3.2.4-2.fc43             fedora       7.8 MiB
 p11-kit                           x86_64 0.25.5-5.fc42              fedora       2.2 MiB
 p11-kit-trust                     x86_64 0.25.5-5.fc42              fedora     395.5 KiB
 package-notes-srpm-macros         noarch 0.5-13.fc42                fedora       1.6 KiB
 pam-libs                          x86_64 1.7.0-4.fc42               fedora     126.7 KiB
 pcre2                             x86_64 10.45-1.fc43               fedora     697.7 KiB
 pcre2-syntax                      noarch 10.45-1.fc43               fedora     273.9 KiB
 perl-srpm-macros                  noarch 1-57.fc42                  fedora     861.0   B
 pkgconf                           x86_64 2.3.0-2.fc42               fedora      88.5 KiB
 pkgconf-m4                        noarch 2.3.0-2.fc42               fedora      14.4 KiB
 pkgconf-pkg-config                x86_64 2.3.0-2.fc42               fedora     989.0   B
 popt                              x86_64 1.19-8.fc42                fedora     132.8 KiB
 publicsuffix-list-dafsa           noarch 20250116-1.fc42            fedora      68.5 KiB
 pyproject-srpm-macros             noarch 1.17.0-1.fc43              fedora       1.9 KiB
 python-srpm-macros                noarch 3.13-4.fc42                fedora      51.0 KiB
 qt5-srpm-macros                   noarch 5.15.15-1.fc42             fedora     500.0   B
 qt6-srpm-macros                   noarch 6.8.2-2.fc43               fedora     464.0   B
 readline                          x86_64 8.2-13.fc43                fedora     485.0 KiB
 rpm                               x86_64 4.20.1-1.fc43              fedora       3.1 MiB
 rpm-build-libs                    x86_64 4.20.1-1.fc43              fedora     206.6 KiB
 rpm-libs                          x86_64 4.20.1-1.fc43              fedora     721.8 KiB
 rpm-sequoia                       x86_64 1.7.0-5.fc43               fedora       2.4 MiB
 rust-srpm-macros                  noarch 26.3-4.fc42                fedora       4.8 KiB
 setup                             noarch 2.15.0-14.fc43             fedora     720.9 KiB
 sqlite-libs                       x86_64 3.49.0-1.fc43              fedora       1.5 MiB
 systemd-libs                      x86_64 257.4-3.fc43               fedora       2.2 MiB
 systemd-standalone-sysusers       x86_64 257.4-3.fc43               fedora     273.3 KiB
 tree-sitter-srpm-macros           noarch 0.2.0-1.fc43               fedora       6.9 KiB
 util-linux-core                   x86_64 2.40.4-7.fc43              fedora       1.4 MiB
 xxhash-libs                       x86_64 0.8.3-2.fc42               fedora      90.2 KiB
 xz-libs                           x86_64 1:5.6.3-3.fc42             fedora     218.3 KiB
 zig-srpm-macros                   noarch 1-4.fc42                   fedora       1.1 KiB
 zip                               x86_64 3.0-43.fc42                fedora     698.5 KiB
 zlib-ng-compat                    x86_64 2.2.4-2.fc43               fedora     137.6 KiB
 zstd                              x86_64 1.5.7-1.fc43               fedora       1.7 MiB
Installing groups:
 Buildsystem building group                                                              

Transaction Summary:
 Installing:       148 packages

Total size of inbound packages is 52 MiB. Need to download 52 MiB.
After this operation, 177 MiB extra will be used (install 177 MiB, remove 0 B).
[  1/148] bzip2-0:1.0.8-20.fc42.x86_64  100% | 327.5 KiB/s |  52.1 KiB |  00m00s
[  2/148] coreutils-0:9.6-2.fc43.x86_64 100% |   3.8 MiB/s |   1.1 MiB |  00m00s
[  3/148] bash-0:5.2.37-3.fc43.x86_64   100% |   5.8 MiB/s |   1.8 MiB |  00m00s
[  4/148] cpio-0:2.15-2.fc41.x86_64     100% |   1.9 MiB/s | 291.8 KiB |  00m00s
[  5/148] fedora-release-common-0:43-0. 100% | 395.8 KiB/s |  25.7 KiB |  00m00s
[  6/148] diffutils-0:3.10-9.fc42.x86_6 100% |   3.6 MiB/s | 404.6 KiB |  00m00s
[  7/148] findutils-1:4.10.0-5.fc42.x86 100% |   5.7 MiB/s | 551.5 KiB |  00m00s
[  8/148] glibc-minimal-langpack-0:2.41 100% |   2.8 MiB/s | 127.9 KiB |  00m00s
[  9/148] grep-0:3.11-10.fc42.x86_64    100% |   5.6 MiB/s | 300.1 KiB |  00m00s
[ 10/148] info-0:7.2-3.fc42.x86_64      100% |   4.2 MiB/s | 183.8 KiB |  00m00s
[ 11/148] gzip-0:1.13-3.fc42.x86_64     100% |   2.8 MiB/s | 170.4 KiB |  00m00s
[ 12/148] patch-0:2.7.6-26.fc42.x86_64  100% |   3.0 MiB/s | 128.4 KiB |  00m00s
[ 13/148] redhat-rpm-config-0:342-2.fc4 100% |   1.9 MiB/s |  81.6 KiB |  00m00s
[ 14/148] rpm-build-0:4.20.1-1.fc43.x86 100% |   1.9 MiB/s |  81.8 KiB |  00m00s
[ 15/148] shadow-utils-2:4.17.0-4.fc42. 100% |  10.9 MiB/s |   1.3 MiB |  00m00s
[ 16/148] sed-0:4.9-4.fc42.x86_64       100% |   2.3 MiB/s | 317.3 KiB |  00m00s
[ 17/148] tar-2:1.35-5.fc42.x86_64      100% |   6.1 MiB/s | 862.5 KiB |  00m00s
[ 18/148] which-0:2.23-1.fc42.x86_64    100% |   1.0 MiB/s |  41.7 KiB |  00m00s
[ 19/148] unzip-0:6.0-66.fc42.x86_64    100% |   3.0 MiB/s | 184.6 KiB |  00m00s
[ 20/148] xz-1:5.6.3-3.fc42.x86_64      100% |   5.7 MiB/s | 474.9 KiB |  00m00s
[ 21/148] util-linux-0:2.40.4-7.fc43.x8 100% |  10.7 MiB/s |   1.2 MiB |  00m00s
[ 22/148] filesystem-0:3.18-38.fc43.x86 100% |   8.3 MiB/s |   1.3 MiB |  00m00s
[ 23/148] ncurses-libs-0:6.5-5.20250125 100% |   4.7 MiB/s | 335.0 KiB |  00m00s
[ 24/148] glibc-0:2.41.9000-2.fc43.x86_ 100% |  12.7 MiB/s |   2.3 MiB |  00m00s
[ 25/148] bzip2-libs-0:1.0.8-20.fc42.x8 100% |   1.1 MiB/s |  43.6 KiB |  00m00s
[ 26/148] gawk-0:5.3.1-1.fc42.x86_64    100% |   3.1 MiB/s |   1.1 MiB |  00m00s
[ 27/148] libacl-0:2.3.2-3.fc42.x86_64  100% | 575.2 KiB/s |  23.0 KiB |  00m00s
[ 28/148] libattr-0:2.5.2-5.fc42.x86_64 100% | 449.6 KiB/s |  17.1 KiB |  00m00s
[ 29/148] gmp-1:6.3.0-3.fc43.x86_64     100% |   2.8 MiB/s | 322.2 KiB |  00m00s
[ 30/148] libselinux-0:3.8-1.fc42.x86_6 100% |   2.3 MiB/s |  97.1 KiB |  00m00s
[ 31/148] libcap-0:2.73-2.fc42.x86_64   100% |   1.4 MiB/s |  84.3 KiB |  00m00s
[ 32/148] coreutils-common-0:9.6-2.fc43 100% |  10.3 MiB/s |   2.1 MiB |  00m00s
[ 33/148] fedora-repos-0:43-0.1.noarch  100% | 244.0 KiB/s |   9.3 KiB |  00m00s
[ 34/148] systemd-libs-0:257.4-3.fc43.x 100% |   9.9 MiB/s | 804.5 KiB |  00m00s
[ 35/148] glibc-common-0:2.41.9000-2.fc 100% |   7.0 MiB/s | 415.0 KiB |  00m00s
[ 36/148] pcre2-0:10.45-1.fc43.x86_64   100% |   4.3 MiB/s | 262.8 KiB |  00m00s
[ 37/148] ed-0:1.21-2.fc42.x86_64       100% |   2.0 MiB/s |  82.0 KiB |  00m00s
[ 38/148] ansible-srpm-macros-0:1-17.1. 100% | 495.5 KiB/s |  20.3 KiB |  00m00s
[ 39/148] build-reproducibility-srpm-ma 100% | 238.4 KiB/s |  11.7 KiB |  00m00s
[ 40/148] dwz-0:0.15-9.fc42.x86_64      100% |   2.5 MiB/s | 135.7 KiB |  00m00s
[ 41/148] efi-srpm-macros-0:6-2.fc42.no 100% | 433.0 KiB/s |  22.5 KiB |  00m00s
[ 42/148] file-0:5.46-1.fc42.x86_64     100% |   1.1 MiB/s |  48.7 KiB |  00m00s
[ 43/148] filesystem-srpm-macros-0:3.18 100% | 671.7 KiB/s |  25.5 KiB |  00m00s
[ 44/148] fonts-srpm-macros-1:2.0.5-21. 100% | 645.1 KiB/s |  27.1 KiB |  00m00s
[ 45/148] forge-srpm-macros-0:0.4.0-2.f 100% | 472.6 KiB/s |  19.9 KiB |  00m00s
[ 46/148] fpc-srpm-macros-0:1.3-14.fc42 100% | 195.6 KiB/s |   8.0 KiB |  00m00s
[ 47/148] ghc-srpm-macros-0:1.9.2-2.fc4 100% | 176.1 KiB/s |   9.2 KiB |  00m00s
[ 48/148] gnat-srpm-macros-0:6-7.fc42.n 100% | 162.5 KiB/s |   8.6 KiB |  00m00s
[ 49/148] go-srpm-macros-0:3.6.0-6.fc42 100% | 576.2 KiB/s |  27.7 KiB |  00m00s
[ 50/148] kernel-srpm-macros-0:1.0-25.f 100% | 235.0 KiB/s |   9.9 KiB |  00m00s
[ 51/148] lua-srpm-macros-0:1-15.fc42.n 100% | 234.7 KiB/s |   8.9 KiB |  00m00s
[ 52/148] ocaml-srpm-macros-0:10-4.fc42 100% | 242.2 KiB/s |   9.2 KiB |  00m00s
[ 53/148] openblas-srpm-macros-0:2-19.f 100% | 204.4 KiB/s |   7.8 KiB |  00m00s
[ 54/148] openssl-libs-1:3.2.4-2.fc43.x 100% |   4.4 MiB/s |   2.3 MiB |  00m01s
[ 55/148] package-notes-srpm-macros-0:0 100% | 243.7 KiB/s |   9.3 KiB |  00m00s
[ 56/148] perl-srpm-macros-0:1-57.fc42. 100% | 212.6 KiB/s |   8.5 KiB |  00m00s
[ 57/148] pyproject-srpm-macros-0:1.17. 100% | 367.9 KiB/s |  14.0 KiB |  00m00s
[ 58/148] python-srpm-macros-0:3.13-4.f 100% | 534.3 KiB/s |  23.0 KiB |  00m00s
[ 59/148] qt5-srpm-macros-0:5.15.15-1.f 100% | 197.7 KiB/s |   8.9 KiB |  00m00s
[ 60/148] qt6-srpm-macros-0:6.8.2-2.fc4 100% | 216.3 KiB/s |   9.3 KiB |  00m00s
[ 61/148] rpm-0:4.20.1-1.fc43.x86_64    100% |   8.4 MiB/s | 543.7 KiB |  00m00s
[ 62/148] rust-srpm-macros-0:26.3-4.fc4 100% | 266.0 KiB/s |  11.7 KiB |  00m00s
[ 63/148] tree-sitter-srpm-macros-0:0.2 100% | 297.4 KiB/s |  11.9 KiB |  00m00s
[ 64/148] zig-srpm-macros-0:1-4.fc42.no 100% | 206.1 KiB/s |   8.2 KiB |  00m00s
[ 65/148] zip-0:3.0-43.fc42.x86_64      100% |   5.4 MiB/s | 263.5 KiB |  00m00s
[ 66/148] debugedit-0:5.1-5.fc43.x86_64 100% |   1.6 MiB/s |  78.6 KiB |  00m00s
[ 67/148] elfutils-libelf-0:0.192-8.fc4 100% |   2.8 MiB/s | 208.1 KiB |  00m00s
[ 68/148] libarchive-0:3.7.7-3.fc43.x86 100% |   3.9 MiB/s | 411.6 KiB |  00m00s
[ 69/148] popt-0:1.19-8.fc42.x86_64     100% |   1.3 MiB/s |  66.0 KiB |  00m00s
[ 70/148] readline-0:8.2-13.fc43.x86_64 100% |   3.9 MiB/s | 212.9 KiB |  00m00s
[ 71/148] elfutils-0:0.192-8.fc42.x86_6 100% |   2.7 MiB/s | 551.0 KiB |  00m00s
[ 72/148] rpm-build-libs-0:4.20.1-1.fc4 100% |   1.5 MiB/s |  99.7 KiB |  00m00s
[ 73/148] audit-libs-0:4.0.3-2.fc42.x86 100% |   1.7 MiB/s | 125.3 KiB |  00m00s
[ 74/148] zstd-0:1.5.7-1.fc43.x86_64    100% |   4.5 MiB/s | 485.8 KiB |  00m00s
[ 75/148] rpm-libs-0:4.20.1-1.fc43.x86_ 100% |   2.1 MiB/s | 312.2 KiB |  00m00s
[ 76/148] libeconf-0:0.7.6-1.fc43.x86_6 100% | 557.9 KiB/s |  35.2 KiB |  00m00s
[ 77/148] libxcrypt-0:4.4.38-6.fc43.x86 100% |   3.1 MiB/s | 127.3 KiB |  00m00s
[ 78/148] libsemanage-0:3.8-1.fc42.x86_ 100% |   1.9 MiB/s | 123.6 KiB |  00m00s
[ 79/148] pam-libs-0:1.7.0-4.fc42.x86_6 100% |   1.4 MiB/s |  58.3 KiB |  00m00s
[ 80/148] xz-libs-1:5.6.3-3.fc42.x86_64 100% |   2.8 MiB/s | 113.4 KiB |  00m00s
[ 81/148] setup-0:2.15.0-14.fc43.noarch 100% |   2.6 MiB/s | 156.0 KiB |  00m00s
[ 82/148] mpfr-0:4.2.1-6.fc42.x86_64    100% |   5.2 MiB/s | 348.5 KiB |  00m00s
[ 83/148] libcap-ng-0:0.8.5-4.fc42.x86_ 100% | 765.9 KiB/s |  32.2 KiB |  00m00s
[ 84/148] libblkid-0:2.40.4-7.fc43.x86_ 100% |   2.1 MiB/s | 122.5 KiB |  00m00s
[ 85/148] libfdisk-0:2.40.4-7.fc43.x86_ 100% |   3.7 MiB/s | 158.2 KiB |  00m00s
[ 86/148] libsmartcols-0:2.40.4-7.fc43. 100% |   1.9 MiB/s |  81.2 KiB |  00m00s
[ 87/148] libmount-0:2.40.4-7.fc43.x86_ 100% |   2.7 MiB/s | 155.0 KiB |  00m00s
[ 88/148] libuuid-0:2.40.4-7.fc43.x86_6 100% | 603.2 KiB/s |  25.3 KiB |  00m00s
[ 89/148] zlib-ng-compat-0:2.2.4-2.fc43 100% |   1.9 MiB/s |  79.1 KiB |  00m00s
[ 90/148] libgcc-0:15.0.1-0.9.fc43.x86_ 100% |   2.9 MiB/s | 117.9 KiB |  00m00s
[ 91/148] util-linux-core-0:2.40.4-7.fc 100% |   4.6 MiB/s | 529.5 KiB |  00m00s
[ 92/148] ncurses-base-0:6.5-5.20250125 100% |   2.1 MiB/s |  88.1 KiB |  00m00s
[ 93/148] glibc-gconv-extra-0:2.41.9000 100% |  10.4 MiB/s |   1.7 MiB |  00m00s
[ 94/148] libsepol-0:3.8-1.fc42.x86_64  100% |   3.7 MiB/s | 348.9 KiB |  00m00s
[ 95/148] ca-certificates-0:2024.2.69_v 100% |  11.1 MiB/s | 945.0 KiB |  00m00s
[ 96/148] crypto-policies-0:20250305-1. 100% |   2.2 MiB/s |  95.8 KiB |  00m00s
[ 97/148] fedora-repos-rawhide-0:43-0.1 100% | 215.7 KiB/s |   8.8 KiB |  00m00s
[ 98/148] fedora-gpg-keys-0:43-0.1.noar 100% |   2.3 MiB/s | 135.6 KiB |  00m00s
[ 99/148] pcre2-syntax-0:10.45-1.fc43.n 100% |   3.4 MiB/s | 161.7 KiB |  00m00s
[100/148] curl-0:8.13.0~rc1-1.fc43.x86_ 100% |   4.1 MiB/s | 227.8 KiB |  00m00s
[101/148] file-libs-0:5.46-1.fc42.x86_6 100% |   9.8 MiB/s | 849.4 KiB |  00m00s
[102/148] elfutils-libs-0:0.192-8.fc42. 100% |   5.5 MiB/s | 265.9 KiB |  00m00s
[103/148] elfutils-debuginfod-client-0: 100% |   1.1 MiB/s |  46.5 KiB |  00m00s
[104/148] add-determinism-0:0.6.0-1.fc4 100% |   5.2 MiB/s | 918.3 KiB |  00m00s
[105/148] libzstd-0:1.5.7-1.fc43.x86_64 100% |   5.2 MiB/s | 314.8 KiB |  00m00s
[106/148] libstdc++-0:15.0.1-0.9.fc43.x 100% |  10.6 MiB/s | 887.6 KiB |  00m00s
[107/148] lz4-libs-0:1.10.0-2.fc42.x86_ 100% |   1.9 MiB/s |  78.1 KiB |  00m00s
[108/148] libgomp-0:15.0.1-0.9.fc43.x86 100% |   5.7 MiB/s | 350.0 KiB |  00m00s
[109/148] lua-libs-0:5.4.7-3.fc43.x86_6 100% |   3.0 MiB/s | 130.4 KiB |  00m00s
[110/148] libxml2-0:2.12.9-2.fc42.x86_6 100% |   5.2 MiB/s | 696.0 KiB |  00m00s
[111/148] rpm-sequoia-0:1.7.0-5.fc43.x8 100% |  10.7 MiB/s | 911.1 KiB |  00m00s
[112/148] elfutils-default-yama-scope-0 100% | 286.3 KiB/s |  12.6 KiB |  00m00s
[113/148] sqlite-libs-0:3.49.0-1.fc43.x 100% |   8.1 MiB/s | 766.3 KiB |  00m00s
[114/148] json-c-0:0.18-2.fc42.x86_64   100% |   1.1 MiB/s |  44.9 KiB |  00m00s
[115/148] alternatives-0:1.31-3.fc42.x8 100% |   1.0 MiB/s |  40.9 KiB |  00m00s
[116/148] jansson-0:2.14-2.fc42.x86_64  100% |   1.1 MiB/s |  45.7 KiB |  00m00s
[117/148] pkgconf-pkg-config-0:2.3.0-2. 100% | 248.1 KiB/s |   9.9 KiB |  00m00s
[118/148] pkgconf-0:2.3.0-2.fc42.x86_64 100% |   1.1 MiB/s |  44.9 KiB |  00m00s
[119/148] pkgconf-m4-0:2.3.0-2.fc42.noa 100% | 347.2 KiB/s |  14.2 KiB |  00m00s
[120/148] libpkgconf-0:2.3.0-2.fc42.x86 100% | 913.5 KiB/s |  38.4 KiB |  00m00s
[121/148] libffi-0:3.4.7-2.fc43.x86_64  100% | 976.3 KiB/s |  40.0 KiB |  00m00s
[122/148] libtasn1-0:4.20.0-1.fc43.x86_ 100% |   1.8 MiB/s |  75.0 KiB |  00m00s
[123/148] p11-kit-0:0.25.5-5.fc42.x86_6 100% |   7.4 MiB/s | 491.7 KiB |  00m00s
[124/148] fedora-release-0:43-0.7.noarc 100% | 377.9 KiB/s |  14.7 KiB |  00m00s
[125/148] p11-kit-trust-0:0.25.5-5.fc42 100% |   2.3 MiB/s | 132.6 KiB |  00m00s
[126/148] systemd-standalone-sysusers-0 100% |   2.6 MiB/s | 155.4 KiB |  00m00s
[127/148] binutils-0:2.44-3.fc43.x86_64 100% |  16.9 MiB/s |   5.8 MiB |  00m00s
[128/148] xxhash-libs-0:0.8.3-2.fc42.x8 100% |   1.0 MiB/s |  39.1 KiB |  00m00s
[129/148] fedora-release-identity-basic 100% | 398.6 KiB/s |  15.5 KiB |  00m00s
[130/148] libcurl-0:8.13.0~rc1-1.fc43.x 100% |   4.5 MiB/s | 381.9 KiB |  00m00s
[131/148] krb5-libs-0:1.21.3-5.fc42.x86 100% |  10.1 MiB/s | 764.7 KiB |  00m00s
[132/148] libidn2-0:2.3.8-1.fc43.x86_64 100% |   4.3 MiB/s | 174.8 KiB |  00m00s
[133/148] libbrotli-0:1.1.0-6.fc42.x86_ 100% |   4.3 MiB/s | 339.8 KiB |  00m00s
[134/148] libnghttp2-0:1.65.0-1.fc43.x8 100% |   1.8 MiB/s |  72.6 KiB |  00m00s
[135/148] libpsl-0:0.21.5-5.fc42.x86_64 100% |   1.5 MiB/s |  64.0 KiB |  00m00s
[136/148] libssh-0:0.11.1-4.fc42.x86_64 100% |   4.7 MiB/s | 233.3 KiB |  00m00s
[137/148] keyutils-libs-0:1.6.3-5.fc42. 100% | 829.8 KiB/s |  31.5 KiB |  00m00s
[138/148] openldap-0:2.6.9-3.fc42.x86_6 100% |   4.4 MiB/s | 260.2 KiB |  00m00s
[139/148] gdb-minimal-0:16.2-1.fc43.x86 100% |  12.2 MiB/s |   4.4 MiB |  00m00s
[140/148] libcom_err-0:1.47.2-3.fc42.x8 100% | 690.5 KiB/s |  26.9 KiB |  00m00s
[141/148] libverto-0:0.3.2-10.fc42.x86_ 100% | 547.4 KiB/s |  20.8 KiB |  00m00s
[142/148] publicsuffix-list-dafsa-0:202 100% |   1.5 MiB/s |  58.8 KiB |  00m00s
[143/148] libssh-config-0:0.11.1-4.fc42 100% | 230.8 KiB/s |   9.0 KiB |  00m00s
[144/148] libevent-0:2.1.12-15.fc42.x86 100% |   5.8 MiB/s | 260.2 KiB |  00m00s
[145/148] libunistring-0:1.1-9.fc42.x86 100% |   4.9 MiB/s | 542.5 KiB |  00m00s
[146/148] cyrus-sasl-lib-0:2.1.28-30.fc 100% |  10.2 MiB/s | 793.5 KiB |  00m00s
[147/148] libtool-ltdl-0:2.5.4-4.fc42.x 100% | 841.2 KiB/s |  36.2 KiB |  00m00s
[148/148] gdbm-libs-1:1.23-9.fc42.x86_6 100% |   1.4 MiB/s |  57.0 KiB |  00m00s
--------------------------------------------------------------------------------
[148/148] Total                         100% |  13.8 MiB/s |  52.3 MiB |  00m04s
Running transaction
Importing OpenPGP key 0x31645531:
 UserID     : "Fedora (43) <fedora-43-primary@fedoraproject.org>"
 Fingerprint: C6E7F081CF80E13146676E88829B606631645531
 From       : file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-43-primary
The key was successfully imported.
Importing OpenPGP key 0x105EF944:
 UserID     : "Fedora (42) <fedora-42-primary@fedoraproject.org>"
 Fingerprint: B0F4950458F69E1150C6C5EDC8AC4916105EF944
 From       : file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-42-primary
The key was successfully imported.
Importing OpenPGP key 0x6D9F90A6:
 UserID     : "Fedora (44) <fedora-44-primary@fedoraproject.org>"
 Fingerprint: 36F612DCF27F7D1A48A835E4DBFCF71C6D9F90A6
 From       : file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-44-primary
The key was successfully imported.
[  1/150] Verify package files          100% | 616.0   B/s | 148.0   B |  00m00s
[  2/150] Prepare transaction           100% |   1.2 KiB/s | 148.0   B |  00m00s
[  3/150] Installing libgcc-0:15.0.1-0. 100% |  65.5 MiB/s | 268.3 KiB |  00m00s
[  4/150] Installing libssh-config-0:0. 100% | 796.9 KiB/s | 816.0   B |  00m00s
[  5/150] Installing publicsuffix-list- 100% |  33.8 MiB/s |  69.2 KiB |  00m00s
[  6/150] Installing fedora-release-ide 100% | 953.1 KiB/s | 976.0   B |  00m00s
[  7/150] Installing fedora-repos-rawhi 100% |   2.4 MiB/s |   2.4 KiB |  00m00s
[  8/150] Installing fedora-gpg-keys-0: 100% |  17.1 MiB/s | 174.8 KiB |  00m00s
[  9/150] Installing fedora-repos-0:43- 100% |   5.6 MiB/s |   5.7 KiB |  00m00s
[ 10/150] Installing fedora-release-com 100% |  12.0 MiB/s |  24.6 KiB |  00m00s
[ 11/150] Installing fedora-release-0:4 100% |   4.8 KiB/s | 124.0   B |  00m00s
>>> Running unknown scriptlet: setup-0:2.15.0-14.fc43.noarch                    
>>> Finished unknown scriptlet: setup-0:2.15.0-14.fc43.noarch                   
>>> Scriptlet output:                                                           
>>> Creating group 'adm' with GID 4.                                            
>>> Creating group 'audio' with GID 63.                                         
>>> Creating group 'bin' with GID 1.                                            
>>> Creating group 'cdrom' with GID 11.                                         
>>> Creating group 'clock' with GID 103.                                        
>>> Creating group 'daemon' with GID 2.                                         
>>> Creating group 'dialout' with GID 18.                                       
>>> Creating group 'disk' with GID 6.                                           
>>> Creating group 'floppy' with GID 19.                                        
>>> Creating group 'ftp' with GID 50.                                           
>>> Creating group 'games' with GID 20.                                         
>>> Creating group 'input' with GID 104.                                        
>>> Creating group 'kmem' with GID 9.                                           
>>> Creating group 'kvm' with GID 36.                                           
>>> Creating group 'lock' with GID 54.                                          
>>> Creating group 'lp' with GID 7.                                             
>>> Creating group 'mail' with GID 12.                                          
>>> Creating group 'man' with GID 15.                                           
>>> Creating group 'mem' with GID 8.                                            
>>> Creating group 'nobody' with GID 65534.                                     
>>> Creating group 'render' with GID 105.                                       
>>> Creating group 'root' with GID 0.                                           
>>> Creating group 'sgx' with GID 106.                                          
>>> Creating group 'sys' with GID 3.                                            
>>> Creating group 'tape' with GID 33.                                          
>>> Creating group 'tty' with GID 5.                                            
>>> Creating group 'users' with GID 100.                                        
>>> Creating group 'utmp' with GID 22.                                          
>>> Creating group 'video' with GID 39.                                         
>>> Creating group 'wheel' with GID 10.                                         
>>>                                                                             
>>> Running unknown scriptlet: setup-0:2.15.0-14.fc43.noarch                    
>>> Finished unknown scriptlet: setup-0:2.15.0-14.fc43.noarch                   
>>> Scriptlet output:                                                           
>>> Creating user 'adm' (adm) with UID 3 and GID 4.                             
>>> Creating user 'bin' (bin) with UID 1 and GID 1.                             
>>> Creating user 'daemon' (daemon) with UID 2 and GID 2.                       
>>> Creating user 'ftp' (FTP User) with UID 14 and GID 50.                      
>>> Creating user 'games' (games) with UID 12 and GID 20.                       
>>> Creating user 'halt' (halt) with UID 7 and GID 0.                           
>>> Creating user 'lp' (lp) with UID 4 and GID 7.                               
>>> Creating user 'mail' (mail) with UID 8 and GID 12.                          
>>> Creating user 'nobody' (Kernel Overflow User) with UID 65534 and GID 65534. 
>>> Creating user 'operator' (operator) with UID 11 and GID 0.                  
>>> Creating user 'root' (Super User) with UID 0 and GID 0.                     
>>> Creating user 'shutdown' (shutdown) with UID 6 and GID 0.                   
>>> Creating user 'sync' (sync) with UID 5 and GID 0.                           
>>>                                                                             
[ 12/150] Installing setup-0:2.15.0-14. 100% |  32.3 MiB/s | 726.7 KiB |  00m00s
>>> [RPM] /etc/hosts created as /etc/hosts.rpmnew                               
[ 13/150] Installing filesystem-0:3.18- 100% |   1.3 MiB/s | 212.4 KiB |  00m00s
[ 14/150] Installing pkgconf-m4-0:2.3.0 100% |  14.5 MiB/s |  14.8 KiB |  00m00s
[ 15/150] Installing pcre2-syntax-0:10. 100% | 135.0 MiB/s | 276.4 KiB |  00m00s
[ 16/150] Installing ncurses-base-0:6.5 100% |  34.4 MiB/s | 352.2 KiB |  00m00s
[ 17/150] Installing glibc-minimal-lang 100% | 121.1 KiB/s | 124.0   B |  00m00s
[ 18/150] Installing ncurses-libs-0:6.5 100% | 132.9 MiB/s | 952.8 KiB |  00m00s
[ 19/150] Installing glibc-0:2.41.9000- 100% | 138.8 MiB/s |   6.7 MiB |  00m00s
[ 20/150] Installing bash-0:5.2.37-3.fc 100% | 177.8 MiB/s |   8.2 MiB |  00m00s
[ 21/150] Installing glibc-common-0:2.4 100% |  44.4 MiB/s |   1.0 MiB |  00m00s
[ 22/150] Installing glibc-gconv-extra- 100% | 130.6 MiB/s |   7.3 MiB |  00m00s
[ 23/150] Installing zlib-ng-compat-0:2 100% | 135.2 MiB/s | 138.4 KiB |  00m00s
[ 24/150] Installing bzip2-libs-0:1.0.8 100% |  83.7 MiB/s |  85.7 KiB |  00m00s
[ 25/150] Installing xz-libs-1:5.6.3-3. 100% | 107.1 MiB/s | 219.4 KiB |  00m00s
[ 26/150] Installing libuuid-0:2.40.4-7 100% |  37.5 MiB/s |  38.4 KiB |  00m00s
[ 27/150] Installing libblkid-0:2.40.4- 100% | 128.6 MiB/s | 263.4 KiB |  00m00s
[ 28/150] Installing gmp-1:6.3.0-3.fc43 100% | 200.6 MiB/s | 821.5 KiB |  00m00s
[ 29/150] Installing popt-0:1.19-8.fc42 100% |  27.2 MiB/s | 139.4 KiB |  00m00s
[ 30/150] Installing readline-0:8.2-13. 100% | 158.6 MiB/s | 487.1 KiB |  00m00s
[ 31/150] Installing libxcrypt-0:4.4.38 100% |  93.5 MiB/s | 287.2 KiB |  00m00s
[ 32/150] Installing libstdc++-0:15.0.1 100% | 234.0 MiB/s |   2.8 MiB |  00m00s
[ 33/150] Installing libzstd-0:1.5.7-1. 100% | 197.5 MiB/s | 809.1 KiB |  00m00s
[ 34/150] Installing elfutils-libelf-0: 100% | 234.0 MiB/s |   1.2 MiB |  00m00s
[ 35/150] Installing libattr-0:2.5.2-5. 100% |  27.4 MiB/s |  28.1 KiB |  00m00s
[ 36/150] Installing libacl-0:2.3.2-3.f 100% |  38.2 MiB/s |  39.2 KiB |  00m00s
[ 37/150] Installing dwz-0:0.15-9.fc42. 100% |  19.0 MiB/s | 292.4 KiB |  00m00s
[ 38/150] Installing mpfr-0:4.2.1-6.fc4 100% | 203.5 MiB/s | 833.6 KiB |  00m00s
[ 39/150] Installing gawk-0:5.3.1-1.fc4 100% |  70.6 MiB/s |   1.7 MiB |  00m00s
[ 40/150] Installing unzip-0:6.0-66.fc4 100% |  24.0 MiB/s | 393.8 KiB |  00m00s
[ 41/150] Installing file-libs-0:5.46-1 100% | 456.1 MiB/s |  11.9 MiB |  00m00s
[ 42/150] Installing file-0:5.46-1.fc42 100% |   3.8 MiB/s | 101.7 KiB |  00m00s
[ 43/150] Installing crypto-policies-0: 100% |  13.1 MiB/s | 161.4 KiB |  00m00s
[ 44/150] Installing pcre2-0:10.45-1.fc 100% | 170.7 MiB/s | 699.1 KiB |  00m00s
[ 45/150] Installing grep-0:3.11-10.fc4 100% |  43.6 MiB/s |   1.0 MiB |  00m00s
[ 46/150] Installing xz-1:5.6.3-3.fc42. 100% |  51.2 MiB/s |   1.2 MiB |  00m00s
[ 47/150] Installing libeconf-0:0.7.6-1 100% |  64.7 MiB/s |  66.2 KiB |  00m00s
[ 48/150] Installing libcap-ng-0:0.8.5- 100% |  73.1 MiB/s |  74.8 KiB |  00m00s
[ 49/150] Installing audit-libs-0:4.0.3 100% | 115.0 MiB/s | 353.4 KiB |  00m00s
[ 50/150] Installing pam-libs-0:1.7.0-4 100% |  63.1 MiB/s | 129.1 KiB |  00m00s
[ 51/150] Installing libcap-0:2.73-2.fc 100% |  12.9 MiB/s | 212.1 KiB |  00m00s
[ 52/150] Installing systemd-libs-0:257 100% | 222.4 MiB/s |   2.2 MiB |  00m00s
[ 53/150] Installing libsmartcols-0:2.4 100% | 177.3 MiB/s | 181.5 KiB |  00m00s
[ 54/150] Installing libsepol-0:3.8-1.f 100% | 201.9 MiB/s | 827.0 KiB |  00m00s
[ 55/150] Installing libselinux-0:3.8-1 100% |  94.9 MiB/s | 194.3 KiB |  00m00s
[ 56/150] Installing findutils-1:4.10.0 100% |  81.5 MiB/s |   1.9 MiB |  00m00s
[ 57/150] Installing sed-0:4.9-4.fc42.x 100% |  40.2 MiB/s | 865.5 KiB |  00m00s
[ 58/150] Installing libmount-0:2.40.4- 100% | 174.5 MiB/s | 357.4 KiB |  00m00s
[ 59/150] Installing lz4-libs-0:1.10.0- 100% | 154.7 MiB/s | 158.5 KiB |  00m00s
[ 60/150] Installing lua-libs-0:5.4.7-3 100% | 135.8 MiB/s | 278.1 KiB |  00m00s
[ 61/150] Installing alternatives-0:1.3 100% |   4.7 MiB/s |  67.7 KiB |  00m00s
[ 62/150] Installing libffi-0:3.4.7-2.f 100% |  41.0 MiB/s |  84.0 KiB |  00m00s
[ 63/150] Installing libtasn1-0:4.20.0- 100% |  87.0 MiB/s | 178.1 KiB |  00m00s
[ 64/150] Installing p11-kit-0:0.25.5-5 100% |  78.0 MiB/s |   2.2 MiB |  00m00s
[ 65/150] Installing libunistring-0:1.1 100% | 246.7 MiB/s |   1.7 MiB |  00m00s
[ 66/150] Installing libidn2-0:2.3.8-1. 100% |  90.9 MiB/s | 558.7 KiB |  00m00s
[ 67/150] Installing libpsl-0:0.21.5-5. 100% |  75.7 MiB/s |  77.5 KiB |  00m00s
[ 68/150] Installing p11-kit-trust-0:0. 100% |  12.5 MiB/s | 397.2 KiB |  00m00s
[ 69/150] Installing zstd-0:1.5.7-1.fc4 100% |  77.7 MiB/s |   1.7 MiB |  00m00s
[ 70/150] Installing util-linux-core-0: 100% |  57.1 MiB/s |   1.4 MiB |  00m00s
[ 71/150] Installing tar-2:1.35-5.fc42. 100% | 105.8 MiB/s |   3.0 MiB |  00m00s
[ 72/150] Installing libsemanage-0:3.8- 100% |  75.7 MiB/s | 310.2 KiB |  00m00s
[ 73/150] Installing shadow-utils-2:4.1 100% |  83.7 MiB/s |   4.0 MiB |  00m00s
[ 74/150] Installing systemd-standalone 100% |  19.1 MiB/s | 273.8 KiB |  00m00s
[ 75/150] Installing zip-0:3.0-43.fc42. 100% |  40.3 MiB/s | 702.4 KiB |  00m00s
[ 76/150] Installing libfdisk-0:2.40.4- 100% | 182.4 MiB/s | 373.5 KiB |  00m00s
[ 77/150] Installing libxml2-0:2.12.9-2 100% |  77.6 MiB/s |   1.7 MiB |  00m00s
[ 78/150] Installing bzip2-0:1.0.8-20.f 100% |   6.8 MiB/s | 103.8 KiB |  00m00s
[ 79/150] Installing add-determinism-0: 100% | 112.1 MiB/s |   2.5 MiB |  00m00s
[ 80/150] Installing build-reproducibil 100% |   1.0 MiB/s |   1.0 KiB |  00m00s
[ 81/150] Installing ed-0:1.21-2.fc42.x 100% |   9.7 MiB/s | 148.8 KiB |  00m00s
[ 82/150] Installing patch-0:2.7.6-26.f 100% |  18.1 MiB/s | 260.2 KiB |  00m00s
[ 83/150] Installing filesystem-srpm-ma 100% |  38.0 MiB/s |  38.9 KiB |  00m00s
[ 84/150] Installing elfutils-default-y 100% | 170.2 KiB/s |   2.0 KiB |  00m00s
[ 85/150] Installing elfutils-libs-0:0. 100% | 165.2 MiB/s | 676.7 KiB |  00m00s
[ 86/150] Installing cpio-0:2.15-2.fc41 100% |  47.8 MiB/s |   1.1 MiB |  00m00s
[ 87/150] Installing diffutils-0:3.10-9 100% |  69.1 MiB/s |   1.6 MiB |  00m00s
[ 88/150] Installing libgomp-0:15.0.1-0 100% | 174.9 MiB/s | 537.3 KiB |  00m00s
[ 89/150] Installing sqlite-libs-0:3.49 100% | 217.7 MiB/s |   1.5 MiB |  00m00s
[ 90/150] Installing json-c-0:0.18-2.fc 100% |  85.9 MiB/s |  88.0 KiB |  00m00s
[ 91/150] Installing jansson-0:2.14-2.f 100% |  92.2 MiB/s |  94.4 KiB |  00m00s
[ 92/150] Installing libpkgconf-0:2.3.0 100% |  77.4 MiB/s |  79.2 KiB |  00m00s
[ 93/150] Installing pkgconf-0:2.3.0-2. 100% |   6.3 MiB/s |  91.0 KiB |  00m00s
[ 94/150] Installing pkgconf-pkg-config 100% | 126.7 KiB/s |   1.8 KiB |  00m00s
[ 95/150] Installing xxhash-libs-0:0.8. 100% |  89.4 MiB/s |  91.6 KiB |  00m00s
[ 96/150] Installing libbrotli-0:1.1.0- 100% | 164.8 MiB/s | 843.6 KiB |  00m00s
[ 97/150] Installing libnghttp2-0:1.65. 100% | 159.5 MiB/s | 163.3 KiB |  00m00s
[ 98/150] Installing keyutils-libs-0:1. 100% |  58.3 MiB/s |  59.7 KiB |  00m00s
[ 99/150] Installing libcom_err-0:1.47. 100% |  66.6 MiB/s |  68.2 KiB |  00m00s
[100/150] Installing libverto-0:0.3.2-1 100% |  26.6 MiB/s |  27.2 KiB |  00m00s
[101/150] Installing libtool-ltdl-0:2.5 100% |  69.6 MiB/s |  71.2 KiB |  00m00s
[102/150] Installing gdbm-libs-1:1.23-9 100% |  64.2 MiB/s | 131.6 KiB |  00m00s
[103/150] Installing cyrus-sasl-lib-0:2 100% | 100.2 MiB/s |   2.3 MiB |  00m00s
[104/150] Installing rust-srpm-macros-0 100% |   5.4 MiB/s |   5.6 KiB |  00m00s
[105/150] Installing qt6-srpm-macros-0: 100% |   0.0   B/s | 740.0   B |  00m00s
[106/150] Installing qt5-srpm-macros-0: 100% | 757.8 KiB/s | 776.0   B |  00m00s
[107/150] Installing perl-srpm-macros-0 100% |   0.0   B/s |   1.1 KiB |  00m00s
[108/150] Installing package-notes-srpm 100% |   0.0   B/s |   2.0 KiB |  00m00s
[109/150] Installing openblas-srpm-macr 100% |   0.0   B/s | 392.0   B |  00m00s
[110/150] Installing ocaml-srpm-macros- 100% |   0.0   B/s |   2.2 KiB |  00m00s
[111/150] Installing kernel-srpm-macros 100% |   0.0   B/s |   2.3 KiB |  00m00s
[112/150] Installing gnat-srpm-macros-0 100% |   0.0   B/s |   1.3 KiB |  00m00s
[113/150] Installing ghc-srpm-macros-0: 100% |   0.0   B/s |   1.0 KiB |  00m00s
[114/150] Installing fpc-srpm-macros-0: 100% |   0.0   B/s | 420.0   B |  00m00s
[115/150] Installing ansible-srpm-macro 100% |  35.4 MiB/s |  36.2 KiB |  00m00s
[116/150] Installing coreutils-common-0 100% | 227.6 MiB/s |  11.2 MiB |  00m00s
[117/150] Installing openssl-libs-1:3.2 100% | 270.2 MiB/s |   7.8 MiB |  00m00s
[118/150] Installing coreutils-0:9.6-2. 100% |  99.2 MiB/s |   5.5 MiB |  00m00s
[119/150] Installing ca-certificates-0: 100% |   1.0 MiB/s |   2.4 MiB |  00m02s
[120/150] Installing libarchive-0:3.7.7 100% | 151.8 MiB/s | 932.6 KiB |  00m00s
[121/150] Installing krb5-libs-0:1.21.3 100% | 176.9 MiB/s |   2.3 MiB |  00m00s
[122/150] Installing libssh-0:0.11.1-4. 100% | 138.6 MiB/s | 567.5 KiB |  00m00s
[123/150] Installing gzip-0:1.13-3.fc42 100% |  21.6 MiB/s | 398.4 KiB |  00m00s
[124/150] Installing rpm-sequoia-0:1.7. 100% | 268.3 MiB/s |   2.4 MiB |  00m00s
[125/150] Installing rpm-libs-0:4.20.1- 100% | 176.6 MiB/s | 723.4 KiB |  00m00s
[126/150] Installing rpm-build-libs-0:4 100% | 101.3 MiB/s | 207.4 KiB |  00m00s
[127/150] Installing libevent-0:2.1.12- 100% | 177.1 MiB/s | 906.9 KiB |  00m00s
[128/150] Installing openldap-0:2.6.9-3 100% | 160.9 MiB/s | 658.9 KiB |  00m00s
[129/150] Installing libcurl-0:8.13.0~r 100% | 210.8 MiB/s | 863.5 KiB |  00m00s
[130/150] Installing elfutils-debuginfo 100% |   5.6 MiB/s |  86.2 KiB |  00m00s
[131/150] Installing elfutils-0:0.192-8 100% | 107.5 MiB/s |   2.7 MiB |  00m00s
[132/150] Installing binutils-0:2.44-3. 100% | 225.2 MiB/s |  25.9 MiB |  00m00s
[133/150] Installing gdb-minimal-0:16.2 100% | 229.3 MiB/s |  13.3 MiB |  00m00s
[134/150] Installing debugedit-0:5.1-5. 100% |  12.7 MiB/s | 195.4 KiB |  00m00s
[135/150] Installing curl-0:8.13.0~rc1- 100% |  14.1 MiB/s | 463.5 KiB |  00m00s
[136/150] Installing rpm-0:4.20.1-1.fc4 100% |  56.8 MiB/s |   2.5 MiB |  00m00s
[137/150] Installing efi-srpm-macros-0: 100% |  40.1 MiB/s |  41.1 KiB |  00m00s
[138/150] Installing lua-srpm-macros-0: 100% |   1.9 MiB/s |   1.9 KiB |  00m00s
[139/150] Installing tree-sitter-srpm-m 100% |   7.8 MiB/s |   7.9 KiB |  00m00s
[140/150] Installing zig-srpm-macros-0: 100% |   1.6 MiB/s |   1.7 KiB |  00m00s
[141/150] Installing fonts-srpm-macros- 100% |  55.7 MiB/s |  57.0 KiB |  00m00s
[142/150] Installing forge-srpm-macros- 100% |  39.3 MiB/s |  40.3 KiB |  00m00s
[143/150] Installing go-srpm-macros-0:3 100% |  60.5 MiB/s |  62.0 KiB |  00m00s
[144/150] Installing python-srpm-macros 100% |  50.9 MiB/s |  52.2 KiB |  00m00s
[145/150] Installing redhat-rpm-config- 100% |  47.2 MiB/s | 193.5 KiB |  00m00s
[146/150] Installing rpm-build-0:4.20.1 100% |  10.2 MiB/s | 177.4 KiB |  00m00s
[147/150] Installing pyproject-srpm-mac 100% |   2.4 MiB/s |   2.5 KiB |  00m00s
[148/150] Installing which-0:2.23-1.fc4 100% |   5.2 MiB/s |  85.6 KiB |  00m00s
[149/150] Installing util-linux-0:2.40. 100% |  60.7 MiB/s |   3.5 MiB |  00m00s
[150/150] Installing info-0:7.2-3.fc42. 100% | 134.0 KiB/s | 358.3 KiB |  00m03s
Public key "file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-43-primary" is already present, not importing.
Complete!
Finish: installing minimal buildroot with dnf5
Start: creating root cache
Finish: creating root cache
Finish: chroot init
INFO: Installed packages:
INFO: add-determinism-0.6.0-1.fc43.x86_64
alternatives-1.31-3.fc42.x86_64
ansible-srpm-macros-1-17.1.fc42.noarch
audit-libs-4.0.3-2.fc42.x86_64
bash-5.2.37-3.fc43.x86_64
binutils-2.44-3.fc43.x86_64
build-reproducibility-srpm-macros-0.6.0-1.fc43.noarch
bzip2-1.0.8-20.fc42.x86_64
bzip2-libs-1.0.8-20.fc42.x86_64
ca-certificates-2024.2.69_v8.0.401-5.fc42.noarch
coreutils-9.6-2.fc43.x86_64
coreutils-common-9.6-2.fc43.x86_64
cpio-2.15-2.fc41.x86_64
crypto-policies-20250305-1.gita35b0fa.fc43.noarch
curl-8.13.0~rc1-1.fc43.x86_64
cyrus-sasl-lib-2.1.28-30.fc42.x86_64
debugedit-5.1-5.fc43.x86_64
diffutils-3.10-9.fc42.x86_64
dwz-0.15-9.fc42.x86_64
ed-1.21-2.fc42.x86_64
efi-srpm-macros-6-2.fc42.noarch
elfutils-0.192-8.fc42.x86_64
elfutils-debuginfod-client-0.192-8.fc42.x86_64
elfutils-default-yama-scope-0.192-8.fc42.noarch
elfutils-libelf-0.192-8.fc42.x86_64
elfutils-libs-0.192-8.fc42.x86_64
fedora-gpg-keys-43-0.1.noarch
fedora-release-43-0.7.noarch
fedora-release-common-43-0.7.noarch
fedora-release-identity-basic-43-0.7.noarch
fedora-repos-43-0.1.noarch
fedora-repos-rawhide-43-0.1.noarch
file-5.46-1.fc42.x86_64
file-libs-5.46-1.fc42.x86_64
filesystem-3.18-38.fc43.x86_64
filesystem-srpm-macros-3.18-38.fc43.noarch
findutils-4.10.0-5.fc42.x86_64
fonts-srpm-macros-2.0.5-21.fc42.noarch
forge-srpm-macros-0.4.0-2.fc42.noarch
fpc-srpm-macros-1.3-14.fc42.noarch
gawk-5.3.1-1.fc42.x86_64
gdb-minimal-16.2-1.fc43.x86_64
gdbm-libs-1.23-9.fc42.x86_64
ghc-srpm-macros-1.9.2-2.fc42.noarch
glibc-2.41.9000-2.fc43.x86_64
glibc-common-2.41.9000-2.fc43.x86_64
glibc-gconv-extra-2.41.9000-2.fc43.x86_64
glibc-minimal-langpack-2.41.9000-2.fc43.x86_64
gmp-6.3.0-3.fc43.x86_64
gnat-srpm-macros-6-7.fc42.noarch
go-srpm-macros-3.6.0-6.fc42.noarch
gpg-pubkey-105ef944-65ca83d1
gpg-pubkey-31645531-66b6dccf
gpg-pubkey-6d9f90a6-6786af3b
grep-3.11-10.fc42.x86_64
gzip-1.13-3.fc42.x86_64
info-7.2-3.fc42.x86_64
jansson-2.14-2.fc42.x86_64
json-c-0.18-2.fc42.x86_64
kernel-srpm-macros-1.0-25.fc42.noarch
keyutils-libs-1.6.3-5.fc42.x86_64
krb5-libs-1.21.3-5.fc42.x86_64
libacl-2.3.2-3.fc42.x86_64
libarchive-3.7.7-3.fc43.x86_64
libattr-2.5.2-5.fc42.x86_64
libblkid-2.40.4-7.fc43.x86_64
libbrotli-1.1.0-6.fc42.x86_64
libcap-2.73-2.fc42.x86_64
libcap-ng-0.8.5-4.fc42.x86_64
libcom_err-1.47.2-3.fc42.x86_64
libcurl-8.13.0~rc1-1.fc43.x86_64
libeconf-0.7.6-1.fc43.x86_64
libevent-2.1.12-15.fc42.x86_64
libfdisk-2.40.4-7.fc43.x86_64
libffi-3.4.7-2.fc43.x86_64
libgcc-15.0.1-0.9.fc43.x86_64
libgomp-15.0.1-0.9.fc43.x86_64
libidn2-2.3.8-1.fc43.x86_64
libmount-2.40.4-7.fc43.x86_64
libnghttp2-1.65.0-1.fc43.x86_64
libpkgconf-2.3.0-2.fc42.x86_64
libpsl-0.21.5-5.fc42.x86_64
libselinux-3.8-1.fc42.x86_64
libsemanage-3.8-1.fc42.x86_64
libsepol-3.8-1.fc42.x86_64
libsmartcols-2.40.4-7.fc43.x86_64
libssh-0.11.1-4.fc42.x86_64
libssh-config-0.11.1-4.fc42.noarch
libstdc++-15.0.1-0.9.fc43.x86_64
libtasn1-4.20.0-1.fc43.x86_64
libtool-ltdl-2.5.4-4.fc42.x86_64
libunistring-1.1-9.fc42.x86_64
libuuid-2.40.4-7.fc43.x86_64
libverto-0.3.2-10.fc42.x86_64
libxcrypt-4.4.38-6.fc43.x86_64
libxml2-2.12.9-2.fc42.x86_64
libzstd-1.5.7-1.fc43.x86_64
lua-libs-5.4.7-3.fc43.x86_64
lua-srpm-macros-1-15.fc42.noarch
lz4-libs-1.10.0-2.fc42.x86_64
mpfr-4.2.1-6.fc42.x86_64
ncurses-base-6.5-5.20250125.fc42.noarch
ncurses-libs-6.5-5.20250125.fc42.x86_64
ocaml-srpm-macros-10-4.fc42.noarch
openblas-srpm-macros-2-19.fc42.noarch
openldap-2.6.9-3.fc42.x86_64
openssl-libs-3.2.4-2.fc43.x86_64
p11-kit-0.25.5-5.fc42.x86_64
p11-kit-trust-0.25.5-5.fc42.x86_64
package-notes-srpm-macros-0.5-13.fc42.noarch
pam-libs-1.7.0-4.fc42.x86_64
patch-2.7.6-26.fc42.x86_64
pcre2-10.45-1.fc43.x86_64
pcre2-syntax-10.45-1.fc43.noarch
perl-srpm-macros-1-57.fc42.noarch
pkgconf-2.3.0-2.fc42.x86_64
pkgconf-m4-2.3.0-2.fc42.noarch
pkgconf-pkg-config-2.3.0-2.fc42.x86_64
popt-1.19-8.fc42.x86_64
publicsuffix-list-dafsa-20250116-1.fc42.noarch
pyproject-srpm-macros-1.17.0-1.fc43.noarch
python-srpm-macros-3.13-4.fc42.noarch
qt5-srpm-macros-5.15.15-1.fc42.noarch
qt6-srpm-macros-6.8.2-2.fc43.noarch
readline-8.2-13.fc43.x86_64
redhat-rpm-config-342-2.fc42.noarch
rpm-4.20.1-1.fc43.x86_64
rpm-build-4.20.1-1.fc43.x86_64
rpm-build-libs-4.20.1-1.fc43.x86_64
rpm-libs-4.20.1-1.fc43.x86_64
rpm-sequoia-1.7.0-5.fc43.x86_64
rust-srpm-macros-26.3-4.fc42.noarch
sed-4.9-4.fc42.x86_64
setup-2.15.0-14.fc43.noarch
shadow-utils-4.17.0-4.fc42.x86_64
sqlite-libs-3.49.0-1.fc43.x86_64
systemd-libs-257.4-3.fc43.x86_64
systemd-standalone-sysusers-257.4-3.fc43.x86_64
tar-1.35-5.fc42.x86_64
tree-sitter-srpm-macros-0.2.0-1.fc43.noarch
unzip-6.0-66.fc42.x86_64
util-linux-2.40.4-7.fc43.x86_64
util-linux-core-2.40.4-7.fc43.x86_64
which-2.23-1.fc42.x86_64
xxhash-libs-0.8.3-2.fc42.x86_64
xz-5.6.3-3.fc42.x86_64
xz-libs-5.6.3-3.fc42.x86_64
zig-srpm-macros-1-4.fc42.noarch
zip-3.0-43.fc42.x86_64
zlib-ng-compat-2.2.4-2.fc43.x86_64
zstd-1.5.7-1.fc43.x86_64
Start: buildsrpm
Start: rpmbuild -bs
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1737158400
Wrote: /builddir/build/SRPMS/python-extractcode-31.0.0-6.fc43.src.rpm
Finish: rpmbuild -bs
INFO: chroot_scan: 1 files copied to /var/lib/copr-rpmbuild/results/chroot_scan
INFO: /var/lib/mock/fedora-rawhide-x86_64-1741783375.735297/root/var/log/dnf5.log
INFO: chroot_scan: creating tarball /var/lib/copr-rpmbuild/results/chroot_scan.tar.gz
/bin/tar: Removing leading `/' from member names
Finish: buildsrpm
INFO: Done(/var/lib/copr-rpmbuild/workspace/workdir-lmc15fql/python-extractcode/python-extractcode.spec) Config(child) 0 minutes 32 seconds
INFO: Results and/or logs in: /var/lib/copr-rpmbuild/results
INFO: Cleaning up build root ('cleanup_on_success=True')
Start: clean chroot
INFO: unmounting tmpfs.
Finish: clean chroot
INFO: Start(/var/lib/copr-rpmbuild/results/python-extractcode-31.0.0-6.fc43.src.rpm)  Config(fedora-rawhide-x86_64)
Start(bootstrap): chroot init
INFO: mounting tmpfs at /var/lib/mock/fedora-rawhide-x86_64-bootstrap-1741783375.735297/root.
INFO: reusing tmpfs at /var/lib/mock/fedora-rawhide-x86_64-bootstrap-1741783375.735297/root.
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled package manager cache
Start(bootstrap): cleaning package manager metadata
Finish(bootstrap): cleaning package manager metadata
Finish(bootstrap): chroot init
Start: chroot init
INFO: mounting tmpfs at /var/lib/mock/fedora-rawhide-x86_64-1741783375.735297/root.
INFO: calling preinit hooks
INFO: enabled root cache
Start: unpacking root cache
Finish: unpacking root cache
INFO: enabled package manager cache
Start: cleaning package manager metadata
Finish: cleaning package manager metadata
INFO: enabled HW Info plugin
INFO: Buildroot is handled by package management downloaded with a bootstrap image:
  rpm-4.20.1-1.fc43.x86_64
  rpm-sequoia-1.7.0-5.fc43.x86_64
  dnf5-5.2.11.0-1.fc43.x86_64
  dnf5-plugins-5.2.11.0-1.fc43.x86_64
Finish: chroot init
Start: build phase for python-extractcode-31.0.0-6.fc43.src.rpm
Start: build setup for python-extractcode-31.0.0-6.fc43.src.rpm
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1737158400
Wrote: /builddir/build/SRPMS/python-extractcode-31.0.0-6.fc43.src.rpm
Updating and loading repositories:
 fedora                                 100% |   1.1 MiB/s |  28.9 KiB |  00m00s
 Copr repository                        100% |  23.0 KiB/s |   1.5 KiB |  00m00s
 fedora                                 100% | 346.5 KiB/s | 313.6 KiB |  00m01s
 Copr repository                        100% | 121.0 KiB/s |   9.0 KiB |  00m00s
Repositories loaded.
Package                         Arch   Version                        Repository      Size
Installing:
 python3-devel                  x86_64 3.13.2-2.fc43                  fedora       1.8 MiB
 python3-extractcode-7z         noarch 21.5.31-6.fc42                 fedora      20.1 KiB
 python3-extractcode-libarchive noarch 21.5.31-6.fc42                 fedora      24.6 KiB
 python3-pytest                 noarch 8.3.4-3.fc43                   fedora      20.8 MiB
 python3-sphinx                 noarch 1:8.1.3-2.fc42                 fedora      11.1 MiB
 python3-sphinx_rtd_theme       noarch 3.0.2-2.fc42                   fedora     327.3 KiB
 python3-typecode-libmagic      noarch 21.5.31-7.fc42                 fedora       9.0 KiB
Installing dependencies:
 expat                          x86_64 2.6.4-2.fc42                   fedora     292.8 KiB
 file-devel                     x86_64 5.46-1.fc42                    fedora      10.2 KiB
 fontawesome4-fonts             noarch 1:4.7.0-24.fc42                fedora     296.6 KiB
 fonts-filesystem               noarch 1:2.0.5-21.fc42                fedora       0.0   B
 google-roboto-slab-fonts       noarch 1.100263-0.25.20150923git.fc42 fedora     699.6 KiB
 lato-fonts                     noarch 2.015-23.fc42                  fedora      11.3 MiB
 libarchive-devel               x86_64 3.7.7-3.fc43                   fedora     179.3 KiB
 libb2                          x86_64 0.98.1-13.fc42                 fedora      46.1 KiB
 mpdecimal                      x86_64 4.0.0-2.fc43                   fedora     216.8 KiB
 openssl-devel                  x86_64 1:3.2.4-2.fc43                 fedora       4.3 MiB
 p7zip-plugins                  x86_64 16.02-32.fc42                  fedora       2.7 MiB
 pyproject-rpm-macros           noarch 1.17.0-1.fc43                  fedora     114.0 KiB
 python-pip-wheel               noarch 24.3.1-2.fc42                  fedora       1.2 MiB
 python-rpm-macros              noarch 3.13-4.fc42                    fedora      22.1 KiB
 python3                        x86_64 3.13.2-2.fc43                  fedora      27.6 KiB
 python3-babel                  noarch 2.17.0-1.fc42                  fedora      30.2 MiB
 python3-charset-normalizer     noarch 3.4.1-3.fc42                   fedora     319.6 KiB
 python3-docutils               noarch 0.21.2-2.fc42                  fedora       4.9 MiB
 python3-idna                   noarch 3.10-2.fc42                    fedora     628.0 KiB
 python3-imagesize              noarch 1.4.1-10.fc42                  fedora      35.3 KiB
 python3-iniconfig              noarch 1.1.1-25.fc42                  fedora      20.6 KiB
 python3-jinja2                 noarch 3.1.6-1.fc43                   fedora       2.9 MiB
 python3-libs                   x86_64 3.13.2-2.fc43                  fedora      39.9 MiB
 python3-markupsafe             x86_64 3.0.2-2.fc42                   fedora      55.8 KiB
 python3-packaging              noarch 24.2-3.fc42                    fedora     555.7 KiB
 python3-pluggy                 noarch 1.5.0-2.fc42                   fedora     192.7 KiB
 python3-pygments               noarch 2.18.0-4.fc42                  fedora      10.6 MiB
 python3-requests               noarch 2.32.3-4.fc42                  fedora     483.1 KiB
 python3-rpm-generators         noarch 14-12.fc42                     fedora      81.7 KiB
 python3-rpm-macros             noarch 3.13-4.fc42                    fedora       6.4 KiB
 python3-snowballstemmer        noarch 2.2.0-15.fc42                  fedora       1.7 MiB
 python3-sphinx-theme-alabaster noarch 0.7.16-6.fc41                  fedora      41.9 KiB
 python3-sphinxcontrib-jquery   noarch 4.1-10.fc42                    fedora     381.8 KiB
 python3-urllib3                noarch 2.3.0-2.fc42                   fedora       1.0 MiB
 tzdata                         noarch 2025a-1.fc43                   fedora       1.6 MiB

Transaction Summary:
 Installing:        42 packages

Total size of inbound packages is 37 MiB. Need to download 37 MiB.
After this operation, 151 MiB extra will be used (install 151 MiB, remove 0 B).
[ 1/42] python3-extractcode-7z-0:21.5.3 100% |  85.8 KiB/s |  17.9 KiB |  00m00s
[ 2/42] python3-extractcode-libarchive- 100% |  76.2 KiB/s |  19.1 KiB |  00m00s
[ 3/42] python3-sphinx_rtd_theme-0:3.0. 100% | 511.0 KiB/s |  86.4 KiB |  00m00s
[ 4/42] python3-typecode-libmagic-0:21. 100% | 229.3 KiB/s |  13.8 KiB |  00m00s
[ 5/42] python3-pytest-0:8.3.4-3.fc43.n 100% |   2.8 MiB/s |   2.2 MiB |  00m01s
[ 6/42] python3-devel-0:3.13.2-2.fc43.x 100% |   1.2 MiB/s | 404.1 KiB |  00m00s
[ 7/42] python3-sphinx-1:8.1.3-2.fc42.n 100% |   4.3 MiB/s |   2.7 MiB |  00m01s
[ 8/42] python3-iniconfig-0:1.1.1-25.fc 100% | 205.5 KiB/s |  18.1 KiB |  00m00s
[ 9/42] p7zip-plugins-0:16.02-32.fc42.x 100% |   7.7 MiB/s |   1.0 MiB |  00m00s
[10/42] python3-packaging-0:24.2-3.fc42 100% |   1.7 MiB/s | 154.0 KiB |  00m00s
[11/42] python3-pluggy-0:1.5.0-2.fc42.n 100% | 600.3 KiB/s |  58.8 KiB |  00m00s
[12/42] python3-imagesize-0:1.4.1-10.fc 100% | 250.2 KiB/s |  22.0 KiB |  00m00s
[13/42] python3-docutils-0:0.21.2-2.fc4 100% |   5.8 MiB/s |   1.1 MiB |  00m00s
[14/42] python3-jinja2-0:3.1.6-1.fc43.n 100% |   1.9 MiB/s | 496.3 KiB |  00m00s
[15/42] python3-babel-0:2.17.0-1.fc42.n 100% |  15.8 MiB/s |   6.9 MiB |  00m00s
[16/42] python3-pygments-0:2.18.0-4.fc4 100% |  11.4 MiB/s |   2.5 MiB |  00m00s
[17/42] python3-snowballstemmer-0:2.2.0 100% |   1.5 MiB/s | 258.7 KiB |  00m00s
[18/42] python3-requests-0:2.32.3-4.fc4 100% | 576.0 KiB/s | 159.6 KiB |  00m00s
[19/42] python3-sphinx-theme-alabaster- 100% |  91.5 KiB/s |  24.3 KiB |  00m00s
[20/42] fontawesome4-fonts-1:4.7.0-24.f 100% |   1.8 MiB/s | 204.5 KiB |  00m00s
[21/42] python3-sphinxcontrib-jquery-0: 100% | 912.6 KiB/s | 114.1 KiB |  00m00s
[22/42] google-roboto-slab-fonts-0:1.10 100% |   1.6 MiB/s | 238.8 KiB |  00m00s
[23/42] lato-fonts-0:2.015-23.fc42.noar 100% |  21.1 MiB/s |   3.1 MiB |  00m00s
[24/42] python3-charset-normalizer-0:3. 100% |   2.1 MiB/s | 108.4 KiB |  00m00s
[25/42] python3-markupsafe-0:3.0.2-2.fc 100% | 492.9 KiB/s |  30.1 KiB |  00m00s
[26/42] python3-idna-0:3.10-2.fc42.noar 100% |   2.0 MiB/s | 117.3 KiB |  00m00s
[27/42] fonts-filesystem-1:2.0.5-21.fc4 100% | 103.8 KiB/s |   8.6 KiB |  00m00s
[28/42] python3-urllib3-0:2.3.0-2.fc42. 100% |   1.6 MiB/s | 283.3 KiB |  00m00s
[29/42] python3-libs-0:3.13.2-2.fc43.x8 100% |  33.4 MiB/s |   9.2 MiB |  00m00s
[30/42] expat-0:2.6.4-2.fc42.x86_64     100% |   1.4 MiB/s | 114.7 KiB |  00m00s
[31/42] libb2-0:0.98.1-13.fc42.x86_64   100% | 367.9 KiB/s |  25.4 KiB |  00m00s
[32/42] mpdecimal-0:4.0.0-2.fc43.x86_64 100% |   1.8 MiB/s |  97.0 KiB |  00m00s
[33/42] python-pip-wheel-0:24.3.1-2.fc4 100% |  18.0 MiB/s |   1.2 MiB |  00m00s
[34/42] python3-0:3.13.2-2.fc43.x86_64  100% | 526.3 KiB/s |  28.4 KiB |  00m00s
[35/42] file-devel-0:5.46-1.fc42.x86_64 100% | 223.1 KiB/s |  15.6 KiB |  00m00s
[36/42] libarchive-devel-0:3.7.7-3.fc43 100% |   1.9 MiB/s | 133.6 KiB |  00m00s
[37/42] openssl-devel-1:3.2.4-2.fc43.x8 100% |  33.5 MiB/s |   2.8 MiB |  00m00s
[38/42] pyproject-rpm-macros-0:1.17.0-1 100% | 912.6 KiB/s |  44.7 KiB |  00m00s
[39/42] tzdata-0:2025a-1.fc43.noarch    100% |   3.0 MiB/s | 713.4 KiB |  00m00s
[40/42] python-rpm-macros-0:3.13-4.fc42 100% | 345.5 KiB/s |  16.9 KiB |  00m00s
[41/42] python3-rpm-generators-0:14-12. 100% | 595.5 KiB/s |  29.2 KiB |  00m00s
[42/42] python3-rpm-macros-0:3.13-4.fc4 100% | 234.1 KiB/s |  11.7 KiB |  00m00s
--------------------------------------------------------------------------------
[42/42] Total                           100% |  15.4 MiB/s |  36.7 MiB |  00m02s
Running transaction
[ 1/44] Verify package files            100% | 330.0   B/s |  42.0   B |  00m00s
[ 2/44] Prepare transaction             100% | 291.0   B/s |  42.0   B |  00m00s
[ 3/44] Installing python-rpm-macros-0: 100% |  22.3 MiB/s |  22.8 KiB |  00m00s
[ 4/44] Installing fonts-filesystem-1:2 100% | 769.5 KiB/s | 788.0   B |  00m00s
[ 5/44] Installing python3-rpm-macros-0 100% |   0.0   B/s |   6.7 KiB |  00m00s
[ 6/44] Installing pyproject-rpm-macros 100% |  56.6 MiB/s | 115.9 KiB |  00m00s
[ 7/44] Installing fontawesome4-fonts-1 100% | 145.4 MiB/s | 297.8 KiB |  00m00s
[ 8/44] Installing google-roboto-slab-f 100% | 228.3 MiB/s | 701.4 KiB |  00m00s
[ 9/44] Installing lato-fonts-0:2.015-2 100% | 222.3 MiB/s |  11.3 MiB |  00m00s
[10/44] Installing openssl-devel-1:3.2. 100% |  28.5 MiB/s |   5.2 MiB |  00m00s
[11/44] Installing libarchive-devel-0:3 100% |  60.5 MiB/s | 185.9 KiB |  00m00s
[12/44] Installing file-devel-0:5.46-1. 100% |   2.1 MiB/s |  10.9 KiB |  00m00s
[13/44] Installing tzdata-0:2025a-1.fc4 100% |  24.5 MiB/s |   1.9 MiB |  00m00s
[14/44] Installing python-pip-wheel-0:2 100% | 311.0 MiB/s |   1.2 MiB |  00m00s
[15/44] Installing mpdecimal-0:4.0.0-2. 100% | 106.6 MiB/s | 218.4 KiB |  00m00s
[16/44] Installing libb2-0:0.98.1-13.fc 100% |  46.1 MiB/s |  47.2 KiB |  00m00s
[17/44] Installing expat-0:2.6.4-2.fc42 100% |  12.5 MiB/s | 294.9 KiB |  00m00s
[18/44] Installing python3-libs-0:3.13. 100% | 185.7 MiB/s |  40.3 MiB |  00m00s
[19/44] Installing python3-0:3.13.2-2.f 100% |   1.8 MiB/s |  29.4 KiB |  00m00s
[20/44] Installing python3-packaging-0: 100% |  92.5 MiB/s | 568.0 KiB |  00m00s
[21/44] Installing python3-docutils-0:0 100% |  94.2 MiB/s |   5.0 MiB |  00m00s
[22/44] Installing python3-idna-0:3.10- 100% | 123.9 MiB/s | 634.3 KiB |  00m00s
[23/44] Installing python3-urllib3-0:2. 100% | 113.1 MiB/s |   1.0 MiB |  00m00s
[24/44] Installing python3-rpm-generato 100% |  81.0 MiB/s |  82.9 KiB |  00m00s
[25/44] Installing python3-iniconfig-0: 100% |  11.5 MiB/s |  23.5 KiB |  00m00s
[26/44] Installing python3-pluggy-0:1.5 100% |  38.9 MiB/s | 199.0 KiB |  00m00s
[27/44] Installing python3-babel-0:2.17 100% | 205.4 MiB/s |  30.4 MiB |  00m00s
[28/44] Installing python3-imagesize-0: 100% |   9.4 MiB/s |  38.3 KiB |  00m00s
[29/44] Installing python3-pygments-0:2 100% | 128.9 MiB/s |  10.8 MiB |  00m00s
[30/44] Installing python3-snowballstem 100% | 172.1 MiB/s |   1.7 MiB |  00m00s
[31/44] Installing python3-sphinx-theme 100% |  22.7 MiB/s |  46.4 KiB |  00m00s
[32/44] Installing python3-markupsafe-0 100% |  29.2 MiB/s |  59.9 KiB |  00m00s
[33/44] Installing python3-jinja2-0:3.1 100% | 208.1 MiB/s |   2.9 MiB |  00m00s
[34/44] Installing python3-charset-norm 100% |  16.1 MiB/s | 329.5 KiB |  00m00s
[35/44] Installing python3-requests-0:2 100% |  60.5 MiB/s | 495.2 KiB |  00m00s
[36/44] Installing python3-sphinx-1:8.1 100% | 100.2 MiB/s |  11.3 MiB |  00m00s
[37/44] Installing python3-sphinxcontri 100% | 125.3 MiB/s | 385.0 KiB |  00m00s
[38/44] Installing p7zip-plugins-0:16.0 100% | 110.9 MiB/s |   2.7 MiB |  00m00s
[39/44] Installing python3-extractcode- 100% |  11.4 MiB/s |  23.2 KiB |  00m00s
[40/44] Installing python3-sphinx_rtd_t 100% |  26.1 MiB/s | 348.0 KiB |  00m00s
[41/44] Installing python3-pytest-0:8.3 100% | 206.0 MiB/s |  21.0 MiB |  00m00s
[42/44] Installing python3-devel-0:3.13 100% |  56.8 MiB/s |   1.8 MiB |  00m00s
[43/44] Installing python3-extractcode- 100% |  13.6 MiB/s |  27.9 KiB |  00m00s
[44/44] Installing python3-typecode-lib 100% | 238.6 KiB/s |  11.7 KiB |  00m00s
Complete!
Finish: build setup for python-extractcode-31.0.0-6.fc43.src.rpm
Start: rpmbuild python-extractcode-31.0.0-6.fc43.src.rpm
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1737158400
Executing(%mkbuilddir): /bin/sh -e /var/tmp/rpm-tmp.FAnwtB
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.xDCOxC
+ umask 022
+ cd /builddir/build/BUILD/python-extractcode-31.0.0-build
+ cd /builddir/build/BUILD/python-extractcode-31.0.0-build
+ rm -rf extractcode-31.0.0
+ /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/extractcode-31.0.0.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd extractcode-31.0.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/6270a8805c7fb964e545a56ca8a92829d240a96a.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/55.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/56.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ sed -i 's|\(fallback_version = "\)[^"]*|\131.0.0|' pyproject.toml
+ sed -i 's|extractcode-7z >= 16.5.210525|extractcode-7z-system-provided|' setup.cfg
+ sed -i 's|extractcode_libarchive >= 3.5.1.210525|extractcode_libarchive-system-provided|' setup.cfg
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.cq4AMU
+ umask 022
+ cd /builddir/build/BUILD/python-extractcode-31.0.0-build
+ cd extractcode-31.0.0
+ echo pyproject-rpm-macros
+ echo python3-devel
+ echo 'python3dist(packaging)'
+ echo 'python3dist(pip) >= 19'
+ '[' -f pyproject.toml ']'
+ echo '(python3dist(tomli) if python3-devel < 3.11)'
+ rm -rfv '*.dist-info/'
+ '[' -f /usr/bin/python3 ']'
+ mkdir -p /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ echo -n
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ VALAFLAGS=-g
+ RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1  '
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ CC=gcc
+ CXX=g++
+ TMPDIR=/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ RPM_TOXENV=py313
+ HOSTNAME=rpmbuild
+ /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/pyproject-wheeldir --output /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-buildrequires
Handling setuptools >= 50 from build-system.requires
Requirement not satisfied: setuptools >= 50
Handling wheel from build-system.requires
Requirement not satisfied: wheel
Handling setuptools_scm[toml] >= 6 from build-system.requires
Requirement not satisfied: setuptools_scm[toml] >= 6
Exiting dependency generation pass: build backend
+ cat /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-buildrequires
+ rm -rfv '*.dist-info/'
+ RPM_EC=0
++ jobs -p
+ exit 0
Wrote: /builddir/build/SRPMS/python-extractcode-31.0.0-6.fc43.buildreqs.nosrc.rpm
INFO: Going to install missing dynamic buildrequires
Updating and loading repositories:
 fedora                                 100% | 804.1 KiB/s |  28.9 KiB |  00m00s
 Copr repository                        100% |  44.7 KiB/s |   1.5 KiB |  00m00s
 fedora                                 100% | 363.8 KiB/s | 313.6 KiB |  00m01s
Repositories loaded.
Package "pyproject-rpm-macros-1.17.0-1.fc43.noarch" is already installed.
Package "python3-devel-3.13.2-2.fc43.x86_64" is already installed.
Package "python3-extractcode-7z-21.5.31-6.fc42.noarch" is already installed.
Package "python3-extractcode-libarchive-21.5.31-6.fc42.noarch" is already installed.
Package "python3-packaging-24.2-3.fc42.noarch" is already installed.
Package "python3-pytest-8.3.4-3.fc43.noarch" is already installed.
Package "python3-sphinx-1:8.1.3-2.fc42.noarch" is already installed.
Package "python3-sphinx_rtd_theme-3.0.2-2.fc42.noarch" is already installed.
Package "python3-typecode-libmagic-21.5.31-7.fc42.noarch" is already installed.

Package                      Arch   Version         Repository      Size
Installing:
 python3-pip                 noarch 24.3.1-2.fc42   fedora      11.3 MiB
 python3-setuptools          noarch 74.1.3-5.fc42   fedora       8.4 MiB
 python3-setuptools_scm      noarch 8.1.0-2.fc42    fedora     319.6 KiB
 python3-setuptools_scm+toml noarch 8.1.0-2.fc42    fedora       9.3 KiB
 python3-wheel               noarch 1:0.45.1-3.fc42 fedora     541.9 KiB

Transaction Summary:
 Installing:         5 packages

Total size of inbound packages is 5 MiB. Need to download 5 MiB.
After this operation, 21 MiB extra will be used (install 21 MiB, remove 0 B).
[1/5] python3-setuptools_scm-0:8.1.0-2. 100% | 293.1 KiB/s | 117.2 KiB |  00m00s
[2/5] python3-setuptools_scm+toml-0:8.1 100% | 120.8 KiB/s |   9.7 KiB |  00m00s
[3/5] python3-wheel-1:0.45.1-3.fc42.noa 100% |   1.1 MiB/s | 174.9 KiB |  00m00s
[4/5] python3-setuptools-0:74.1.3-5.fc4 100% |   2.7 MiB/s |   2.0 MiB |  00m01s
[5/5] python3-pip-0:24.3.1-2.fc42.noarc 100% |   3.7 MiB/s |   2.7 MiB |  00m01s
--------------------------------------------------------------------------------
[5/5] Total                             100% |   6.4 MiB/s |   5.0 MiB |  00m01s
Running transaction
[1/7] Verify package files              100% | 263.0   B/s |   5.0   B |  00m00s
[2/7] Prepare transaction               100% |  92.0   B/s |   5.0   B |  00m00s
[3/7] Installing python3-setuptools-0:7 100% |  74.4 MiB/s |   8.6 MiB |  00m00s
[4/7] Installing python3-setuptools_scm 100% |  33.1 MiB/s | 339.3 KiB |  00m00s
[5/7] Installing python3-setuptools_scm 100% | 121.1 KiB/s | 124.0   B |  00m00s
[6/7] Installing python3-wheel-1:0.45.1 100% |  16.1 MiB/s | 562.0 KiB |  00m00s
[7/7] Installing python3-pip-0:24.3.1-2 100% |  59.3 MiB/s |  11.6 MiB |  00m00s
Complete!
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1737158400
Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.U8y5ka
+ umask 022
+ cd /builddir/build/BUILD/python-extractcode-31.0.0-build
+ cd extractcode-31.0.0
+ echo pyproject-rpm-macros
+ echo python3-devel
+ echo 'python3dist(packaging)'
+ echo 'python3dist(pip) >= 19'
+ '[' -f pyproject.toml ']'
+ echo '(python3dist(tomli) if python3-devel < 3.11)'
+ rm -rfv '*.dist-info/'
+ '[' -f /usr/bin/python3 ']'
+ mkdir -p /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ echo -n
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ VALAFLAGS=-g
+ RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1  '
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ CC=gcc
+ CXX=g++
+ TMPDIR=/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ RPM_TOXENV=py313
+ HOSTNAME=rpmbuild
+ /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/pyproject-wheeldir --output /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-buildrequires
Handling setuptools >= 50 from build-system.requires
Requirement satisfied: setuptools >= 50
   (installed: setuptools 74.1.3)
Handling wheel from build-system.requires
Requirement satisfied: wheel
   (installed: wheel 0.45.1)
Handling setuptools_scm[toml] >= 6 from build-system.requires
Requirement satisfied: setuptools_scm[toml] >= 6
   (installed: setuptools_scm 8.1.0)
   (extras are currently not checked)
running egg_info
creating src/extractcode.egg-info
writing src/extractcode.egg-info/PKG-INFO
writing dependency_links to src/extractcode.egg-info/dependency_links.txt
writing entry points to src/extractcode.egg-info/entry_points.txt
writing requirements to src/extractcode.egg-info/requires.txt
writing top-level names to src/extractcode.egg-info/top_level.txt
writing manifest file 'src/extractcode.egg-info/SOURCES.txt'
reading manifest file 'src/extractcode.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.*~' found anywhere in distribution
adding license file 'apache-2.0.LICENSE'
adding license file 'NOTICE'
adding license file 'AUTHORS.rst'
adding license file 'CHANGELOG.rst'
adding license file 'CODE_OF_CONDUCT.rst'
writing manifest file 'src/extractcode.egg-info/SOURCES.txt'
running dist_info
creating extractcode.egg-info
writing extractcode.egg-info/PKG-INFO
writing dependency_links to extractcode.egg-info/dependency_links.txt
writing entry points to extractcode.egg-info/entry_points.txt
writing requirements to extractcode.egg-info/requires.txt
writing top-level names to extractcode.egg-info/top_level.txt
writing manifest file 'extractcode.egg-info/SOURCES.txt'
reading manifest file 'extractcode.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.*~' found anywhere in distribution
adding license file 'apache-2.0.LICENSE'
adding license file 'NOTICE'
adding license file 'AUTHORS.rst'
adding license file 'CHANGELOG.rst'
adding license file 'CODE_OF_CONDUCT.rst'
writing manifest file 'extractcode.egg-info/SOURCES.txt'
creating '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/extractcode-31.0.0.dist-info'
Handling attrs!=20.1.0,>=18.1 from hook generated metadata: Requires-Dist (extractcode)
Requirement not satisfied: attrs!=20.1.0,>=18.1
Handling commoncode>=30.2.0 from hook generated metadata: Requires-Dist (extractcode)
Requirement not satisfied: commoncode>=30.2.0
Handling plugincode>=21.1.21 from hook generated metadata: Requires-Dist (extractcode)
Requirement not satisfied: plugincode>=21.1.21
Handling typecode>=21.6.1 from hook generated metadata: Requires-Dist (extractcode)
Requirement not satisfied: typecode>=21.6.1
Handling six from hook generated metadata: Requires-Dist (extractcode)
Requirement not satisfied: six
Handling Sphinx>=3.3.1; extra == "docs" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: Sphinx>=3.3.1; extra == "docs"
Handling sphinx-rtd-theme>=0.5.0; extra == "docs" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: sphinx-rtd-theme>=0.5.0; extra == "docs"
Handling doc8>=0.8.1; extra == "docs" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: doc8>=0.8.1; extra == "docs"
Handling extractcode-7z-system-provided; extra == "full" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: extractcode-7z-system-provided; extra == "full"
Handling extractcode-libarchive-system-provided; extra == "full" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: extractcode-libarchive-system-provided; extra == "full"
Handling typecode[full]>=21.6.1; extra == "full" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: typecode[full]>=21.6.1; extra == "full"
Handling patch-ng>=1.17; extra == "patch" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: patch-ng>=1.17; extra == "patch"
Handling pytest!=7.0.0,>=6; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: pytest!=7.0.0,>=6; extra == "testing"
Handling pytest-xdist>=2; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: pytest-xdist>=2; extra == "testing"
Handling aboutcode-toolkit>=7.0.2; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: aboutcode-toolkit>=7.0.2; extra == "testing"
Handling twine; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: twine; extra == "testing"
Handling black; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: black; extra == "testing"
Handling isort; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: isort; extra == "testing"
+ cat /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-buildrequires
+ rm -rfv extractcode-31.0.0.dist-info/
removed 'extractcode-31.0.0.dist-info/entry_points.txt'
removed 'extractcode-31.0.0.dist-info/top_level.txt'
removed 'extractcode-31.0.0.dist-info/METADATA'
removed 'extractcode-31.0.0.dist-info/apache-2.0.LICENSE'
removed 'extractcode-31.0.0.dist-info/NOTICE'
removed 'extractcode-31.0.0.dist-info/AUTHORS.rst'
removed 'extractcode-31.0.0.dist-info/CHANGELOG.rst'
removed 'extractcode-31.0.0.dist-info/CODE_OF_CONDUCT.rst'
removed directory 'extractcode-31.0.0.dist-info/'
+ RPM_EC=0
++ jobs -p
+ exit 0
Wrote: /builddir/build/SRPMS/python-extractcode-31.0.0-6.fc43.buildreqs.nosrc.rpm
INFO: Going to install missing dynamic buildrequires
Updating and loading repositories:
 fedora                                 100% |   1.0 MiB/s |  28.9 KiB |  00m00s
 Copr repository                        100% |  42.2 KiB/s |   1.5 KiB |  00m00s
 fedora                                 100% | 290.4 KiB/s | 313.6 KiB |  00m01s
Repositories loaded.
Package "pyproject-rpm-macros-1.17.0-1.fc43.noarch" is already installed.
Package "python3-devel-3.13.2-2.fc43.x86_64" is already installed.
Package "python3-extractcode-7z-21.5.31-6.fc42.noarch" is already installed.
Package "python3-extractcode-libarchive-21.5.31-6.fc42.noarch" is already installed.
Package "python3-packaging-24.2-3.fc42.noarch" is already installed.
Package "python3-pip-24.3.1-2.fc42.noarch" is already installed.
Package "python3-pytest-8.3.4-3.fc43.noarch" is already installed.
Package "python3-setuptools-74.1.3-5.fc42.noarch" is already installed.
Package "python3-setuptools_scm-8.1.0-2.fc42.noarch" is already installed.
Package "python3-setuptools_scm+toml-8.1.0-2.fc42.noarch" is already installed.
Package "python3-sphinx-1:8.1.3-2.fc42.noarch" is already installed.
Package "python3-sphinx_rtd_theme-3.0.2-2.fc42.noarch" is already installed.
Package "python3-typecode-libmagic-21.5.31-7.fc42.noarch" is already installed.
Package "python3-wheel-1:0.45.1-3.fc42.noarch" is already installed.

Package                    Arch   Version         Repository      Size
Installing:
 python3-attrs             noarch 25.2.0-1.fc43   copr_base  403.0 KiB
 python3-commoncode        noarch 31.2.1-4.fc42   fedora     667.8 KiB
 python3-plugincode        noarch 32.0.0-6.fc42   fedora      70.4 KiB
 python3-six               noarch 1.17.0-2.fc42   fedora     116.9 KiB
 python3-typecode          noarch 30.0.1-7.fc42   fedora     344.8 KiB
Installing dependencies:
 libxslt                   x86_64 1.1.42-4.fc42   fedora     478.7 KiB
 libyaml                   x86_64 0.2.5-16.fc42   fedora     134.7 KiB
 python3-beautifulsoup4    noarch 4.13.3-2.fc43   fedora       1.9 MiB
 python3-binaryornot       noarch 0.4.4-26.fc42   fedora      24.1 KiB
 python3-cffi              x86_64 1.17.1-2.fc42   fedora       1.3 MiB
 python3-chardet           noarch 5.2.0-16.fc42   fedora       2.1 MiB
 python3-click             noarch 8.1.7-7.fc42    fedora       1.0 MiB
 python3-cryptography      x86_64 44.0.0-5.fc43   fedora       5.1 MiB
 python3-lxml              x86_64 5.3.1-1.fc43    fedora       4.9 MiB
 python3-pdfminer          noarch 20240706-3.fc42 fedora       8.4 MiB
 python3-ply               noarch 3.11-26.fc42    fedora     565.1 KiB
 python3-pycparser         noarch 2.20-19.fc42    fedora     800.6 KiB
 python3-pyyaml            x86_64 6.0.2-2.fc42    fedora     781.0 KiB
 python3-saneyaml          noarch 0.6.0-6.fc42    fedora      56.7 KiB
 python3-soupsieve         noarch 2.6-5.fc42      fedora     291.9 KiB
 python3-text-unidecode    noarch 1.3-19.fc42     fedora     315.5 KiB
 python3-typing-extensions noarch 4.12.2-4.fc42   fedora     458.2 KiB

Transaction Summary:
 Installing:        22 packages

Total size of inbound packages is 11 MiB. Need to download 11 MiB.
After this operation, 30 MiB extra will be used (install 30 MiB, remove 0 B).
[ 1/22] python3-plugincode-0:32.0.0-6.f 100% | 238.6 KiB/s |  37.9 KiB |  00m00s
[ 2/22] python3-six-0:1.17.0-2.fc42.noa 100% | 254.9 KiB/s |  41.3 KiB |  00m00s
[ 3/22] python3-attrs-0:25.2.0-1.fc43.n 100% |   2.7 MiB/s | 121.0 KiB |  00m00s
[ 4/22] python3-commoncode-0:31.2.1-4.f 100% | 670.0 KiB/s | 180.9 KiB |  00m00s
[ 5/22] python3-typecode-0:30.0.1-7.fc4 100% | 789.7 KiB/s | 105.8 KiB |  00m00s
[ 6/22] python3-saneyaml-0:0.6.0-6.fc42 100% | 501.3 KiB/s |  25.1 KiB |  00m00s
[ 7/22] python3-click-0:8.1.7-7.fc42.no 100% |   2.5 MiB/s | 242.2 KiB |  00m00s
[ 8/22] python3-text-unidecode-0:1.3-19 100% |   1.1 MiB/s |  67.9 KiB |  00m00s
[ 9/22] python3-beautifulsoup4-0:4.13.3 100% |   2.0 MiB/s | 408.2 KiB |  00m00s
[10/22] python3-binaryornot-0:0.4.4-26. 100% | 443.8 KiB/s |  19.5 KiB |  00m00s
[11/22] python3-soupsieve-0:2.6-5.fc42. 100% |   1.8 MiB/s |  98.0 KiB |  00m00s
[12/22] python3-typing-extensions-0:4.1 100% |   1.8 MiB/s |  93.4 KiB |  00m00s
[13/22] python3-lxml-0:5.3.1-1.fc43.x86 100% |   9.6 MiB/s |   1.4 MiB |  00m00s
[14/22] python3-pyyaml-0:6.0.2-2.fc42.x 100% |   3.6 MiB/s | 230.4 KiB |  00m00s
[15/22] python3-chardet-0:5.2.0-16.fc42 100% |   5.7 MiB/s | 298.6 KiB |  00m00s
[16/22] libxslt-0:1.1.42-4.fc42.x86_64  100% |   3.8 MiB/s | 191.5 KiB |  00m00s
[17/22] python3-pdfminer-0:20240706-3.f 100% |  15.4 MiB/s |   5.6 MiB |  00m00s
[18/22] python3-cryptography-0:44.0.0-5 100% |   7.4 MiB/s |   1.4 MiB |  00m00s
[19/22] libyaml-0:0.2.5-16.fc42.x86_64  100% | 427.7 KiB/s |  60.7 KiB |  00m00s
[20/22] python3-pycparser-0:2.20-19.fc4 100% |   3.3 MiB/s | 159.7 KiB |  00m00s
[21/22] python3-cffi-0:1.17.1-2.fc42.x8 100% |   5.7 MiB/s | 308.9 KiB |  00m00s
[22/22] python3-ply-0:3.11-26.fc42.noar 100% |   2.9 MiB/s | 136.3 KiB |  00m00s
--------------------------------------------------------------------------------
[22/22] Total                           100% |  12.7 MiB/s |  11.2 MiB |  00m01s
Running transaction
[ 1/24] Verify package files            100% | 564.0   B/s |  22.0   B |  00m00s
[ 2/24] Prepare transaction             100% | 536.0   B/s |  22.0   B |  00m00s
[ 3/24] Installing python3-click-0:8.1. 100% | 132.4 MiB/s |   1.1 MiB |  00m00s
[ 4/24] Installing python3-attrs-0:25.2 100% |  81.5 MiB/s | 417.3 KiB |  00m00s
[ 5/24] Installing python3-ply-0:3.11-2 100% | 139.2 MiB/s | 570.3 KiB |  00m00s
[ 6/24] Installing python3-pycparser-0: 100% | 132.2 MiB/s | 812.0 KiB |  00m00s
[ 7/24] Installing python3-cffi-0:1.17. 100% | 147.2 MiB/s |   1.3 MiB |  00m00s
[ 8/24] Installing python3-cryptography 100% | 128.5 MiB/s |   5.1 MiB |  00m00s
[ 9/24] Installing python3-pdfminer-0:2 100% | 162.8 MiB/s |   8.5 MiB |  00m00s
[10/24] Installing libyaml-0:0.2.5-16.f 100% |  66.4 MiB/s | 136.0 KiB |  00m00s
[11/24] Installing python3-pyyaml-0:6.0 100% | 110.9 MiB/s | 794.8 KiB |  00m00s
[12/24] Installing python3-saneyaml-0:0 100% |  58.5 MiB/s |  59.9 KiB |  00m00s
[13/24] Installing libxslt-0:1.1.42-4.f 100% |  24.8 MiB/s | 481.8 KiB |  00m00s
[14/24] Installing python3-lxml-0:5.3.1 100% | 198.6 MiB/s |   5.0 MiB |  00m00s
[15/24] Installing python3-chardet-0:5. 100% |  74.8 MiB/s |   2.1 MiB |  00m00s
[16/24] Installing python3-binaryornot- 100% |  13.7 MiB/s |  28.1 KiB |  00m00s
[17/24] Installing python3-typing-exten 100% | 224.9 MiB/s | 460.6 KiB |  00m00s
[18/24] Installing python3-soupsieve-0: 100% |  72.8 MiB/s | 298.0 KiB |  00m00s
[19/24] Installing python3-beautifulsou 100% | 148.0 MiB/s |   1.9 MiB |  00m00s
[20/24] Installing python3-text-unideco 100% | 103.6 MiB/s | 318.2 KiB |  00m00s
[21/24] Installing python3-commoncode-0 100% |  95.7 MiB/s | 685.9 KiB |  00m00s
[22/24] Installing python3-plugincode-0 100% |  25.2 MiB/s |  77.4 KiB |  00m00s
[23/24] Installing python3-typecode-0:3 100% |  86.5 MiB/s | 354.4 KiB |  00m00s
[24/24] Installing python3-six-0:1.17.0 100% |   5.1 MiB/s | 119.0 KiB |  00m00s
Warning: skipped OpenPGP checks for 1 package from repository: copr_base
Complete!
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1737158400
Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.wlMPg7
+ umask 022
+ cd /builddir/build/BUILD/python-extractcode-31.0.0-build
+ cd extractcode-31.0.0
+ echo pyproject-rpm-macros
+ echo python3-devel
+ echo 'python3dist(packaging)'
+ echo 'python3dist(pip) >= 19'
+ '[' -f pyproject.toml ']'
+ echo '(python3dist(tomli) if python3-devel < 3.11)'
+ rm -rfv '*.dist-info/'
+ '[' -f /usr/bin/python3 ']'
+ mkdir -p /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ echo -n
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ VALAFLAGS=-g
+ RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1  '
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ CC=gcc
+ CXX=g++
+ TMPDIR=/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ RPM_TOXENV=py313
+ HOSTNAME=rpmbuild
+ /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/pyproject-wheeldir --output /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-buildrequires
Handling setuptools >= 50 from build-system.requires
Requirement satisfied: setuptools >= 50
   (installed: setuptools 74.1.3)
Handling wheel from build-system.requires
Requirement satisfied: wheel
   (installed: wheel 0.45.1)
Handling setuptools_scm[toml] >= 6 from build-system.requires
Requirement satisfied: setuptools_scm[toml] >= 6
   (installed: setuptools_scm 8.1.0)
   (extras are currently not checked)
running egg_info
writing src/extractcode.egg-info/PKG-INFO
writing dependency_links to src/extractcode.egg-info/dependency_links.txt
writing entry points to src/extractcode.egg-info/entry_points.txt
writing requirements to src/extractcode.egg-info/requires.txt
writing top-level names to src/extractcode.egg-info/top_level.txt
reading manifest file 'src/extractcode.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.*~' found anywhere in distribution
adding license file 'apache-2.0.LICENSE'
adding license file 'NOTICE'
adding license file 'AUTHORS.rst'
adding license file 'CHANGELOG.rst'
adding license file 'CODE_OF_CONDUCT.rst'
writing manifest file 'src/extractcode.egg-info/SOURCES.txt'
running dist_info
writing extractcode.egg-info/PKG-INFO
writing dependency_links to extractcode.egg-info/dependency_links.txt
writing entry points to extractcode.egg-info/entry_points.txt
writing requirements to extractcode.egg-info/requires.txt
writing top-level names to extractcode.egg-info/top_level.txt
reading manifest file 'extractcode.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.*~' found anywhere in distribution
adding license file 'apache-2.0.LICENSE'
adding license file 'NOTICE'
adding license file 'AUTHORS.rst'
adding license file 'CHANGELOG.rst'
adding license file 'CODE_OF_CONDUCT.rst'
writing manifest file 'extractcode.egg-info/SOURCES.txt'
creating '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/extractcode-31.0.0.dist-info'
Handling attrs!=20.1.0,>=18.1 from hook generated metadata: Requires-Dist (extractcode)
Requirement satisfied: attrs!=20.1.0,>=18.1
   (installed: attrs 25.2.0)
Handling commoncode>=30.2.0 from hook generated metadata: Requires-Dist (extractcode)
Requirement satisfied: commoncode>=30.2.0
   (installed: commoncode 31.2.1)
Handling plugincode>=21.1.21 from hook generated metadata: Requires-Dist (extractcode)
Requirement satisfied: plugincode>=21.1.21
   (installed: plugincode 32.0.0)
Handling typecode>=21.6.1 from hook generated metadata: Requires-Dist (extractcode)
Requirement satisfied: typecode>=21.6.1
   (installed: typecode 30.0.1)
Handling six from hook generated metadata: Requires-Dist (extractcode)
Requirement satisfied: six
   (installed: six 1.17.0)
Handling Sphinx>=3.3.1; extra == "docs" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: Sphinx>=3.3.1; extra == "docs"
Handling sphinx-rtd-theme>=0.5.0; extra == "docs" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: sphinx-rtd-theme>=0.5.0; extra == "docs"
Handling doc8>=0.8.1; extra == "docs" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: doc8>=0.8.1; extra == "docs"
Handling extractcode-7z-system-provided; extra == "full" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: extractcode-7z-system-provided; extra == "full"
Handling extractcode-libarchive-system-provided; extra == "full" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: extractcode-libarchive-system-provided; extra == "full"
Handling typecode[full]>=21.6.1; extra == "full" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: typecode[full]>=21.6.1; extra == "full"
Handling patch-ng>=1.17; extra == "patch" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: patch-ng>=1.17; extra == "patch"
Handling pytest!=7.0.0,>=6; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: pytest!=7.0.0,>=6; extra == "testing"
Handling pytest-xdist>=2; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: pytest-xdist>=2; extra == "testing"
Handling aboutcode-toolkit>=7.0.2; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: aboutcode-toolkit>=7.0.2; extra == "testing"
Handling twine; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: twine; extra == "testing"
Handling black; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: black; extra == "testing"
Handling isort; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: isort; extra == "testing"
+ cat /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-buildrequires
+ rm -rfv extractcode-31.0.0.dist-info/
removed 'extractcode-31.0.0.dist-info/entry_points.txt'
removed 'extractcode-31.0.0.dist-info/top_level.txt'
removed 'extractcode-31.0.0.dist-info/METADATA'
removed 'extractcode-31.0.0.dist-info/apache-2.0.LICENSE'
removed 'extractcode-31.0.0.dist-info/NOTICE'
removed 'extractcode-31.0.0.dist-info/AUTHORS.rst'
removed 'extractcode-31.0.0.dist-info/CHANGELOG.rst'
removed 'extractcode-31.0.0.dist-info/CODE_OF_CONDUCT.rst'
removed directory 'extractcode-31.0.0.dist-info/'
+ RPM_EC=0
++ jobs -p
+ exit 0
Wrote: /builddir/build/SRPMS/python-extractcode-31.0.0-6.fc43.buildreqs.nosrc.rpm
INFO: Going to install missing dynamic buildrequires
Updating and loading repositories:
 fedora                                 100% | 933.8 KiB/s |  28.9 KiB |  00m00s
 Copr repository                        100% |  38.0 KiB/s |   1.5 KiB |  00m00s
 fedora                                 100% |   1.7 MiB/s |   3.9 MiB |  00m02s
Repositories loaded.
Package "pyproject-rpm-macros-1.17.0-1.fc43.noarch" is already installed.
Package "python3-devel-3.13.2-2.fc43.x86_64" is already installed.
Package "python3-commoncode-31.2.1-4.fc42.noarch" is already installed.
Package "python3-extractcode-7z-21.5.31-6.fc42.noarch" is already installed.
Package "python3-extractcode-libarchive-21.5.31-6.fc42.noarch" is already installed.
Package "python3-packaging-24.2-3.fc42.noarch" is already installed.
Package "python3-pip-24.3.1-2.fc42.noarch" is already installed.
Package "python3-plugincode-32.0.0-6.fc42.noarch" is already installed.
Package "python3-pytest-8.3.4-3.fc43.noarch" is already installed.
Package "python3-setuptools-74.1.3-5.fc42.noarch" is already installed.
Package "python3-setuptools_scm-8.1.0-2.fc42.noarch" is already installed.
Package "python3-setuptools_scm+toml-8.1.0-2.fc42.noarch" is already installed.
Package "python3-six-1.17.0-2.fc42.noarch" is already installed.
Package "python3-sphinx-1:8.1.3-2.fc42.noarch" is already installed.
Package "python3-sphinx_rtd_theme-3.0.2-2.fc42.noarch" is already installed.
Package "python3-typecode-30.0.1-7.fc42.noarch" is already installed.
Package "python3-typecode-libmagic-21.5.31-7.fc42.noarch" is already installed.
Package "python3-wheel-1:0.45.1-3.fc42.noarch" is already installed.

Nothing to do.
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1737158400
Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.THHXeY
+ umask 022
+ cd /builddir/build/BUILD/python-extractcode-31.0.0-build
+ cd extractcode-31.0.0
+ echo pyproject-rpm-macros
+ echo python3-devel
+ echo 'python3dist(packaging)'
+ echo 'python3dist(pip) >= 19'
+ '[' -f pyproject.toml ']'
+ echo '(python3dist(tomli) if python3-devel < 3.11)'
+ rm -rfv '*.dist-info/'
+ '[' -f /usr/bin/python3 ']'
+ mkdir -p /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ echo -n
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ VALAFLAGS=-g
+ RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1  '
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ CC=gcc
+ CXX=g++
+ TMPDIR=/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ RPM_TOXENV=py313
+ HOSTNAME=rpmbuild
+ /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/pyproject-wheeldir --output /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-buildrequires
Handling setuptools >= 50 from build-system.requires
Requirement satisfied: setuptools >= 50
   (installed: setuptools 74.1.3)
Handling wheel from build-system.requires
Requirement satisfied: wheel
   (installed: wheel 0.45.1)
Handling setuptools_scm[toml] >= 6 from build-system.requires
Requirement satisfied: setuptools_scm[toml] >= 6
   (installed: setuptools_scm 8.1.0)
   (extras are currently not checked)
running egg_info
writing src/extractcode.egg-info/PKG-INFO
writing dependency_links to src/extractcode.egg-info/dependency_links.txt
writing entry points to src/extractcode.egg-info/entry_points.txt
writing requirements to src/extractcode.egg-info/requires.txt
writing top-level names to src/extractcode.egg-info/top_level.txt
reading manifest file 'src/extractcode.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.*~' found anywhere in distribution
adding license file 'apache-2.0.LICENSE'
adding license file 'NOTICE'
adding license file 'AUTHORS.rst'
adding license file 'CHANGELOG.rst'
adding license file 'CODE_OF_CONDUCT.rst'
writing manifest file 'src/extractcode.egg-info/SOURCES.txt'
running dist_info
writing extractcode.egg-info/PKG-INFO
writing dependency_links to extractcode.egg-info/dependency_links.txt
writing entry points to extractcode.egg-info/entry_points.txt
writing requirements to extractcode.egg-info/requires.txt
writing top-level names to extractcode.egg-info/top_level.txt
reading manifest file 'extractcode.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.*~' found anywhere in distribution
adding license file 'apache-2.0.LICENSE'
adding license file 'NOTICE'
adding license file 'AUTHORS.rst'
adding license file 'CHANGELOG.rst'
adding license file 'CODE_OF_CONDUCT.rst'
writing manifest file 'extractcode.egg-info/SOURCES.txt'
creating '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/extractcode-31.0.0.dist-info'
Handling attrs!=20.1.0,>=18.1 from hook generated metadata: Requires-Dist (extractcode)
Requirement satisfied: attrs!=20.1.0,>=18.1
   (installed: attrs 25.2.0)
Handling commoncode>=30.2.0 from hook generated metadata: Requires-Dist (extractcode)
Requirement satisfied: commoncode>=30.2.0
   (installed: commoncode 31.2.1)
Handling plugincode>=21.1.21 from hook generated metadata: Requires-Dist (extractcode)
Requirement satisfied: plugincode>=21.1.21
   (installed: plugincode 32.0.0)
Handling typecode>=21.6.1 from hook generated metadata: Requires-Dist (extractcode)
Requirement satisfied: typecode>=21.6.1
   (installed: typecode 30.0.1)
Handling six from hook generated metadata: Requires-Dist (extractcode)
Requirement satisfied: six
   (installed: six 1.17.0)
Handling Sphinx>=3.3.1; extra == "docs" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: Sphinx>=3.3.1; extra == "docs"
Handling sphinx-rtd-theme>=0.5.0; extra == "docs" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: sphinx-rtd-theme>=0.5.0; extra == "docs"
Handling doc8>=0.8.1; extra == "docs" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: doc8>=0.8.1; extra == "docs"
Handling extractcode-7z-system-provided; extra == "full" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: extractcode-7z-system-provided; extra == "full"
Handling extractcode-libarchive-system-provided; extra == "full" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: extractcode-libarchive-system-provided; extra == "full"
Handling typecode[full]>=21.6.1; extra == "full" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: typecode[full]>=21.6.1; extra == "full"
Handling patch-ng>=1.17; extra == "patch" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: patch-ng>=1.17; extra == "patch"
Handling pytest!=7.0.0,>=6; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: pytest!=7.0.0,>=6; extra == "testing"
Handling pytest-xdist>=2; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: pytest-xdist>=2; extra == "testing"
Handling aboutcode-toolkit>=7.0.2; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: aboutcode-toolkit>=7.0.2; extra == "testing"
Handling twine; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: twine; extra == "testing"
Handling black; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: black; extra == "testing"
Handling isort; extra == "testing" from hook generated metadata: Requires-Dist (extractcode)
Ignoring alien requirement: isort; extra == "testing"
+ cat /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-buildrequires
+ rm -rfv extractcode-31.0.0.dist-info/
removed 'extractcode-31.0.0.dist-info/entry_points.txt'
removed 'extractcode-31.0.0.dist-info/top_level.txt'
removed 'extractcode-31.0.0.dist-info/METADATA'
removed 'extractcode-31.0.0.dist-info/apache-2.0.LICENSE'
removed 'extractcode-31.0.0.dist-info/NOTICE'
removed 'extractcode-31.0.0.dist-info/AUTHORS.rst'
removed 'extractcode-31.0.0.dist-info/CHANGELOG.rst'
removed 'extractcode-31.0.0.dist-info/CODE_OF_CONDUCT.rst'
removed directory 'extractcode-31.0.0.dist-info/'
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.mzZkjT
+ umask 022
+ cd /builddir/build/BUILD/python-extractcode-31.0.0-build
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ export FCFLAGS
+ VALAFLAGS=-g
+ export VALAFLAGS
+ RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn'
+ export RUSTFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes '
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
+ cd extractcode-31.0.0
+ mkdir -p /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ VALAFLAGS=-g
+ RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes '
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ CC=gcc
+ CXX=g++
+ TMPDIR=/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_wheel.py /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/pyproject-wheeldir
Processing /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0
  Preparing metadata (pyproject.toml): started
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-modern-metadata-cyw2jahp/extractcode.egg-info
  writing /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-modern-metadata-cyw2jahp/extractcode.egg-info/PKG-INFO
  writing dependency_links to /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-modern-metadata-cyw2jahp/extractcode.egg-info/dependency_links.txt
  writing entry points to /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-modern-metadata-cyw2jahp/extractcode.egg-info/entry_points.txt
  writing requirements to /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-modern-metadata-cyw2jahp/extractcode.egg-info/requires.txt
  writing top-level names to /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-modern-metadata-cyw2jahp/extractcode.egg-info/top_level.txt
  writing manifest file '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-modern-metadata-cyw2jahp/extractcode.egg-info/SOURCES.txt'
  reading manifest file '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-modern-metadata-cyw2jahp/extractcode.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files matching '*.py[co]' found anywhere in distribution
  warning: no previously-included files matching '__pycache__' found anywhere in distribution
  warning: no previously-included files matching '*.*~' found anywhere in distribution
  adding license file 'apache-2.0.LICENSE'
  adding license file 'NOTICE'
  adding license file 'AUTHORS.rst'
  adding license file 'CHANGELOG.rst'
  adding license file 'CODE_OF_CONDUCT.rst'
  writing manifest file '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-modern-metadata-cyw2jahp/extractcode.egg-info/SOURCES.txt'
  creating '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-modern-metadata-cyw2jahp/extractcode-31.0.0.dist-info'
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: extractcode
  Building wheel for extractcode (pyproject.toml): started
  Running command Building wheel for extractcode (pyproject.toml)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/extractcode
  copying src/extractcode/__init__.py -> build/lib/extractcode
  copying src/extractcode/api.py -> build/lib/extractcode
  copying src/extractcode/archive.py -> build/lib/extractcode
  copying src/extractcode/cli.py -> build/lib/extractcode
  copying src/extractcode/extract.py -> build/lib/extractcode
  copying src/extractcode/libarchive2.py -> build/lib/extractcode
  copying src/extractcode/patch.py -> build/lib/extractcode
  copying src/extractcode/sevenzip.py -> build/lib/extractcode
  copying src/extractcode/uncompress.py -> build/lib/extractcode
  copying src/extractcode/vmimage.py -> build/lib/extractcode
  running egg_info
  writing src/extractcode.egg-info/PKG-INFO
  writing dependency_links to src/extractcode.egg-info/dependency_links.txt
  writing entry points to src/extractcode.egg-info/entry_points.txt
  writing requirements to src/extractcode.egg-info/requires.txt
  writing top-level names to src/extractcode.egg-info/top_level.txt
  reading manifest file 'src/extractcode.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files matching '*.py[co]' found anywhere in distribution
  warning: no previously-included files matching '__pycache__' found anywhere in distribution
  warning: no previously-included files matching '*.*~' found anywhere in distribution
  adding license file 'apache-2.0.LICENSE'
  adding license file 'NOTICE'
  adding license file 'AUTHORS.rst'
  adding license file 'CHANGELOG.rst'
  adding license file 'CODE_OF_CONDUCT.rst'
  writing manifest file 'src/extractcode.egg-info/SOURCES.txt'
  copying src/extractcode/NOTICE -> build/lib/extractcode
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  creating build/bdist.linux-x86_64/wheel/extractcode
  copying build/lib/extractcode/__init__.py -> build/bdist.linux-x86_64/wheel/./extractcode
  copying build/lib/extractcode/api.py -> build/bdist.linux-x86_64/wheel/./extractcode
  copying build/lib/extractcode/archive.py -> build/bdist.linux-x86_64/wheel/./extractcode
  copying build/lib/extractcode/cli.py -> build/bdist.linux-x86_64/wheel/./extractcode
  copying build/lib/extractcode/extract.py -> build/bdist.linux-x86_64/wheel/./extractcode
  copying build/lib/extractcode/libarchive2.py -> build/bdist.linux-x86_64/wheel/./extractcode
  copying build/lib/extractcode/patch.py -> build/bdist.linux-x86_64/wheel/./extractcode
  copying build/lib/extractcode/sevenzip.py -> build/bdist.linux-x86_64/wheel/./extractcode
  copying build/lib/extractcode/uncompress.py -> build/bdist.linux-x86_64/wheel/./extractcode
  copying build/lib/extractcode/vmimage.py -> build/bdist.linux-x86_64/wheel/./extractcode
  copying build/lib/extractcode/NOTICE -> build/bdist.linux-x86_64/wheel/./extractcode
  running install_egg_info
  Copying src/extractcode.egg-info to build/bdist.linux-x86_64/wheel/./extractcode-31.0.0-py3.13.egg-info
  running install_scripts
  creating build/bdist.linux-x86_64/wheel/extractcode-31.0.0.dist-info/WHEEL
  creating '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir/pip-wheel-w182s8wh/.tmp-orx96jcu/extractcode-31.0.0-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
  adding 'extractcode/NOTICE'
  adding 'extractcode/__init__.py'
  adding 'extractcode/api.py'
  adding 'extractcode/archive.py'
  adding 'extractcode/cli.py'
  adding 'extractcode/extract.py'
  adding 'extractcode/libarchive2.py'
  adding 'extractcode/patch.py'
  adding 'extractcode/sevenzip.py'
  adding 'extractcode/uncompress.py'
  adding 'extractcode/vmimage.py'
  adding 'extractcode-31.0.0.dist-info/AUTHORS.rst'
  adding 'extractcode-31.0.0.dist-info/CHANGELOG.rst'
  adding 'extractcode-31.0.0.dist-info/CODE_OF_CONDUCT.rst'
  adding 'extractcode-31.0.0.dist-info/METADATA'
  adding 'extractcode-31.0.0.dist-info/NOTICE'
  adding 'extractcode-31.0.0.dist-info/WHEEL'
  adding 'extractcode-31.0.0.dist-info/apache-2.0.LICENSE'
  adding 'extractcode-31.0.0.dist-info/entry_points.txt'
  adding 'extractcode-31.0.0.dist-info/top_level.txt'
  adding 'extractcode-31.0.0.dist-info/RECORD'
  removing build/bdist.linux-x86_64/wheel
  Building wheel for extractcode (pyproject.toml): finished with status 'done'
  Created wheel for extractcode: filename=extractcode-31.0.0-py3-none-any.whl size=56404 sha256=ae78d1cc82bb998f9a48d132019606842fb894143338f3454dd34322814f6c08
  Stored in directory: /builddir/.cache/pip/wheels/8b/9d/e9/ff1b52e494a0a5c04e2df1d7fe6cfe934edee8332d52b441a3
Successfully built extractcode
+ sphinx-build-3 -b html docs/source html
Running Sphinx v8.1.3
loading translations [en]... done
making output directory... done
loading intersphinx inventory 'aboutcode' from https://aboutcode.readthedocs.io/en/latest/objects.inv ...
loading intersphinx inventory 'scancode-workbench' from https://scancode-workbench.readthedocs.io/en/develop/objects.inv ...
WARNING: failed to reach any of the inventories with the following issues:
intersphinx inventory 'https://scancode-workbench.readthedocs.io/en/develop/objects.inv' not fetchable due to <class 'requests.exceptions.ConnectionError'>: HTTPSConnectionPool(host='scancode-workbench.readthedocs.io', port=443): Max retries exceeded with url: /en/develop/objects.inv (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fe03da9cd70>: Failed to resolve 'scancode-workbench.readthedocs.io' ([Errno -3] Temporary failure in name resolution)"))
WARNING: failed to reach any of the inventories with the following issues:
intersphinx inventory 'https://aboutcode.readthedocs.io/en/latest/objects.inv' not fetchable due to <class 'requests.exceptions.ConnectionError'>: HTTPSConnectionPool(host='aboutcode.readthedocs.io', port=443): Max retries exceeded with url: /en/latest/objects.inv (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fe03da91f90>: Failed to resolve 'aboutcode.readthedocs.io' ([Errno -3] Temporary failure in name resolution)"))
building [mo]: targets for 0 po files that are out of date
writing output... 
building [html]: targets for 2 source files that are out of date
updating environment: [new config] 2 added, 0 changed, 0 removed
reading sources... [ 50%] contribute/contrib_doc
reading sources... [100%] index

looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
copying assets... 
copying static files... 
Writing evaluated template result to /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/html/_static/basic.css
Writing evaluated template result to /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/html/_static/documentation_options.js
Writing evaluated template result to /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/html/_static/language_data.js
Writing evaluated template result to /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/html/_static/js/versions.js
copying static files: done
copying extra files... 
copying extra files: done
copying assets: done
writing output... [ 50%] contribute/contrib_doc
writing output... [100%] index

generating indices... genindex done
writing additional pages... search done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 2 warnings.

The HTML pages are in html.
+ rm -rf html/.doctrees html/.buildinfo
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.kcadST
+ umask 022
+ cd /builddir/build/BUILD/python-extractcode-31.0.0-build
+ '[' /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT '!=' / ']'
+ rm -rf /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT
++ dirname /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT
+ mkdir -p /builddir/build/BUILD/python-extractcode-31.0.0-build
+ mkdir /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ export FCFLAGS
+ VALAFLAGS=-g
+ export VALAFLAGS
+ RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn'
+ export RUSTFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes '
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
+ cd extractcode-31.0.0
++ ls /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/pyproject-wheeldir/extractcode-31.0.0-py3-none-any.whl
++ sed -E 's/([^-]+)-([^-]+)-.+\.whl/\1==\2/'
++ xargs basename --multiple
+ specifier=extractcode==31.0.0
+ '[' -z extractcode==31.0.0 ']'
+ TMPDIR=/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir
+ /usr/bin/python3 -m pip install --root /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT --prefix /usr --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/pyproject-wheeldir extractcode==31.0.0
Using pip 24.3.1 from /usr/lib/python3.13/site-packages/pip (python 3.13)
Looking in links: /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/pyproject-wheeldir
Processing ./pyproject-wheeldir/extractcode-31.0.0-py3-none-any.whl
Installing collected packages: extractcode
  Creating /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/bin
  changing mode of /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/bin/extractcode to 755
Successfully installed extractcode-31.0.0
+ '[' -d /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/bin ']'
+ '[' -z sP ']'
+ shebang_flags=-kasP
+ /usr/bin/python3 -B /usr/lib/rpm/redhat/pathfix.py -pni /usr/bin/python3 -kasP /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/bin/extractcode
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/bin/extractcode: updating
+ rm -rfv /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/bin/__pycache__
+ rm -f /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-ghost-distinfo
+ site_dirs=()
+ '[' -d /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages ']'
+ site_dirs+=("/usr/lib/python3.13/site-packages")
+ '[' /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib64/python3.13/site-packages '!=' /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages ']'
+ '[' -d /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib64/python3.13/site-packages ']'
+ for site_dir in ${site_dirs[@]}
+ for distinfo in /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT$site_dir/*.dist-info
+ echo '%ghost /usr/lib/python3.13/site-packages/extractcode-31.0.0.dist-info'
+ sed -i s/pip/rpm/ /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode-31.0.0.dist-info/INSTALLER
+ PYTHONPATH=/usr/lib/rpm/redhat
+ /usr/bin/python3 -B /usr/lib/rpm/redhat/pyproject_preprocess_record.py --buildroot /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT --record /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode-31.0.0.dist-info/RECORD --output /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-record
+ rm -fv /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode-31.0.0.dist-info/RECORD
removed '/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode-31.0.0.dist-info/RECORD'
+ rm -fv /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode-31.0.0.dist-info/REQUESTED
removed '/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode-31.0.0.dist-info/REQUESTED'
++ wc -l /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-ghost-distinfo
++ cut -f1 '-d '
+ lines=1
+ '[' 1 -ne 1 ']'
+ RPM_FILES_ESCAPE=4.19
+ /usr/bin/python3 /usr/lib/rpm/redhat/pyproject_save_files.py --output-files /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-files --output-modules /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-modules --buildroot /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT --sitelib /usr/lib/python3.13/site-packages --sitearch /usr/lib64/python3.13/site-packages --python-version 3.13 --pyproject-record /builddir/build/BUILD/python-extractcode-31.0.0-build/python-extractcode-31.0.0-6.fc43.x86_64-pyproject-record --prefix /usr extractcode
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip /usr/bin/strip
+ /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
+ /usr/lib/rpm/brp-remove-la-files
+ env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j2
Bytecompiling .py files below /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13 using python3.13
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/bin/add-determinism --brp -j2 /builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/api.cpython-313.pyc: rewriting with normalized contents
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/__init__.cpython-313.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/cli.cpython-313.pyc: rewriting with normalized contents
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/extract.cpython-313.pyc: rewriting with normalized contents
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/archive.cpython-313.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/patch.cpython-313.pyc: rewriting with normalized contents
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/libarchive2.cpython-313.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/uncompress.cpython-313.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/vmimage.cpython-313.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/sevenzip.cpython-313.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/__init__.cpython-313.opt-1.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/archive.cpython-313.opt-1.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/sevenzip.cpython-313.opt-1.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/uncompress.cpython-313.opt-1.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/vmimage.cpython-313.opt-1.pyc: replacing with normalized version
/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages/extractcode/__pycache__/libarchive2.cpython-313.opt-1.pyc: replacing with normalized version
Scanned 9 directories and 42 files,
               processed 16 inodes,
               16 modified (12 replaced + 4 rewritten),
               0 unsupported format, 0 errors
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.XUjbrN
+ umask 022
+ cd /builddir/build/BUILD/python-extractcode-31.0.0-build
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ export FCFLAGS
+ VALAFLAGS=-g
+ export VALAFLAGS
+ RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn'
+ export RUSTFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes '
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
+ cd extractcode-31.0.0
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes '
+ PATH=/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
+ PYTHONPATH=/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib64/python3.13/site-packages:/builddir/build/BUILD/python-extractcode-31.0.0-build/BUILDROOT/usr/lib/python3.13/site-packages
+ PYTHONDONTWRITEBYTECODE=1
+ PYTEST_ADDOPTS=' --ignore=/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/.pyproject-builddir'
+ PYTEST_XDIST_AUTO_NUM_WORKERS=2
+ /usr/bin/pytest -k 'not TestExtractVmImage and not test_get_extractor_qcow2 and not test_extract_rar_with_trailing_data and not test_extractcode_command_can_take_an_empty_directory and not test_extractcode_command_does_extract_verbose and not test_extractcode_command_always_shows_something_if_not_using_a_tty_verbose_or_not and not test_extractcode_command_works_with_relative_paths and not test_extractcode_command_works_with_relative_paths_verbose and not test_usage_and_help_return_a_correct_script_name_on_all_platforms and not test_extractcode_command_can_extract_archive_with_unicode_names_verbose and not test_extractcode_command_can_extract_archive_with_unicode_names and not test_extractcode_command_can_extract_shallow and not test_extractcode_command_can_ignore and not test_extractcode_command_does_not_crash_with_replace_originals_and_corrupted_archives and not test_extractcode_command_can_extract_nuget'
============================= test session starts ==============================
platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0
rootdir: /builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0
configfile: pyproject.toml
collected 560 items / 17 deselected / 543 selected

tests/test_archive.py F.....................F..............FFFFFFFFFF... [  9%]
....xFFFFFFFF.....FF..F.FFFFFFFFFFxsFFFFFFFF....FFFFFFFFFFF.FFFFFFFFFFFF [ 22%]
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFFFFFFFF.FFFFF......xxFFFFF.FF.FF.F [ 35%]
F.FF.FFFFFFFFFFFsssssFFFFxFFsssssssssssssssssssssFFFF                    [ 45%]
tests/test_extract.py .FFFFFFFFF.FFFFFFFFFFFFFFFFsF..FF.F..              [ 52%]
tests/test_extractcode.py ...                                            [ 52%]
tests/test_extractcode_api.py F                                          [ 53%]
tests/test_libarchive2.py F                                              [ 53%]
tests/test_patch.py ssssssssssssssssssssssssssssssssssssssssssssssssssss [ 62%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 76%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 89%]
sss                                                                      [ 89%]
tests/test_sevenzip.py F....F..s.s...F..........................FFFFFFFF [ 98%]
F....                                                                    [ 99%]
tests/test_skeleton_codestyle.py .                                       [100%]

=================================== FAILURES ===================================
_____ TestGetExtractorTest.test_7zip_extract_can_extract_to_relative_paths _____

self = <test_archive.TestGetExtractorTest testMethod=test_7zip_extract_can_extract_to_relative_paths>

    def test_7zip_extract_can_extract_to_relative_paths(self):
        # The setup is a tad complex because we want to have a relative dir
        # to the base dir where we run tests from, i.e. the git checkout dir.
        # To use relative paths, we use our tmp dir at the root of the code tree
        from os.path import join, abspath
        import tempfile
        import shutil
        from extractcode.sevenzip import extract
    
        test_file = self.get_test_loc('archive/relative_path/basic.zip', copy=True)
    
        project_tmp = join(project_root, 'tmp')
        fileutils.create_dir(project_tmp)
        project_root_abs = abspath(project_root)
        test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root_abs, '').strip('\\/')
        test_tgt_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root_abs, '').strip('\\/')
        shutil.copy(test_file, test_src_dir)
        test_src_file = join(test_src_dir, 'basic.zip')
>       result = list(extract(test_src_file, test_tgt_dir))

tests/test_archive.py:308: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...sic.zip\nType = zip\nPhysical Size = 880\n\nEverything is Ok\n\nFolders: 4\nFiles: 3\nSize:       6\nCompressed: 880\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestGetExtractorTest.test_get_extractors_2 __________________

self = <test_archive.TestGetExtractorTest testMethod=test_get_extractors_2>

    def test_get_extractors_2(self):
        test_file = 'archive/rar/basic.rar'
        expected = [archive.extract_rar]
>       self.check_get_extractors(test_file, expected)

tests/test_archive.py:63: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestGetExtractorTest testMethod=test_get_extractors_2>
test_file = 'archive/rar/basic.rar'
expected = [<function extract at 0x7f6f5bf6c720>], kinds = ()

    def check_get_extractors(self, test_file, expected, kinds=()):
        from extractcode import archive
    
        test_loc = self.get_test_loc(test_file)
        if kinds:
            extractors = archive.get_extractors(test_loc, kinds)
        else:
            extractors = archive.get_extractors(test_loc)
    
        fe = fileutils.file_extension(test_loc).lower()
        em = ', '.join(e.__module__ + '.' + e.__name__ for e in extractors)
    
        msg = ('%(expected)r == %(extractors)r for %(test_file)s\n'
               'with fe:%(fe)r, em:%(em)s' % locals())
>       assert expected == extractors, msg
E       AssertionError: [<function extract at 0x7f6f5bf6c720>] == [] for archive/rar/basic.rar
E         with fe:'.rar', em:
E       assert [<function ex...7f6f5bf6c720>] == []
E         
E         Left contains one more item: <function extract at 0x7f6f5bf6c720>
E         Use -v to get more diff

tests/extractcode_assert_utils.py:166: AssertionError
_____________________ TestTarGzip.test_extract_targz_basic _____________________

self = <test_archive.TestTarGzip testMethod=test_extract_targz_basic>

    def test_extract_targz_basic(self):
        test_file = self.get_test_loc('archive/tgz/tarred_gzipped.tar.gz')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:329: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'e/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
____________________ TestTarGzip.test_extract_targz_broken _____________________

self = <extractcode.libarchive2.Archive object at 0x7f6f5ab7c910>

    def open(self):
        """
        Open the archive for reading. You must call close() when done to free up
        resources and avoid leaks. Or use instead the Archive class as a context
        manager with the "with" keyword.
        """
        # first close any existing opened struct for this file
        self.close()
        self.archive_struct = archive_reader()
        if self.uncompress:
            use_all_filters(self.archive_struct)
        if extract:
            use_all_formats(self.archive_struct)
        try:
            # TODO: ensure that we have proper exceptions raised?
>           open_file(self.archive_struct, self.location, self.block_size)
E           ctypes.ArgumentError: argument 2: TypeError: 'str' object cannot be interpreted as ctypes.c_char_p

src/extractcode/libarchive2.py:273: ArgumentError

During handling of the above exception, another exception occurred:

self = <test_archive.TestTarGzip testMethod=test_extract_targz_broken>
excInstance = Exception('Unrecognized archive format')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/tgz/broken.tar.gz', '/tmp/scancode-tk-tests -h5oxlfwx/izrj1u6h')
kwargs = {}, excClass = <class 'Exception'>

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:164: in extract
    for entry in list_entries(abs_location):
src/extractcode/libarchive2.py:220: in list_entries
    with Archive(abs_location) as archive:
src/extractcode/libarchive2.py:318: in __enter__
    return self.open()
src/extractcode/libarchive2.py:275: in open
    open_file_w(self.archive_struct, self.location, self.block_size)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

rc = -30, archive_func = <_FuncPtr object at 0x7f6f5b715c10>
args = (93938335519136, '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/tgz/broken.tar.gz', 10240)
null = False

    def errcheck(rc, archive_func, args, null=False):
        """
        ctypes error check handler for functions returning int, or null if null is
        True.
        """
        if null:
            if rc is None:
                archive_struct = args and len(args) > 1 and args[0] or None
                raise ArchiveError(rc, archive_struct, archive_func)
            else:
                return rc
    
        if rc >= ARCHIVE_OK:
            return rc
    
        archive_struct = args[0]
        if rc == ARCHIVE_RETRY:
            raise ArchiveErrorRetryable(rc, archive_struct, archive_func)
    
        if rc == ARCHIVE_WARN:
            raise ArchiveWarning(rc, archive_struct, archive_func)
    
        # anything else is a serious error, in general not recoverable.
>       raise ArchiveError(rc, archive_struct, archive_func)
E       extractcode.libarchive2.ArchiveError: <exception str() failed>

src/extractcode/libarchive2.py:586: ArchiveError

During handling of the above exception, another exception occurred:

self = <test_archive.TestTarGzip testMethod=test_extract_targz_broken>

    def test_extract_targz_broken(self):
        test_file = self.get_test_loc('archive/tgz/broken.tar.gz')
        test_dir = self.get_temp_dir()
        expected = Exception('Unrecognized archive format')
>       self.assertRaisesInstance(expected, archive.extract_tar, test_file, test_dir)

tests/test_archive.py:344: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestTarGzip testMethod=test_extract_targz_broken>
excInstance = Exception('Unrecognized archive format')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/tgz/broken.tar.gz', '/tmp/scancode-tk-tests -h5oxlfwx/izrj1u6h')
kwargs = {}, excClass = <class 'Exception'>

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           TypeError: __str__ returned non-string (type bytes)

tests/extractcode_assert_utils.py:178: TypeError
_____ TestTarGzip.test_extract_targz_from_apache_should_not_return_errors ______

self = <test_archive.TestTarGzip testMethod=test_extract_targz_from_apache_should_not_return_errors>

    def test_extract_targz_from_apache_should_not_return_errors(self):
        # from http://archive.apache.org/dist/commons/logging/source/commons-logging-1.1.2-src.tar.gz
        # failed with ReadError('not a bzip2 file',)
        test_file = self.get_test_loc('archive/tgz/commons-logging-1.1.2-src.tar.gz')
        test_dir = self.get_temp_dir()
        extractor = archive.get_extractor(test_file)
        assert archive.extract_tar == extractor
>       result = archive.extract_tar(test_file, test_dir)

tests/test_archive.py:422: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'commons-logging-1.1.2-src/build.properties.sample'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
___________________ TestTarGzip.test_extract_targz_symlinks ____________________

self = <test_archive.TestTarGzip testMethod=test_extract_targz_symlinks>

    def test_extract_targz_symlinks(self):
        test_file = self.get_test_loc('archive/tgz/symlink.tar.gz')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:402: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'z/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
______________ TestTarGzip.test_extract_targz_with_absolute_path _______________

self = <test_archive.TestTarGzip testMethod=test_extract_targz_with_absolute_path>

    def test_extract_targz_with_absolute_path(self):
        non_result = '/tmp/subdir'
        assert not os.path.exists(non_result)
    
        test_dir = self.get_temp_dir()
        test_file = self.get_test_loc('archive/tgz/absolute_path.tar.gz')
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:352: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'/tmp/subdir/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
__________ TestTarGzip.test_extract_targz_with_mixed_case_and_symlink __________

self = <test_archive.TestTarGzip testMethod=test_extract_targz_with_mixed_case_and_symlink>

    def test_extract_targz_with_mixed_case_and_symlink(self):
        test_file = self.get_test_loc('archive/tgz/mixed_case_and_symlink.tgz')
        test_dir = self.get_temp_dir()
>       result = archive.extract_tar(test_file, test_dir)

tests/test_archive.py:394: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'skinenigmang/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
______________ TestTarGzip.test_extract_targz_with_relative_path _______________

self = <test_archive.TestTarGzip testMethod=test_extract_targz_with_relative_path>

    def test_extract_targz_with_relative_path(self):
        test_file = self.get_test_loc('archive/tgz/relative.tar.gz')
        """
        This test file was created with:
            import tarfile
            tar = tarfile.open("TarTest.tar.gz", "w:gz")
            tar.add('a.txt', '../a_parent_folder.txt')
            tar.add('b.txt', '../../another_folder/b_two_root.txt')
            tar.add('b.txt', '../folder/subfolder/b_subfolder.txt')
            tar.close()
        """
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:369: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'../a_parent_folder.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
______________ TestTarGzip.test_extract_targz_with_trailing_data _______________

self = <test_archive.TestTarGzip testMethod=test_extract_targz_with_trailing_data>

    def test_extract_targz_with_trailing_data(self):
        test_file = self.get_test_loc('archive/tgz/trailing.tar.gz')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:336: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'a.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
______________ TestTarGzip.test_extract_targz_with_trailing_data2 ______________

self = <test_archive.TestTarGzip testMethod=test_extract_targz_with_trailing_data2>

    def test_extract_targz_with_trailing_data2(self):
        test_dir1 = self.get_temp_dir()
        test_file = self.get_test_loc('archive/tgz/trailing2.tar.gz')
>       archive.extract_tar(test_file, test_dir1)

tests/test_archive.py:384: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'tmp/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_ TestTarGzip.test_extract_targz_with_unicode_path_should_extract_without_error _

self = <test_archive.TestTarGzip testMethod=test_extract_targz_with_unicode_path_should_extract_without_error>

    def test_extract_targz_with_unicode_path_should_extract_without_error(self):
        test_file = self.get_test_loc('archive/tgz/tgz_unicode.tgz')
        test_dir = self.get_temp_dir()
        extractor = archive.get_extractor(test_file)
        assert archive.extract_tar == extractor
>       result = archive.extract_tar(test_file, test_dir)

tests/test_archive.py:431: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'unicodepath/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
________________ TestTarBz2.test_extract_tar_bz2_absolute_path _________________

self = <test_archive.TestTarBz2 testMethod=test_extract_tar_bz2_absolute_path>

    def test_extract_tar_bz2_absolute_path(self):
        assert not os.path.exists('/tmp/subdir')
        test_dir = self.get_temp_dir()
        test_file = self.get_test_loc('archive/tbz/absolute_path.tar.bz2')
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:538: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'/tmp/subdir/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
____________________ TestTarBz2.test_extract_tar_bz2_basic _____________________

self = <test_archive.TestTarBz2 testMethod=test_extract_tar_bz2_basic>

    def test_extract_tar_bz2_basic(self):
        test_file = self.get_test_loc('archive/tbz/tarred_bzipped.tar.bz2')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:510: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'e/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
___________________ TestTarBz2.test_extract_tar_bz2_basic_bz ___________________

self = <test_archive.TestTarBz2 testMethod=test_extract_tar_bz2_basic_bz>

    def test_extract_tar_bz2_basic_bz(self):
        test_file = self.get_test_loc('archive/tbz/tarred_bzipped.bz')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:517: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'e/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
____________________ TestTarBz2.test_extract_tar_bz2_broken ____________________

self = <extractcode.libarchive2.Archive object at 0x7f6f5ad9d8d0>

    def open(self):
        """
        Open the archive for reading. You must call close() when done to free up
        resources and avoid leaks. Or use instead the Archive class as a context
        manager with the "with" keyword.
        """
        # first close any existing opened struct for this file
        self.close()
        self.archive_struct = archive_reader()
        if self.uncompress:
            use_all_filters(self.archive_struct)
        if extract:
            use_all_formats(self.archive_struct)
        try:
            # TODO: ensure that we have proper exceptions raised?
>           open_file(self.archive_struct, self.location, self.block_size)
E           ctypes.ArgumentError: argument 2: TypeError: 'str' object cannot be interpreted as ctypes.c_char_p

src/extractcode/libarchive2.py:273: ArgumentError

During handling of the above exception, another exception occurred:

self = <test_archive.TestTarBz2 testMethod=test_extract_tar_bz2_broken>
excInstance = Exception('bzip decompression failed')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/tbz/tarred_bzipped_broken.tar.bz2', '/tmp/scancode-tk-tests -h5oxlfwx/1jefezx4')
kwargs = {}, excClass = <class 'Exception'>

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:164: in extract
    for entry in list_entries(abs_location):
src/extractcode/libarchive2.py:220: in list_entries
    with Archive(abs_location) as archive:
src/extractcode/libarchive2.py:318: in __enter__
    return self.open()
src/extractcode/libarchive2.py:275: in open
    open_file_w(self.archive_struct, self.location, self.block_size)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

rc = -30, archive_func = <_FuncPtr object at 0x7f6f5b715c10>
args = (93938336818880, '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/tbz/tarred_bzipped_broken.tar.bz2', 10240)
null = False

    def errcheck(rc, archive_func, args, null=False):
        """
        ctypes error check handler for functions returning int, or null if null is
        True.
        """
        if null:
            if rc is None:
                archive_struct = args and len(args) > 1 and args[0] or None
                raise ArchiveError(rc, archive_struct, archive_func)
            else:
                return rc
    
        if rc >= ARCHIVE_OK:
            return rc
    
        archive_struct = args[0]
        if rc == ARCHIVE_RETRY:
            raise ArchiveErrorRetryable(rc, archive_struct, archive_func)
    
        if rc == ARCHIVE_WARN:
            raise ArchiveWarning(rc, archive_struct, archive_func)
    
        # anything else is a serious error, in general not recoverable.
>       raise ArchiveError(rc, archive_struct, archive_func)
E       extractcode.libarchive2.ArchiveError: <exception str() failed>

src/extractcode/libarchive2.py:586: ArchiveError

During handling of the above exception, another exception occurred:

self = <test_archive.TestTarBz2 testMethod=test_extract_tar_bz2_broken>

    def test_extract_tar_bz2_broken(self):
        test_file = self.get_test_loc('archive/tbz/tarred_bzipped_broken.tar.bz2')
        test_dir = self.get_temp_dir()
        expected = Exception('bzip decompression failed')
>       self.assertRaisesInstance(expected, archive.extract_tar, test_file, test_dir)

tests/test_archive.py:532: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestTarBz2 testMethod=test_extract_tar_bz2_broken>
excInstance = Exception('bzip decompression failed')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/tbz/tarred_bzipped_broken.tar.bz2', '/tmp/scancode-tk-tests -h5oxlfwx/1jefezx4')
kwargs = {}, excClass = <class 'Exception'>

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           TypeError: __str__ returned non-string (type bytes)

tests/extractcode_assert_utils.py:178: TypeError
___________________ TestTarBz2.test_extract_tar_bz2_iproute ____________________

self = <test_archive.TestTarBz2 testMethod=test_extract_tar_bz2_iproute>

    def test_extract_tar_bz2_iproute(self):
        test_file = self.get_test_loc('archive/tbz/iproute2.tar.bz2')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:568: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'iproute2/README'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_________________ TestTarBz2.test_extract_tar_bz2_multistream __________________

self = <test_archive.TestTarBz2 testMethod=test_extract_tar_bz2_multistream>

    def test_extract_tar_bz2_multistream(self):
        test_file = self.get_test_loc('archive/tbz/bzip2_multistream/example-file.csv.tar.bz2')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:575: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'example-file.csv'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
________________ TestTarBz2.test_extract_tar_bz2_relative_path _________________

self = <test_archive.TestTarBz2 testMethod=test_extract_tar_bz2_relative_path>

    def test_extract_tar_bz2_relative_path(self):
        """
        This test file was created with:
            import tarfile
            tar = tarfile.open("TarTest.tar.gz", "w:bz")
            tar.add('a.txt', '../a_parent_folder.txt')
            tar.add('b.txt', '../../another_folder/b_two_root.txt')
            tar.add('b.txt', '../folder/subfolder/b_subfolder.txt')
            tar.close()
        """
        test_file = self.get_test_loc('archive/tbz/bz2withtar_relative.tar.bz2')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:555: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'../a_parent_folder.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
___ TestTarBz2.test_extract_tar_bz2_with_trailing_data__and_wrong_extension ____

self = <test_archive.TestTarBz2 testMethod=test_extract_tar_bz2_with_trailing_data__and_wrong_extension>

    def test_extract_tar_bz2_with_trailing_data__and_wrong_extension(self):
        test_file = self.get_test_loc('archive/tbz/single_file_trailing_data.tar.gz')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:524: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'a.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_ TestSevenzipBz2.test_sevenzip_extract_can_handle_bz2_multistream_differently _

self = <test_archive.TestSevenzipBz2 testMethod=test_sevenzip_extract_can_handle_bz2_multistream_differently>

    def test_sevenzip_extract_can_handle_bz2_multistream_differently(self):
        test_file = self.get_test_loc('archive/bz2/bzip2_multistream/example-file.csv.bz2')
        test_dir = self.get_temp_dir()
>       sevenzip.extract(test_file, test_dir)

tests/test_archive.py:624: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...2/bzip2_multistream/example-file.csv.bz2\nType = bzip2\n\nEverything is Ok\n\nSize:       909602\nCompressed: 103446\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestShellArchives.test_extract_springboot ___________________

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/87k0hlyx'
expected = ['META-INF/MANIFEST.MF', 'application.properties'], regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
>           assert result == expected_content
E           AssertionError: assert [] == ['META-INF/MA...n.properties']
E             
E             Right contains 2 more items, first extra item: 'META-INF/MANIFEST.MF'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:83: AssertionError

During handling of the above exception, another exception occurred:

self = <test_archive.TestShellArchives testMethod=test_extract_springboot>

    def test_extract_springboot(self):
        # a self executable springboot Jar is a zip with a shell script prefix
        test_file = self.get_test_loc('archive/shar/demo-spring-boot.jar')
        test_dir = self.get_temp_dir()
        result = archive.extract_springboot(test_file, test_dir)
        assert [] == result
        expected = ['META-INF/MANIFEST.MF', 'application.properties']
>       check_files(test_dir, expected)

tests/test_archive.py:642: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/87k0hlyx'
expected = ['META-INF/MANIFEST.MF', 'application.properties'], regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
            assert result == expected_content
        except AssertionError:
            files = [
                'test_dir: file://{}'.format(test_dir),
                'expected: file://{}'.format(expected if expected_is_json_file else ''),
            ]
>           assert result == files + expected_content
E           AssertionError: assert [] == ['test_dir: f...n.properties']
E             
E             Right contains 4 more items, first extra item: 'test_dir: file:///tmp/scancode-tk-tests -h5oxlfwx/87k0hlyx'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:89: AssertionError
________________________ TestZip.test_extract_zip_basic ________________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/basic.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/pkhv0dei'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'c/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_basic>

    def test_extract_zip_basic(self):
        test_file = self.get_test_loc('archive/zip/basic.zip')
        test_dir = self.get_temp_dir()
>       result = archive.extract_zip(test_file, test_dir)

tests/test_archive.py:660: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...sic.zip\nType = zip\nPhysical Size = 880\n\nEverything is Ok\n\nFolders: 4\nFiles: 3\nSize:       6\nCompressed: 880\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______ TestZip.test_extract_zip_can_extract_windows_media_player_skins ________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/wmz/Go.wmz'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/npr9i7wm'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'32px.png'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_can_extract_windows_media_player_skins>

    def test_extract_zip_can_extract_windows_media_player_skins(self):
        test_file = self.get_test_loc('archive/wmz/Go.wmz')
        test_dir = self.get_temp_dir()
>       result = archive.extract_zip(test_file, test_dir)

tests/test_archive.py:1048: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ive/wmz/Go.wmz\nType = zip\nPhysical Size = 3654\n\nEverything is Ok\n\nFiles: 3\nSize:       3900\nCompressed: 3654\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_ TestZip.test_extract_zip_can_extract_zip_with_directory_not_marked_with_trailing_slash _

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/directory-with-no-trailing-slash.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/nb0de8c9'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'online_upgrade_img/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_can_extract_zip_with_directory_not_marked_with_trailing_slash>

    def test_extract_zip_can_extract_zip_with_directory_not_marked_with_trailing_slash(self):
        test_file = self.get_test_loc('archive/zip/directory-with-no-trailing-slash.zip')
        test_dir = self.get_temp_dir()
>       result = archive.extract_zip(test_file, test_dir)

tests/test_archive.py:1063: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ash.zip\nType = zip\nPhysical Size = 346\n\nEverything is Ok\n\nFolders: 1\nFiles: 1\nSize:       2\nCompressed: 346\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
______________________ TestZip.test_extract_zip_java_jar _______________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/jar/simple.jar'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/8igubz4e'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'META-INF/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_java_jar>

    def test_extract_zip_java_jar(self):
        test_file = self.get_test_loc('archive/zip/jar/simple.jar')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:925: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ar\nType = zip\nPhysical Size = 7073\n\nEverything is Ok\n\nFolders: 7\nFiles: 7\nSize:       4755\nCompressed: 7073\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
______________ TestZip.test_extract_zip_with_backslash_in_path_1 _______________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/backslash/backslash1.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/6nhe7lki'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'scripts/AutomaticClose.int'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_backslash_in_path_1>

    def test_extract_zip_with_backslash_in_path_1(self):
        test_file = self.get_test_loc('archive/zip/backslash/backslash1.zip')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:983: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...p/backslash/backslash1.zip\nType = zip\nPhysical Size = 413\n\nEverything is Ok\n\nSize:       1121\nCompressed: 413\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
______________ TestZip.test_extract_zip_with_backslash_in_path_2 _______________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/backslash/AspectJTest.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/9v9opdcj'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'AspectJTest/.classpath'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_backslash_in_path_2>

    def test_extract_zip_with_backslash_in_path_2(self):
        test_file = self.get_test_loc('archive/zip/backslash/AspectJTest.zip')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:996: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...pectJTest.zip\nType = zip\nPhysical Size = 8537\n\nEverything is Ok\n\nFiles: 22\nSize:       9496\nCompressed: 8537\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
______________ TestZip.test_extract_zip_with_backslash_in_path_3 _______________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/backslash/boo-0.3-src.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/fz9aog50'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'src/Boo.Lang.Compiler/Ast/CallableDefinition.cs'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_backslash_in_path_3>

    def test_extract_zip_with_backslash_in_path_3(self):
        test_file = self.get_test_loc('archive/zip/backslash/boo-0.3-src.zip')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:1026: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...-src.zip\nType = zip\nPhysical Size = 84230\n\nEverything is Ok\n\nFiles: 158\nSize:       126288\nCompressed: 84230\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
___________ TestZip.test_extract_zip_with_duplicated_lowercase_paths ___________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/dup_names.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/h7f8s_oo'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'META-INF/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_duplicated_lowercase_paths>

    def test_extract_zip_with_duplicated_lowercase_paths(self):
        test_file = self.get_test_loc('archive/zip/dup_names.zip')
        expected = {'META-INF/license/': None,  # a directory
                    'META-INF/license/LICENSE.base64.txt': 1618,
                    'META-INF/LICENSE_1': 11366}
>       self.check_extract(archive.extract_zip, test_file, expected)

tests/test_archive.py:950: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/extractcode_assert_utils.py:203: in check_extract
    warnings = test_function(test_file, test_dir)
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...p\nType = zip\nPhysical Size = 5198\n\nEverything is Ok\n\nFolders: 2\nFiles: 2\nSize:       12984\nCompressed: 5198\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestZip.test_extract_zip_with_invalid_path __________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/zip_invalidpath.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/16c98xzm'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'this/that'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_invalid_path>

    def test_extract_zip_with_invalid_path(self):
        test_file = self.get_test_loc('archive/zip/zip_invalidpath.zip')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:675: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...hive/zip/zip_invalidpath.zip\nType = zip\nPhysical Size = 165\n\nEverything is Ok\n\nSize:       15\nCompressed: 165\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
____________________ TestZip.test_extract_zip_with_password ____________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/zip_password_nexb.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/7rqiogpz'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'a.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_password>

    def test_extract_zip_with_password(self):
        test_file = self.get_test_loc('archive/zip/zip_password_nexb.zip')
        test_dir = self.get_temp_dir()
        try:
>           archive.extract_zip(test_file, test_dir)

tests/test_archive.py:917: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...nexb.zip\nType = zip\nPhysical Size = 133\n\n\nSub items Errors: 1\n\nArchives with Errors: 1\n\nSub items Errors: 1\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_password>

    def test_extract_zip_with_password(self):
        test_file = self.get_test_loc('archive/zip/zip_password_nexb.zip')
        test_dir = self.get_temp_dir()
        try:
            archive.extract_zip(test_file, test_dir)
        except Exception as e:
>           assert isinstance(e, ExtractErrorFailedToExtract)
E           AssertionError: assert False
E            +  where False = isinstance(TypeError('normalize() argument 2 must be str, not bytes'), ExtractErrorFailedToExtract)

tests/test_archive.py:919: AssertionError
__________ TestZip.test_extract_zip_with_relative_path_deeply_nested ___________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/relative_nested.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/csrq8vei'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'../../../../../../../../../../../../a_parent_folder.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_relative_path_deeply_nested>

    def test_extract_zip_with_relative_path_deeply_nested(self):
        test_file = self.get_test_loc('archive/zip/relative_nested.zip')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:827: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ative_nested.zip\nType = zip\nPhysical Size = 1060\n\nEverything is Ok\n\nFiles: 4\nSize:       36\nCompressed: 1060\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__ TestZip.test_extract_zip_with_relative_path_deeply_nested_with_libarchive ___

self = <test_archive.TestZip testMethod=test_extract_zip_with_relative_path_deeply_nested_with_libarchive>

    def test_extract_zip_with_relative_path_deeply_nested_with_libarchive(self):
        test_file = self.get_test_loc('archive/zip/relative_nested.zip')
        test_dir = self.get_temp_dir()
>       libarchive2.extract(test_file, test_dir)

tests/test_archive.py:909: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'../../../../../../../../../../../../a_parent_folder.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
______ TestZip.test_extract_zip_with_relative_path_using_default_function ______

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/relative_parent_folders.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/82n2irba'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'../a_parent_folder.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_relative_path_using_default_function>

    def test_extract_zip_with_relative_path_using_default_function(self):
        # The test files for this test and the next one were created with:
        # from zipfile import ZipFile
        # f = open('/tmp/a.txt', 'w')
        # f.write('some data')
        # f.close()
        # f = open('/tmp/b.txt', 'w')
        # f.write('some data')
        # f.close()
        # f = ZipFile(os.path.join(self.get_test_loc('archive'), 'relative_parent_folders.zip'), 'w')
        # f.write('/tmp/a.txt', '../a_parent_folder.txt')
        # f.write('/tmp/b.txt', '../../another_folder/b_two_root.txt')
        # f.write('/tmp/b.txt', '../folder/subfolder/b_subfolder.txt')
        # f.close()
        # f = ZipFile(os.path.join(self.get_test_loc('archive'), 'high_ancest.zip'), 'w')
        # f.write('/tmp/a.txt', ('../' * 12) +  'a_parent_folder.txt')
        # f.write('/tmp/a.txt', ('../' * 12) +  ('sub/' * 6) + 'a_parent_folder_in_sub_1.txt')
        # f.write('/tmp/a.txt', ('../' * 6) +  ('sub/' * 12) + 'a_parent_folder_in_sub_2.txt')
        # f.write('/tmp/a.txt', ('../' * 12) +  ('sub/' * 12) + 'a_parent_folder_in_sub_3.txt')
        # f.close()
    
        test_file = self.get_test_loc('archive/zip/relative_parent_folders.zip')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:729: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...parent_folders.zip\nType = zip\nPhysical Size = 461\n\nEverything is Ok\n\nFiles: 3\nSize:       27\nCompressed: 461\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_________ TestZip.test_extract_zip_with_relative_path_using_libarchive _________

self = <test_archive.TestZip testMethod=test_extract_zip_with_relative_path_using_libarchive>

    def test_extract_zip_with_relative_path_using_libarchive(self):
        test_file = self.get_test_loc('archive/zip/relative_parent_folders.zip')
        test_dir = self.get_temp_dir()
>       result = libarchive2.extract(test_file, test_dir)

tests/test_archive.py:750: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'../a_parent_folder.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
____________________ TestZip.test_extract_zip_with_timezone ____________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/timezone/c.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/u7kx7uhh'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'c/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_timezone>

    def test_extract_zip_with_timezone(self):
        test_file = self.get_test_loc('archive/zip/timezone/c.zip')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:955: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...e/c.zip\nType = zip\nPhysical Size = 880\n\nEverything is Ok\n\nFolders: 4\nFiles: 3\nSize:       6\nCompressed: 880\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
___________________ TestZip.test_extract_zip_with_timezone_2 ___________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/timezone/projecttest.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/x6o_tjxe'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'primes.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_timezone_2>

    def test_extract_zip_with_timezone_2(self):
        test_file = self.get_test_loc('archive/zip/timezone/projecttest.zip')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:969: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...cttest.zip\nType = zip\nPhysical Size = 48778\n\nEverything is Ok\n\nFiles: 2\nSize:       137964\nCompressed: 48778\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_________________ TestZip.test_extract_zip_with_trailing_data __________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/zip_trailing_data.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/lgly2uhy'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'a.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_trailing_data>

    def test_extract_zip_with_trailing_data(self):
        test_file = self.get_test_loc('archive/zip/zip_trailing_data.zip')
        test_dir = self.get_temp_dir()
        try:
>           archive.extract_zip(test_file, test_dir)

tests/test_archive.py:683: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... 121\nTail Size = 9\n\nEverything is Ok\n\nArchives with Warnings: 1\n\nWarnings: 1\nSize:       13\nCompressed: 130\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_________________ TestZip.test_extract_zip_with_trailing_data2 _________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/zip_trailing_data2.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/5le6ushp'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'f1'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_trailing_data2>

    def test_extract_zip_with_trailing_data2(self):
        # test archive created on cygwin with:
        # $ echo "test content" > f1
        # $ zip test f1
        # $ echo "some junk" >> test.zip
        test_file = self.get_test_loc('archive/zip/zip_trailing_data2.zip')
        test_dir = self.get_temp_dir()
        try:
>           archive.extract_zip(test_file, test_dir)

tests/test_archive.py:699: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...167\nTail Size = 10\n\nEverything is Ok\n\nArchives with Warnings: 1\n\nWarnings: 1\nSize:       13\nCompressed: 177\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
___ TestZip.test_extract_zip_with_unicode_path_should_extract_without_error ____

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zip/zip_unicode.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/dql2cwuz'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'zip/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZip testMethod=test_extract_zip_with_unicode_path_should_extract_without_error>

    def test_extract_zip_with_unicode_path_should_extract_without_error(self):
        test_file = self.get_test_loc('archive/zip/zip_unicode.zip')
        test_dir = self.get_temp_dir()
>       result = archive.extract_zip(test_file, test_dir)

tests/test_archive.py:1056: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...de.zip\nType = zip\nPhysical Size = 330\n\nEverything is Ok\n\nFolders: 1\nFiles: 2\nSize:       18\nCompressed: 330\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
______ TestTar.test_extract_python_testtar_tar_archive_with_special_files ______

self = <test_archive.TestTar testMethod=test_extract_python_testtar_tar_archive_with_special_files>

    @pytest.mark.skipif(on_windows, reason='Unicode and/or Long paths are not handled well yet on windows')
    def test_extract_python_testtar_tar_archive_with_special_files(self):
        test_file = self.get_test_loc('archive/tar/testtar.tar')
        # this is from:
        # https://hg.python.org/cpython/raw-file/bff88c866886/Lib/test/testtar.tar
        test_dir = self.get_temp_dir()
>       result = archive.extract_tar(test_file, test_dir)

tests/test_archive.py:1162: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'ustar/conttype'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_________________________ TestTar.test_extract_rubygem _________________________

self = <test_archive.TestTar testMethod=test_extract_rubygem>

    def test_extract_rubygem(self):
        test_file = self.get_test_loc('archive/tar/gem/panchira-0.1.1.gem')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:1204: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'metadata.gz'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
____________________ TestTar.test_extract_tar_absolute_path ____________________

self = <test_archive.TestTar testMethod=test_extract_tar_absolute_path>

    def test_extract_tar_absolute_path(self):
        non_result = '/home/li/Desktop/absolute_folder'
        assert not os.path.exists(non_result)
    
        test_dir = self.get_temp_dir()
        test_file = self.get_test_loc('archive/tar/tar_absolute.tar')
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:1091: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'home/li/Desktop/absolute_folder/absolute_file'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_____________ TestTar.test_extract_tar_archive_with_special_files ______________

self = <test_archive.TestTar testMethod=test_extract_tar_archive_with_special_files>

    def test_extract_tar_archive_with_special_files(self):
        test_file = self.get_test_loc('archive/tar/special.tar')
        test_dir = self.get_temp_dir()
>       result = archive.extract_tar(test_file, test_dir)

tests/test_archive.py:1139: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'0-REGTYPE'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
________________________ TestTar.test_extract_tar_basic ________________________

self = <test_archive.TestTar testMethod=test_extract_tar_basic>

    def test_extract_tar_basic(self):
        test_file = self.get_test_loc('archive/tar/tarred.tar')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:1074: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'e/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_______________________ TestTar.test_extract_tar_broken ________________________

self = <extractcode.libarchive2.Archive object at 0x7f6f5af5cfa0>

    def open(self):
        """
        Open the archive for reading. You must call close() when done to free up
        resources and avoid leaks. Or use instead the Archive class as a context
        manager with the "with" keyword.
        """
        # first close any existing opened struct for this file
        self.close()
        self.archive_struct = archive_reader()
        if self.uncompress:
            use_all_filters(self.archive_struct)
        if extract:
            use_all_formats(self.archive_struct)
        try:
            # TODO: ensure that we have proper exceptions raised?
>           open_file(self.archive_struct, self.location, self.block_size)
E           ctypes.ArgumentError: argument 2: TypeError: 'str' object cannot be interpreted as ctypes.c_char_p

src/extractcode/libarchive2.py:273: ArgumentError

During handling of the above exception, another exception occurred:

self = <test_archive.TestTar testMethod=test_extract_tar_broken>
excInstance = Exception('Unrecognized archive format')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/tar/tarred_broken.tar', '/tmp/scancode-tk-tests -h5oxlfwx/8bj_rwe1')
kwargs = {}, excClass = <class 'Exception'>

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:164: in extract
    for entry in list_entries(abs_location):
src/extractcode/libarchive2.py:220: in list_entries
    with Archive(abs_location) as archive:
src/extractcode/libarchive2.py:318: in __enter__
    return self.open()
src/extractcode/libarchive2.py:275: in open
    open_file_w(self.archive_struct, self.location, self.block_size)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

rc = -30, archive_func = <_FuncPtr object at 0x7f6f5b715c10>
args = (93938335151408, '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/tar/tarred_broken.tar', 10240)
null = False

    def errcheck(rc, archive_func, args, null=False):
        """
        ctypes error check handler for functions returning int, or null if null is
        True.
        """
        if null:
            if rc is None:
                archive_struct = args and len(args) > 1 and args[0] or None
                raise ArchiveError(rc, archive_struct, archive_func)
            else:
                return rc
    
        if rc >= ARCHIVE_OK:
            return rc
    
        archive_struct = args[0]
        if rc == ARCHIVE_RETRY:
            raise ArchiveErrorRetryable(rc, archive_struct, archive_func)
    
        if rc == ARCHIVE_WARN:
            raise ArchiveWarning(rc, archive_struct, archive_func)
    
        # anything else is a serious error, in general not recoverable.
>       raise ArchiveError(rc, archive_struct, archive_func)
E       extractcode.libarchive2.ArchiveError: <exception str() failed>

src/extractcode/libarchive2.py:586: ArchiveError

During handling of the above exception, another exception occurred:

self = <test_archive.TestTar testMethod=test_extract_tar_broken>

    def test_extract_tar_broken(self):
        test_file = self.get_test_loc('archive/tar/tarred_broken.tar')
        test_dir = self.get_temp_dir()
        expected = Exception("Unrecognized archive format")
>       self.assertRaisesInstance(
            expected, archive.extract_tar, test_file, test_dir)

tests/test_archive.py:1082: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestTar testMethod=test_extract_tar_broken>
excInstance = Exception('Unrecognized archive format')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/tar/tarred_broken.tar', '/tmp/scancode-tk-tests -h5oxlfwx/8bj_rwe1')
kwargs = {}, excClass = <class 'Exception'>

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           TypeError: __str__ returned non-string (type bytes)

tests/extractcode_assert_utils.py:178: TypeError
_________________ TestTar.test_extract_tar_with_absolute_path2 _________________

self = <test_archive.TestTar testMethod=test_extract_tar_with_absolute_path2>

    def test_extract_tar_with_absolute_path2(self):
        assert not os.path.exists('/tmp/subdir')
    
        test_file = self.get_test_loc('archive/tar/absolute_path.tar')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:1102: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'/tmp/subdir/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_________________ TestTar.test_extract_tar_with_relative_path __________________

self = <test_archive.TestTar testMethod=test_extract_tar_with_relative_path>

    def test_extract_tar_with_relative_path(self):
        test_file = self.get_test_loc('archive/tar/tar_relative.tar')
        """
        This test file was created with:
            import tarfile
            tar = tarfile.open("TarTest.tar.gz", "w")
            tar.add('a.txt', '../a_parent_folder.txt')
            tar.add('b.txt', '../../another_folder/b_two_root.txt')
            tar.add('b.txt', '../folder/subfolder/b_subfolder.txt')
            tar.close()
        """
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:1120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'../a_parent_folder.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
____________________ TestDebian.test_extract_deb_package_1 _____________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/deb/adduser_3.112ubuntu1_all.deb'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/ln4cqdko'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'debian-binary'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestDebian testMethod=test_extract_deb_package_1>

    def test_extract_deb_package_1(self):
        test_file = self.get_test_loc('archive/deb/adduser_3.112ubuntu1_all.deb')
        test_dir = self.get_temp_dir()
>       archive.extract_ar(test_file, test_dir)

tests/test_archive.py:1214: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... = Ar\nPhysical Size = 119632\nSubType = deb\n\nEverything is Ok\n\nFiles: 2\nSize:       119440\nCompressed: 119632\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
____________________ TestDebian.test_extract_deb_package_2 _____________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/deb/adduser_3.113+nmu3ubuntu3_all.deb'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/m040rmsw'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'debian-binary'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestDebian testMethod=test_extract_deb_package_2>

    def test_extract_deb_package_2(self):
        test_file = self.get_test_loc('archive/deb/adduser_3.113+nmu3ubuntu3_all.deb')
        test_dir = self.get_temp_dir()
>       archive.extract_ar(test_file, test_dir)

tests/test_archive.py:1220: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... = Ar\nPhysical Size = 169360\nSubType = deb\n\nEverything is Ok\n\nFiles: 2\nSize:       169167\nCompressed: 169360\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
____________________ TestDebian.test_extract_deb_package_3 _____________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/deb/wget-el_0.5.0-8_all.deb'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/x0c4_njv'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'debian-binary'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestDebian testMethod=test_extract_deb_package_3>

    def test_extract_deb_package_3(self):
        test_file = self.get_test_loc('archive/deb/wget-el_0.5.0-8_all.deb')
        test_dir = self.get_temp_dir()
>       archive.extract_ar(test_file, test_dir)

tests/test_archive.py:1231: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ype = Ar\nPhysical Size = 37728\nSubType = deb\n\nEverything is Ok\n\nFiles: 2\nSize:       37536\nCompressed: 37728\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_________________________ TestAr.test_extract_ar_basic _________________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/liby.a'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/mb_ydq9u'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'__.SYMDEF'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestAr testMethod=test_extract_ar_basic>

    def test_extract_ar_basic(self):
        test_file = self.get_test_loc('archive/ar/liby.a')
        test_dir = self.get_temp_dir()
>       result = archive.extract_ar(test_file, test_dir)

tests/test_archive.py:1248: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...Type = Ar\nPhysical Size = 2532\nSubType = a:BSD\n\nEverything is Ok\n\nFiles: 3\nSize:       2321\nCompressed: 2532\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______________________ TestAr.test_extract_ar_basic_7z ________________________

self = <test_archive.TestAr testMethod=test_extract_ar_basic_7z>

    def test_extract_ar_basic_7z(self):
        test_file = self.get_test_loc('archive/ar/liby.a')
        test_dir = self.get_temp_dir()
>       result = sevenzip.extract(test_file, test_dir)

tests/test_archive.py:1240: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...Type = Ar\nPhysical Size = 2532\nSubType = a:BSD\n\nEverything is Ok\n\nFiles: 3\nSize:       2321\nCompressed: 2532\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
________________________ TestAr.test_extract_ar_broken _________________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/liby-corrupted.a'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/kdy31ez5'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'__.SYMDEF'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestAr testMethod=test_extract_ar_broken>

    def test_extract_ar_broken(self):
        test_file = self.get_test_loc('archive/ar/liby-corrupted.a')
        test_dir = self.get_temp_dir()
>       result = archive.extract_ar(test_file, test_dir)

tests/test_archive.py:1294: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ar:BSD\n\nEverything is Ok\n\nArchives with Warnings: 1\n\nWarnings: 2\nFiles: 2\nSize:       1096\nCompressed: 1924\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______________________ TestAr.test_extract_ar_broken_7z _______________________

self = <test_archive.TestAr testMethod=test_extract_ar_broken_7z>

    def test_extract_ar_broken_7z(self):
        test_file = self.get_test_loc('archive/ar/liby-corrupted.a')
        test_dir = self.get_temp_dir()
>       result = sevenzip.extract(test_file, test_dir)

tests/test_archive.py:1277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ar:BSD\n\nEverything is Ok\n\nArchives with Warnings: 1\n\nWarnings: 2\nFiles: 2\nSize:       1096\nCompressed: 1924\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
___________________ TestAr.test_extract_ar_broken_libarchive ___________________

self = <test_archive.TestAr testMethod=test_extract_ar_broken_libarchive>
excInstance = Exception('Incorrect file header signature')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/liby-corrupted.a', '/tmp/scancode-tk-tests -h5oxlfwx/3jx9s023')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5afd57d0>
@py_assert8 = 'Incorrect file header signature', @py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5afd57d0>\n{<built-in method startswith of ... file header signature'\n{'Incorrect file header signature' = str(Exception('Incorrect file header signature'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'__.SYMDEF'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestAr testMethod=test_extract_ar_broken_libarchive>

    def test_extract_ar_broken_libarchive(self):
        test_file = self.get_test_loc('archive/ar/liby-corrupted.a')
        test_dir = self.get_temp_dir()
>       self.assertRaisesInstance(
            Exception('Incorrect file header signature'),
            libarchive2.extract, test_file, test_dir)

tests/test_archive.py:1285: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestAr testMethod=test_extract_ar_broken_libarchive>
excInstance = Exception('Incorrect file header signature')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/liby-corrupted.a', '/tmp/scancode-tk-tests -h5oxlfwx/3jx9s023')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5afd57d0>
@py_assert8 = 'Incorrect file header signature', @py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5afd57d0>\n{<built-in method startswith of ... file header signature'\n{'Incorrect file header signature' = str(Exception('Incorrect file header signature'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5afd57d0>('Incorrect file header signature')
E            +    where <built-in method startswith of str object at 0x7f6f5afd57d0> = "a bytes-like object is required, not 'str'".startswith
E            +      where "a bytes-like object is required, not 'str'" = str(TypeError("a bytes-like object is required, not 'str'"))
E            +    and   'Incorrect file header signature' = str(Exception('Incorrect file header signature'))

tests/extractcode_assert_utils.py:178: AssertionError
______________________ TestAr.test_extract_ar_libarchive _______________________

self = <test_archive.TestAr testMethod=test_extract_ar_libarchive>

    def test_extract_ar_libarchive(self):
        test_file = self.get_test_loc('archive/ar/liby.a')
        test_dir = self.get_temp_dir()
>       result = libarchive2.extract(test_file, test_dir)

tests/test_archive.py:1256: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'__.SYMDEF'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
________ TestAr.test_extract_ar_static_library_does_not_delete_symdefs _________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/liby.a'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/las5e5z0'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'__.SYMDEF'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestAr testMethod=test_extract_ar_static_library_does_not_delete_symdefs>

    def test_extract_ar_static_library_does_not_delete_symdefs(self):
        test_file = self.get_test_loc('archive/ar/liby.a')
        test_dir = self.get_temp_dir()
>       result = archive.extract_ar(test_file, test_dir)

tests/test_archive.py:1397: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...Type = Ar\nPhysical Size = 2532\nSubType = a:BSD\n\nEverything is Ok\n\nFiles: 3\nSize:       2321\nCompressed: 2532\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______ TestAr.test_extract_ar_static_library_does_not_delete_symdefs_7z _______

self = <test_archive.TestAr testMethod=test_extract_ar_static_library_does_not_delete_symdefs_7z>

    def test_extract_ar_static_library_does_not_delete_symdefs_7z(self):
        test_file = self.get_test_loc('archive/ar/liby.a')
        test_dir = self.get_temp_dir()
>       result = sevenzip.extract(test_file, test_dir)

tests/test_archive.py:1388: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...Type = Ar\nPhysical Size = 2532\nSubType = a:BSD\n\nEverything is Ok\n\nFiles: 3\nSize:       2321\nCompressed: 2532\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_____________________ TestAr.test_extract_ar_verify_dates ______________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/liby.a'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/ptmm32l2'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'__.SYMDEF'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestAr testMethod=test_extract_ar_verify_dates>

    def test_extract_ar_verify_dates(self):
        test_file = self.get_test_loc('archive/ar/liby.a')
        test_dir = self.get_temp_dir()
>       archive.extract_ar(test_file, test_dir)

tests/test_archive.py:1264: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...Type = Ar\nPhysical Size = 2532\nSubType = a:BSD\n\nEverything is Ok\n\nFiles: 3\nSize:       2321\nCompressed: 2532\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
___________________ TestAr.test_extract_ar_with_invalid_path ___________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/ar_invalidpath.ar'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/g5jss6l6'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'this\\that'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestAr testMethod=test_extract_ar_with_invalid_path>

    def test_extract_ar_with_invalid_path(self):
        test_file = self.get_test_loc('archive/ar/ar_invalidpath.ar')
        test_dir = self.get_temp_dir()
>       result = archive.extract_ar(test_file, test_dir)

tests/test_archive.py:1302: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ar_invalidpath.ar\nType = Ar\nPhysical Size = 84\nSubType = ar\n\nEverything is Ok\n\nSize:       15\nCompressed: 84\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
___________________ TestAr.test_extract_ar_with_permissions ____________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/winlib/zlib.lib'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/yy0tdbxc'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestAr testMethod=test_extract_ar_with_permissions>

    def test_extract_ar_with_permissions(self):
        test_file = self.get_test_loc('archive/ar/winlib/zlib.lib')
        test_dir = self.get_temp_dir()
>       result = archive.extract_ar(test_file, test_dir)

tests/test_archive.py:1423: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...\nType = Ar\nPhysical Size = 1668\nSubType = lib\n\nEverything is Ok\n\nFiles: 6\nSize:       1389\nCompressed: 1668\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestAr.test_extract_ar_with_permissions_7z __________________

self = <test_archive.TestAr testMethod=test_extract_ar_with_permissions_7z>

    def test_extract_ar_with_permissions_7z(self):
        test_file = self.get_test_loc('archive/ar/winlib/zlib.lib')
        test_dir = self.get_temp_dir()
>       result = sevenzip.extract(test_file, test_dir)

tests/test_archive.py:1415: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...\nType = Ar\nPhysical Size = 1668\nSubType = lib\n\nEverything is Ok\n\nFiles: 6\nSize:       1389\nCompressed: 1668\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
______________ TestAr.test_extract_ar_with_permissions_libarchive ______________

self = <test_archive.TestAr testMethod=test_extract_ar_with_permissions_libarchive>

    def test_extract_ar_with_permissions_libarchive(self):
        test_file = self.get_test_loc('archive/ar/winlib/zlib.lib')
        test_dir = self.get_temp_dir()
>       result = libarchive2.extract(test_file, test_dir)

tests/test_archive.py:1434: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
____ TestAr.test_extract_ar_with_relative_path_and_backslashes_in_names_7z _____

self = <test_archive.TestAr testMethod=test_extract_ar_with_relative_path_and_backslashes_in_names_7z>

    def test_extract_ar_with_relative_path_and_backslashes_in_names_7z(self):
        test_file = self.get_test_loc('archive/ar/winlib/freetype.lib')
        test_dir = self.get_temp_dir()
>       result = sevenzip.extract(test_file, test_dir)

tests/test_archive.py:1344: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...r\nPhysical Size = 2237914\nSubType = lib\n\nEverything is Ok\n\nFiles: 35\nSize:       2256880\nCompressed: 2237914\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__ TestAr.test_extract_ar_with_relative_path_and_backslashes_in_names_libarch __

self = <test_archive.TestAr testMethod=test_extract_ar_with_relative_path_and_backslashes_in_names_libarch>
excInstance = Exception('Invalid string table')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/winlib/freetype.lib', '/tmp/scancode-tk-tests -h5oxlfwx/fd6ttfzs')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5afdb2d0>
@py_assert8 = 'Invalid string table', @py_assert10 = False
@py_format12 = 'assert False\n{False = <built-in method startswith of str object at 0x7f6f5afdb2d0>\n{<built-in method startswith of ...n}.startswith\n}(\'Invalid string table\'\n{\'Invalid string table\' = str(Exception(\'Invalid string table\'))\n})\n}'

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestAr testMethod=test_extract_ar_with_relative_path_and_backslashes_in_names_libarch>

    def test_extract_ar_with_relative_path_and_backslashes_in_names_libarch(self):
        test_file = self.get_test_loc('archive/ar/winlib/freetype.lib')
        test_dir = self.get_temp_dir()
>       self.assertRaisesInstance(
            Exception('Invalid string table'),
            archive.libarchive2.extract, test_file, test_dir)

tests/test_archive.py:1333: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestAr testMethod=test_extract_ar_with_relative_path_and_backslashes_in_names_libarch>
excInstance = Exception('Invalid string table')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/winlib/freetype.lib', '/tmp/scancode-tk-tests -h5oxlfwx/fd6ttfzs')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5afdb2d0>
@py_assert8 = 'Invalid string table', @py_assert10 = False
@py_format12 = 'assert False\n{False = <built-in method startswith of str object at 0x7f6f5afdb2d0>\n{<built-in method startswith of ...n}.startswith\n}(\'Invalid string table\'\n{\'Invalid string table\' = str(Exception(\'Invalid string table\'))\n})\n}'

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5afdb2d0>('Invalid string table')
E            +    where <built-in method startswith of str object at 0x7f6f5afdb2d0> = "a bytes-like object is required, not 'str'".startswith
E            +      where "a bytes-like object is required, not 'str'" = str(TypeError("a bytes-like object is required, not 'str'"))
E            +    and   'Invalid string table' = str(Exception('Invalid string table'))

tests/extractcode_assert_utils.py:178: AssertionError
______________ TestAr.test_extract_ar_with_relative_path_libarch _______________

self = <test_archive.TestAr testMethod=test_extract_ar_with_relative_path_libarch>
excInstance = Exception('Invalid string table')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/winlib/htmlhelp.lib', '/tmp/scancode-tk-tests -h5oxlfwx/t08w0xol')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5af15230>
@py_assert8 = 'Invalid string table', @py_assert10 = False
@py_format12 = 'assert False\n{False = <built-in method startswith of str object at 0x7f6f5af15230>\n{<built-in method startswith of ...n}.startswith\n}(\'Invalid string table\'\n{\'Invalid string table\' = str(Exception(\'Invalid string table\'))\n})\n}'

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestAr testMethod=test_extract_ar_with_relative_path_libarch>

    def test_extract_ar_with_relative_path_libarch(self):
        test_file = self.get_test_loc('archive/ar/winlib/htmlhelp.lib')
        test_dir = self.get_temp_dir()
>       self.assertRaisesInstance(
            Exception('Invalid string table'),
            archive.libarchive2.extract, test_file, test_dir)

tests/test_archive.py:1322: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestAr testMethod=test_extract_ar_with_relative_path_libarch>
excInstance = Exception('Invalid string table')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/winlib/htmlhelp.lib', '/tmp/scancode-tk-tests -h5oxlfwx/t08w0xol')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5af15230>
@py_assert8 = 'Invalid string table', @py_assert10 = False
@py_format12 = 'assert False\n{False = <built-in method startswith of str object at 0x7f6f5af15230>\n{<built-in method startswith of ...n}.startswith\n}(\'Invalid string table\'\n{\'Invalid string table\' = str(Exception(\'Invalid string table\'))\n})\n}'

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5af15230>('Invalid string table')
E            +    where <built-in method startswith of str object at 0x7f6f5af15230> = "a bytes-like object is required, not 'str'".startswith
E            +      where "a bytes-like object is required, not 'str'" = str(TypeError("a bytes-like object is required, not 'str'"))
E            +    and   'Invalid string table' = str(Exception('Invalid string table'))

tests/extractcode_assert_utils.py:178: AssertionError
______________ TestAr.test_extract_ar_with_relative_path_sevenzip ______________

self = <test_archive.TestAr testMethod=test_extract_ar_with_relative_path_sevenzip>

    def test_extract_ar_with_relative_path_sevenzip(self):
        test_file = self.get_test_loc('archive/ar/winlib/htmlhelp.lib')
        test_dir = self.get_temp_dir()
>       result = sevenzip.extract(test_file, test_dir)

tests/test_archive.py:1310: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ype = Ar\nPhysical Size = 34904\nSubType = lib\n\nEverything is Ok\n\nFiles: 3\nSize:       34801\nCompressed: 34904\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestAr.test_extract_ar_with_trailing_data ___________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/ar/ar_trailing.a'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/xu2g00gk'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'__.SYMDEF'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestAr testMethod=test_extract_ar_with_trailing_data>

    def test_extract_ar_with_trailing_data(self):
        test_file = self.get_test_loc('archive/ar/ar_trailing.a')
        test_dir = self.get_temp_dir()
>       archive.extract_ar(test_file, test_dir)

tests/test_archive.py:1406: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... a:BSD\n\nEverything is Ok\n\nArchives with Warnings: 1\n\nWarnings: 1\nFiles: 3\nSize:       2321\nCompressed: 2542\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______________________ TestCpio.test_extract_cpio_basic _______________________

self = <test_archive.TestCpio testMethod=test_extract_cpio_basic>

    def test_extract_cpio_basic(self):
        test_file = self.get_test_loc('archive/cpio/elfinfo-1.0-1.fc9.src.cpio')
        test_dir = self.get_temp_dir()
>       archive.extract_cpio(test_file, test_dir)

tests/test_archive.py:1445: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'elfinfo-1.0.tar.gz'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
______________________ TestCpio.test_extract_cpio_broken2 ______________________

self = <test_archive.TestCpio testMethod=test_extract_cpio_broken2>

    def test_extract_cpio_broken2(self):
        test_file = self.get_test_loc('archive/cpio/cpio_broken.cpio')
        test_dir = self.get_temp_dir()
>       result = archive.extract_cpio(test_file, test_dir)

tests/test_archive.py:1464: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'elfinfo-1.0.tar.gz'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_____________________ TestCpio.test_extract_cpio_broken_7z _____________________

self = <test_archive.TestCpio testMethod=test_extract_cpio_broken_7z>
excInstance = Exception('CRC Failed : elfinfo-1.0.tar')
callableObj = <function extract at 0x7f6f5bf6d620>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/cpio/cpio_broken.cpio', '/tmp/scancode-tk-tests -h5oxlfwx/n7dh_8_1')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = 'normalize() argument 2 must be str, not bytes'
@py_assert4 = <built-in method startswith of str object at 0x7f6f5af17570>
@py_assert8 = 'CRC Failed : elfinfo-1.0.tar', @py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5af17570>\n{<built-in method startswith of ...CRC Failed : elfinfo-1.0.tar'\n{'CRC Failed : elfinfo-1.0.tar' = str(Exception('CRC Failed : elfinfo-1.0.tar'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ers Size = 26\nStreams = 1\n\n\nSub items Errors: 1\n\nArchives with Errors: 1\n\nWarnings: 1\n\nSub items Errors: 1\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestCpio testMethod=test_extract_cpio_broken_7z>

    def test_extract_cpio_broken_7z(self):
        test_file = self.get_test_loc('archive/cpio/cpio_broken.cpio')
        test_dir = self.get_temp_dir()
>       self.assertRaisesInstance(Exception('CRC Failed : elfinfo-1.0.tar'), sevenzip.extract, test_file, test_dir)

tests/test_archive.py:1459: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestCpio testMethod=test_extract_cpio_broken_7z>
excInstance = Exception('CRC Failed : elfinfo-1.0.tar')
callableObj = <function extract at 0x7f6f5bf6d620>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/cpio/cpio_broken.cpio', '/tmp/scancode-tk-tests -h5oxlfwx/n7dh_8_1')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = 'normalize() argument 2 must be str, not bytes'
@py_assert4 = <built-in method startswith of str object at 0x7f6f5af17570>
@py_assert8 = 'CRC Failed : elfinfo-1.0.tar', @py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5af17570>\n{<built-in method startswith of ...CRC Failed : elfinfo-1.0.tar'\n{'CRC Failed : elfinfo-1.0.tar' = str(Exception('CRC Failed : elfinfo-1.0.tar'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           AssertionError: assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5af17570>('CRC Failed : elfinfo-1.0.tar')
E            +    where <built-in method startswith of str object at 0x7f6f5af17570> = 'normalize() argument 2 must be str, not bytes'.startswith
E            +      where 'normalize() argument 2 must be str, not bytes' = str(TypeError('normalize() argument 2 must be str, not bytes'))
E            +    and   'CRC Failed : elfinfo-1.0.tar' = str(Exception('CRC Failed : elfinfo-1.0.tar'))

tests/extractcode_assert_utils.py:178: AssertionError
________________ TestCpio.test_extract_cpio_with_absolute_path _________________

self = <test_archive.TestCpio testMethod=test_extract_cpio_with_absolute_path>

    def test_extract_cpio_with_absolute_path(self):
        assert not os.path.exists('/tmp/subdir')
        test_dir = self.get_temp_dir()
        test_file = self.get_test_loc('archive/cpio/cpio_absolute.cpio')
>       archive.extract_cpio(test_file, test_dir)

tests/test_archive.py:1473: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'/home/li/Desktop/absolute_folder/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_________________ TestCpio.test_extract_cpio_with_invalidpath __________________

self = <test_archive.TestCpio testMethod=test_extract_cpio_with_invalidpath>

    def test_extract_cpio_with_invalidpath(self):
        test_file = self.get_test_loc('archive/cpio/cpio-invalidpath.cpio')
        test_dir = self.get_temp_dir()
>       archive.extract_cpio(test_file, test_dir)

tests/test_archive.py:1502: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'backup'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
________________ TestCpio.test_extract_cpio_with_relative_path _________________

self = <test_archive.TestCpio testMethod=test_extract_cpio_with_relative_path>

    def test_extract_cpio_with_relative_path(self):
        # test file is created by cmd: find ../.. - |cpio -ov >relative.cpio
        # We should somehow add a "parent" folder to extract relative paths
        test_file = self.get_test_loc('archive/cpio/cpio_relative.cpio')
        test_dir = self.get_temp_dir()
>       result = archive.extract_cpio(test_file, test_dir)

tests/test_archive.py:1483: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'../..'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
________________ TestCpio.test_extract_cpio_with_trailing_data _________________

self = <test_archive.TestCpio testMethod=test_extract_cpio_with_trailing_data>

    def test_extract_cpio_with_trailing_data(self):
        test_file = self.get_test_loc('archive/cpio/cpio_trailing.cpio')
        test_dir = self.get_temp_dir()
>       archive.extract_cpio(test_file, test_dir)

tests/test_archive.py:1452: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'elfinfo-1.0.tar.gz'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
___________ TestCpio.test_extract_cpio_with_weird_filename_extension ___________

self = <test_archive.TestCpio testMethod=test_extract_cpio_with_weird_filename_extension>

    def test_extract_cpio_with_weird_filename_extension(self):
        test_file = self.get_test_loc('archive/cpio/t.cpio.foo')
        test_dir = self.get_temp_dir()
>       result = archive.extract_cpio(test_file, test_dir)

tests/test_archive.py:1513: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b't'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_______________________ TestRpm.test_extract_rpm_basic_1 _______________________

self = <test_archive.TestRpm testMethod=test_extract_rpm_basic_1>

    def test_extract_rpm_basic_1(self):
        test_file = self.get_test_loc('archive/rpm/elfinfo-1.0-1.fc9.src.rpm')
        test_dir = self.get_temp_dir()
>       archive.extract_rpm(test_file, test_dir)

tests/test_archive.py:1525: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...U = i386\nHost OS = linux\nCreated = 2008-09-29 08:29:07\n\nEverything is Ok\n\nSize:       11073\nCompressed: 12728\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______________________ TestRpm.test_extract_rpm_basic_2 _______________________

self = <test_archive.TestRpm testMethod=test_extract_rpm_basic_2>

    def test_extract_rpm_basic_2(self):
        test_file = self.get_test_loc('archive/rpm/python-glc-0.7.1-1.src.rpm')
        test_dir = self.get_temp_dir()
>       archive.extract_rpm(test_file, test_dir)

tests/test_archive.py:1532: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...U = noarch\nHost OS = linux\nCreated = 2008-08-05 19:58:04\n\nEverything is Ok\n\nSize:       6055\nCompressed: 7674\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______________________ TestRpm.test_extract_rpm_broken ________________________

self = <test_archive.TestRpm testMethod=test_extract_rpm_broken>
excInstance = Exception('CRC Failed : broken')
callableObj = <function extract at 0x7f6f5bf6d620>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/rpm/broken.rpm', '/tmp/scancode-tk-tests -h5oxlfwx/e2iurgux')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = 'normalize() argument 2 must be str, not bytes'
@py_assert4 = <built-in method startswith of str object at 0x7f6f5af08210>
@py_assert8 = 'CRC Failed : broken', @py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5af08210>\n{<built-in method startswith of ...bytes'))\n}.startswith\n}('CRC Failed : broken'\n{'CRC Failed : broken' = str(Exception('CRC Failed : broken'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ze = 6060\nHeaders Size = 10\nStreams = 1\n\n\nSub items Errors: 1\n\nArchives with Errors: 1\n\nSub items Errors: 1\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestRpm testMethod=test_extract_rpm_broken>

    def test_extract_rpm_broken(self):
        test_file = self.get_test_loc('archive/rpm/broken.rpm')
        test_dir = self.get_temp_dir()
        expected = Exception('CRC Failed : broken')
>       self.assertRaisesInstance(expected, archive.extract_rpm,
                                  test_file, test_dir)

tests/test_archive.py:1564: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestRpm testMethod=test_extract_rpm_broken>
excInstance = Exception('CRC Failed : broken')
callableObj = <function extract at 0x7f6f5bf6d620>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/rpm/broken.rpm', '/tmp/scancode-tk-tests -h5oxlfwx/e2iurgux')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = 'normalize() argument 2 must be str, not bytes'
@py_assert4 = <built-in method startswith of str object at 0x7f6f5af08210>
@py_assert8 = 'CRC Failed : broken', @py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5af08210>\n{<built-in method startswith of ...bytes'))\n}.startswith\n}('CRC Failed : broken'\n{'CRC Failed : broken' = str(Exception('CRC Failed : broken'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           AssertionError: assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5af08210>('CRC Failed : broken')
E            +    where <built-in method startswith of str object at 0x7f6f5af08210> = 'normalize() argument 2 must be str, not bytes'.startswith
E            +      where 'normalize() argument 2 must be str, not bytes' = str(TypeError('normalize() argument 2 must be str, not bytes'))
E            +    and   'CRC Failed : broken' = str(Exception('CRC Failed : broken'))

tests/extractcode_assert_utils.py:178: AssertionError
__________________ TestRpm.test_extract_rpm_nested_correctly ___________________

self = <test_archive.TestRpm testMethod=test_extract_rpm_nested_correctly>

    def test_extract_rpm_nested_correctly(self):
        test_file = self.get_test_loc('archive/rpm/extract_once/libsqueeze0.2_0-0.2.3-8mdv2010.0.i586.rpm')
        test_dir = self.get_temp_dir()
>       archive.extract_rpm(test_file, test_dir)

tests/test_archive.py:1539: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...U = i586\nHost OS = linux\nCreated = 2009-09-20 15:17:56\n\nEverything is Ok\n\nSize:       25572\nCompressed: 30726\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
________________ TestRpm.test_extract_rpm_with_renamed_content _________________

self = <test_archive.TestRpm testMethod=test_extract_rpm_with_renamed_content>

    def test_extract_rpm_with_renamed_content(self):
        # When the RPM is renamed, we should still be able to find the cpio
        test_file = self.get_test_loc('archive/rpm/renamed.rpm')
        test_dir = self.get_temp_dir()
>       result = archive.extract_rpm(test_file, test_dir)

tests/test_archive.py:1555: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...U = noarch\nHost OS = linux\nCreated = 2008-08-05 19:58:04\n\nEverything is Ok\n\nSize:       6055\nCompressed: 7674\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_________________ TestRpm.test_extract_rpm_with_trailing_data __________________

self = <test_archive.TestRpm testMethod=test_extract_rpm_with_trailing_data>

    def test_extract_rpm_with_trailing_data(self):
        test_file = self.get_test_loc('archive/rpm/rpm_trailing.rpm')
        test_dir = self.get_temp_dir()
>       result = archive.extract_rpm(test_file, test_dir)

tests/test_archive.py:1546: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...09-29 08:29:07\n\nEverything is Ok\n\nArchives with Warnings: 1\n\nWarnings: 1\nSize:       11073\nCompressed: 12761\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
______ TestExtractTwice.test_extract_twice_can_extract_to_relative_paths _______

self = <test_archive.TestExtractTwice testMethod=test_extract_twice_can_extract_to_relative_paths>

    def test_extract_twice_can_extract_to_relative_paths(self):
        # The setup is a tad complex because we want to have a relative dir
        # to the base dir where we run tests from, i.e. the git checkout dir
        # To use relative paths, we use our tmp dir at the root of the code tree
        from os.path import join, abspath, exists
        import shutil
        import tempfile
    
        test_file = self.get_test_loc('archive/rpm/xz-compressed-cpio.rpm')
        # this will return an extractor that extracts twice
        extractor = archive.get_extractor(test_file)
    
        project_tmp = join(project_root, 'tmp')
        fileutils.create_dir(project_tmp)
        project_root_abs = abspath(project_root)
        test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root_abs, '').strip('\\/')
        test_tgt_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root_abs, '').strip('\\/')
        shutil.copy(test_file, test_src_dir)
        test_src_file = join(test_src_dir, 'xz-compressed-cpio.rpm')
    
>       result = list(extractor(test_src_file, test_tgt_dir))

tests/test_archive.py:1668: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:381: in extract_twice
    warnings = extractor1(abs_location, temp_target)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...x86_64\nHost OS = linux\nCreated = 2014-10-16 14:33:49\n\nEverything is Ok\n\nSize:       144372\nCompressed: 214692\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_____ TestExtractTwice.test_extract_twice_with_rpm_with_xz_compressed_cpio _____

self = <test_archive.TestExtractTwice testMethod=test_extract_twice_with_rpm_with_xz_compressed_cpio>

    def test_extract_twice_with_rpm_with_xz_compressed_cpio(self):
        test_file = self.get_test_loc('archive/rpm/xz-compressed-cpio.rpm')
        test_dir = self.get_temp_dir()
        # this will return an extractor that extracts twice
        extractor = archive.get_extractor(test_file)
>       result = list(extractor(test_file, test_dir))

tests/test_archive.py:1575: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:381: in extract_twice
    warnings = extractor1(abs_location, temp_target)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...x86_64\nHost OS = linux\nCreated = 2014-10-16 14:33:49\n\nEverything is Ok\n\nSize:       144372\nCompressed: 214692\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
________________________ TestRar.test_extract_rar_basic ________________________

self = <test_archive.TestRar testMethod=test_extract_rar_basic>

    def test_extract_rar_basic(self):
        test_file = self.get_test_loc('archive/rar/basic.rar')
        test_dir = self.get_temp_dir()
>       archive.extract_rar(test_file, test_dir)

tests/test_archive.py:1678: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'd/a/a.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_______________________ TestRar.test_extract_rar_broken ________________________

self = <test_archive.TestRar testMethod=test_extract_rar_broken>
excInstance = Exception('Header CRC error')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/rar/broken.rar', '/tmp/scancode-tk-tests -h5oxlfwx/jz2yda38')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5af09fb0>
@py_assert8 = 'Header CRC error', @py_assert10 = False
@py_format12 = 'assert False\n{False = <built-in method startswith of str object at 0x7f6f5af09fb0>\n{<built-in method startswith of ... \'str\'"))\n}.startswith\n}(\'Header CRC error\'\n{\'Header CRC error\' = str(Exception(\'Header CRC error\'))\n})\n}'

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'd/a/a.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestRar testMethod=test_extract_rar_broken>

    def test_extract_rar_broken(self):
        test_file = self.get_test_loc('archive/rar/broken.rar')
        test_dir = self.get_temp_dir()
        expected = Exception('Header CRC error')
>       self.assertRaisesInstance(expected, archive.extract_rar, test_file, test_dir)

tests/test_archive.py:1701: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestRar testMethod=test_extract_rar_broken>
excInstance = Exception('Header CRC error')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/rar/broken.rar', '/tmp/scancode-tk-tests -h5oxlfwx/jz2yda38')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5af09fb0>
@py_assert8 = 'Header CRC error', @py_assert10 = False
@py_format12 = 'assert False\n{False = <built-in method startswith of str object at 0x7f6f5af09fb0>\n{<built-in method startswith of ... \'str\'"))\n}.startswith\n}(\'Header CRC error\'\n{\'Header CRC error\' = str(Exception(\'Header CRC error\'))\n})\n}'

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5af09fb0>('Header CRC error')
E            +    where <built-in method startswith of str object at 0x7f6f5af09fb0> = "a bytes-like object is required, not 'str'".startswith
E            +      where "a bytes-like object is required, not 'str'" = str(TypeError("a bytes-like object is required, not 'str'"))
E            +    and   'Header CRC error' = str(Exception('Header CRC error'))

tests/extractcode_assert_utils.py:178: AssertionError
_________________ TestRar.test_extract_rar_with_absolute_path __________________

self = <test_archive.TestRar testMethod=test_extract_rar_with_absolute_path>

    def test_extract_rar_with_absolute_path(self):
        # FIXME: this file may not have a real absolute path
        assert not os.path.exists('/home/li/Desktop/zip_folder')
        test_file = self.get_test_loc('archive/rar/rar_absolute.rar', copy=True)
        test_dir = self.get_temp_dir()
>       archive.extract_rar(test_file, test_dir)

tests/test_archive.py:1722: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'home/li/Desktop/absolute_folder/absolute_file'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
__________________ TestRar.test_extract_rar_with_invalid_path __________________

self = <test_archive.TestRar testMethod=test_extract_rar_with_invalid_path>

    def test_extract_rar_with_invalid_path(self):
        test_file = self.get_test_loc('archive/rar/rar_invalidpath.rar')
        test_dir = self.get_temp_dir()
>       archive.extract_rar(test_file, test_dir)

tests/test_archive.py:1685: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'this/that'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_________________ TestRar.test_extract_rar_with_non_ascii_path _________________

self = <test_archive.TestRar testMethod=test_extract_rar_with_non_ascii_path>
excInstance = Exception('Prefix found')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/rar/non_ascii_corrupted.rar', '/tmp/scancode-tk-tests -h5oxlfwx/2sijs4hq')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5af0b7b0>
@py_assert8 = 'Prefix found', @py_assert10 = False
@py_format12 = 'assert False\n{False = <built-in method startswith of str object at 0x7f6f5af0b7b0>\n{<built-in method startswith of ...equired, not \'str\'"))\n}.startswith\n}(\'Prefix found\'\n{\'Prefix found\' = str(Exception(\'Prefix found\'))\n})\n}'

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'EdoProject_java/EdoProject\xe5\xae\x89\xe8\xa3\x85\xe4\xbd\xbf\xe7\x94\xa8.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestRar testMethod=test_extract_rar_with_non_ascii_path>

    def test_extract_rar_with_non_ascii_path(self):
        test_file = self.get_test_loc('archive/rar/non_ascii_corrupted.rar')
        # The bug only occurs if the path was given as Unicode
        test_file = str(test_file)
        test_dir = self.get_temp_dir()
        # raise an exception but still extracts some
        expected = Exception('Prefix found')
>       self.assertRaisesInstance(expected, archive.extract_rar, test_file, test_dir)

tests/test_archive.py:1741: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestRar testMethod=test_extract_rar_with_non_ascii_path>
excInstance = Exception('Prefix found')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/rar/non_ascii_corrupted.rar', '/tmp/scancode-tk-tests -h5oxlfwx/2sijs4hq')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5af0b7b0>
@py_assert8 = 'Prefix found', @py_assert10 = False
@py_format12 = 'assert False\n{False = <built-in method startswith of str object at 0x7f6f5af0b7b0>\n{<built-in method startswith of ...equired, not \'str\'"))\n}.startswith\n}(\'Prefix found\'\n{\'Prefix found\' = str(Exception(\'Prefix found\'))\n})\n}'

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5af0b7b0>('Prefix found')
E            +    where <built-in method startswith of str object at 0x7f6f5af0b7b0> = "a bytes-like object is required, not 'str'".startswith
E            +      where "a bytes-like object is required, not 'str'" = str(TypeError("a bytes-like object is required, not 'str'"))
E            +    and   'Prefix found' = str(Exception('Prefix found'))

tests/extractcode_assert_utils.py:178: AssertionError
____________________ TestRar.test_extract_rar_with_password ____________________

self = <test_archive.TestRar testMethod=test_extract_rar_with_password>
excInstance = Exception('Prefix found')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/rar/rar_password.rar', '/tmp/scancode-tk-tests -h5oxlfwx/dojs884c')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5b17b450>
@py_assert8 = 'Prefix found', @py_assert10 = False
@py_format12 = 'assert False\n{False = <built-in method startswith of str object at 0x7f6f5b17b450>\n{<built-in method startswith of ...equired, not \'str\'"))\n}.startswith\n}(\'Prefix found\'\n{\'Prefix found\' = str(Exception(\'Prefix found\'))\n})\n}'

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'password'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestRar testMethod=test_extract_rar_with_password>

    def test_extract_rar_with_password(self):
        test_file = self.get_test_loc('archive/rar/rar_password.rar')
        test_dir = self.get_temp_dir()
        expected = Exception('Prefix found')
>       self.assertRaisesInstance(expected, archive.extract_rar, test_file, test_dir)

tests/test_archive.py:1732: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestRar testMethod=test_extract_rar_with_password>
excInstance = Exception('Prefix found')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/rar/rar_password.rar', '/tmp/scancode-tk-tests -h5oxlfwx/dojs884c')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5b17b450>
@py_assert8 = 'Prefix found', @py_assert10 = False
@py_format12 = 'assert False\n{False = <built-in method startswith of str object at 0x7f6f5b17b450>\n{<built-in method startswith of ...equired, not \'str\'"))\n}.startswith\n}(\'Prefix found\'\n{\'Prefix found\' = str(Exception(\'Prefix found\'))\n})\n}'

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5b17b450>('Prefix found')
E            +    where <built-in method startswith of str object at 0x7f6f5b17b450> = "a bytes-like object is required, not 'str'".startswith
E            +      where "a bytes-like object is required, not 'str'" = str(TypeError("a bytes-like object is required, not 'str'"))
E            +    and   'Prefix found' = str(Exception('Prefix found'))

tests/extractcode_assert_utils.py:178: AssertionError
_________________ TestRar.test_extract_rar_with_relative_path __________________

self = <test_archive.TestRar testMethod=test_extract_rar_with_relative_path>

    def test_extract_rar_with_relative_path(self):
        # FIXME: this file may not have a real relative path
        test_file = self.get_test_loc('archive/rar/rar_relative.rar', copy=True)
        test_dir = self.get_temp_dir()
>       archive.extract_rar(test_file, test_dir)

tests/test_archive.py:1707: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'2folder/3folder/relative_file'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
______________________ TestSevenZip.test_extract_7z_basic ______________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/z.7z'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/soudg2mx'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'z/a/a.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_basic>

    def test_extract_7z_basic(self):
        test_file = self.get_test_loc('archive/7z/z.7z')
        test_dir = self.get_temp_dir()
>       result = archive.extract_7z(test_file, test_dir)

tests/test_archive.py:1751: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...nMethod = LZMA:16\nSolid = +\nBlocks = 1\n\nEverything is Ok\n\nFolders: 4\nFiles: 3\nSize:       6\nCompressed: 186\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________ TestSevenZip.test_extract_7z_basic_with_space_in_file_name __________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/t .7z'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/r38z2alo'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b't/t.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_basic_with_space_in_file_name>

    def test_extract_7z_basic_with_space_in_file_name(self):
        test_file = self.get_test_loc('archive/7z/t .7z')
        test_dir = self.get_temp_dir()
>       result = archive.extract_7z(test_file, test_dir)

tests/test_archive.py:1856: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...nMethod = LZMA:16\nSolid = -\nBlocks = 1\n\nEverything is Ok\n\nFolders: 1\nFiles: 1\nSize:       2\nCompressed: 157\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_ TestSevenZip.test_extract_7z_with_broken_archive_does_not_fail_when_using_fallback _

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/corrupted7z.7z'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/9h836nke'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:164: in extract
    for entry in list_entries(abs_location):
src/extractcode/libarchive2.py:221: in list_entries
    for entry in archive:
src/extractcode/libarchive2.py:299: in iter
    r = next_entry(self.archive_struct, entry_struct)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

rc = -30, archive_func = <_FuncPtr object at 0x7f6f5b715e50>
args = (93938335013184, 93938336880880), null = False

    def errcheck(rc, archive_func, args, null=False):
        """
        ctypes error check handler for functions returning int, or null if null is
        True.
        """
        if null:
            if rc is None:
                archive_struct = args and len(args) > 1 and args[0] or None
                raise ArchiveError(rc, archive_struct, archive_func)
            else:
                return rc
    
        if rc >= ARCHIVE_OK:
            return rc
    
        archive_struct = args[0]
        if rc == ARCHIVE_RETRY:
            raise ArchiveErrorRetryable(rc, archive_struct, archive_func)
    
        if rc == ARCHIVE_WARN:
            raise ArchiveWarning(rc, archive_struct, archive_func)
    
        # anything else is a serious error, in general not recoverable.
>       raise ArchiveError(rc, archive_struct, archive_func)
E       extractcode.libarchive2.ArchiveError: <exception str() failed>

src/extractcode/libarchive2.py:586: ArchiveError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_broken_archive_does_not_fail_when_using_fallback>
text = 'There are data after the end of archive'
callableObj = functools.partial(<function extract_with_fallback at 0x7f6f5bfb6a20>, extractor1=<function extract at 0x7f6f5bf6c720>, extractor2=<function extract at 0x7f6f5bf6d620>)
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/corrupted7z.7z', '/tmp/scancode-tk-tests -h5oxlfwx/9h836nke')
kwargs = {}

    def assertExceptionContains(self, text, callableObj, *args, **kwargs):
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:250: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b"\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...code-31.0.0/tests/data/archive/7z/corrupted7z.7z\n\nCan't open as archive: 1\nFiles: 0\nSize:       0\nCompressed: 0\n"
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_broken_archive_does_not_fail_when_using_fallback>

    def test_extract_7z_with_broken_archive_does_not_fail_when_using_fallback(self):
        test_file = self.get_test_loc('archive/7z/corrupted7z.7z')
        test_dir = self.get_temp_dir()
        msg = 'There are data after the end of archive'
>       self.assertExceptionContains(msg, archive.extract_7z, test_file, test_dir)

tests/test_archive.py:1774: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_broken_archive_does_not_fail_when_using_fallback>
text = 'There are data after the end of archive'
callableObj = functools.partial(<function extract_with_fallback at 0x7f6f5bfb6a20>, extractor1=<function extract at 0x7f6f5bf6c720>, extractor2=<function extract at 0x7f6f5bf6d620>)
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/corrupted7z.7z', '/tmp/scancode-tk-tests -h5oxlfwx/9h836nke')
kwargs = {}

    def assertExceptionContains(self, text, callableObj, *args, **kwargs):
        try:
            callableObj(*args, **kwargs)
        except Exception as e:
            if text not in str(e):
>               raise self.failureException(
                    'Exception %(e)r raised, '
                    'it should contain the text %(text)r '
                    'and does not' % locals()
                )
E               AssertionError: Exception TypeError('normalize() argument 2 must be str, not bytes') raised, it should contain the text 'There are data after the end of archive' and does not

tests/extractcode_assert_utils.py:253: AssertionError
___________ TestSevenZip.test_extract_7z_with_broken_archive_with7z ____________

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_broken_archive_with7z>
text = 'There are data after the end of archive'
callableObj = <function extract at 0x7f6f5bf6d620>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/corrupted7z.7z', '/tmp/scancode-tk-tests -h5oxlfwx/awi22olt')
kwargs = {}

    def assertExceptionContains(self, text, callableObj, *args, **kwargs):
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:250: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b"\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...code-31.0.0/tests/data/archive/7z/corrupted7z.7z\n\nCan't open as archive: 1\nFiles: 0\nSize:       0\nCompressed: 0\n"
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_broken_archive_with7z>

    def test_extract_7z_with_broken_archive_with7z(self):
        test_file = self.get_test_loc('archive/7z/corrupted7z.7z')
        test_dir = self.get_temp_dir()
        msg = 'There are data after the end of archive'
>       self.assertExceptionContains(msg, sevenzip.extract, test_file, test_dir)

tests/test_archive.py:1768: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_broken_archive_with7z>
text = 'There are data after the end of archive'
callableObj = <function extract at 0x7f6f5bf6d620>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/corrupted7z.7z', '/tmp/scancode-tk-tests -h5oxlfwx/awi22olt')
kwargs = {}

    def assertExceptionContains(self, text, callableObj, *args, **kwargs):
        try:
            callableObj(*args, **kwargs)
        except Exception as e:
            if text not in str(e):
>               raise self.failureException(
                    'Exception %(e)r raised, '
                    'it should contain the text %(text)r '
                    'and does not' % locals()
                )
E               AssertionError: Exception TypeError('normalize() argument 2 must be str, not bytes') raised, it should contain the text 'There are data after the end of archive' and does not

tests/extractcode_assert_utils.py:253: AssertionError
________________ TestSevenZip.test_extract_7z_with_invalid_path ________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/7zip_invalidpath.7z'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/loazebu5'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'this\\that'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_invalid_path>

    def test_extract_7z_with_invalid_path(self):
        test_file = self.get_test_loc('archive/7z/7zip_invalidpath.7z')
        test_dir = self.get_temp_dir()
>       result = archive.extract_7z(test_file, test_dir)

tests/test_archive.py:1794: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...\nHeaders Size = 114\nMethod = LZMA:16\nSolid = -\nBlocks = 1\n\nEverything is Ok\n\nSize:       15\nCompressed: 134\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
___________ TestSevenZip.test_extract_7z_with_invalid_path_using_7z ____________

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_invalid_path_using_7z>

    def test_extract_7z_with_invalid_path_using_7z(self):
        test_file = self.get_test_loc('archive/7z/7zip_invalidpath.7z')
        test_dir = self.get_temp_dir()
>       result = sevenzip.extract(test_file, test_dir)

tests/test_archive.py:1785: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...\nHeaders Size = 114\nMethod = LZMA:16\nSolid = -\nBlocks = 1\n\nEverything is Ok\n\nSize:       15\nCompressed: 134\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestSevenZip.test_extract_7z_with_password __________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/7zip_password.7z'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/us1bvfyf'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'password'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_password>
excInstance = Exception('Password protected archive, unable to extract')
callableObj = functools.partial(<function extract_with_fallback at 0x7f6f5bfb6a20>, extractor1=<function extract at 0x7f6f5bf6c720>, extractor2=<function extract at 0x7f6f5bf6d620>)
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/7zip_password.7z', '/tmp/scancode-tk-tests -h5oxlfwx/us1bvfyf')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = 'normalize() argument 2 must be str, not bytes'
@py_assert4 = <built-in method startswith of str object at 0x7f6f5b0fcb10>
@py_assert8 = 'Password protected archive, unable to extract'
@py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5b0fcb10>\n{<built-in method startswith of ...assword protected archive, unable to extract' = str(Exception('Password protected archive, unable to extract'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...od = LZMA:16 7zAES\nSolid = -\nBlocks = 1\n\n\nSub items Errors: 1\n\nArchives with Errors: 1\n\nSub items Errors: 1\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_password>

    def test_extract_7z_with_password(self):
        test_file = self.get_test_loc('archive/7z/7zip_password.7z')
        test_dir = self.get_temp_dir()
        expected = Exception('Password protected archive, unable to extract')
>       self.assertRaisesInstance(expected, archive.extract_7z, test_file, test_dir)

tests/test_archive.py:1829: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_password>
excInstance = Exception('Password protected archive, unable to extract')
callableObj = functools.partial(<function extract_with_fallback at 0x7f6f5bfb6a20>, extractor1=<function extract at 0x7f6f5bf6c720>, extractor2=<function extract at 0x7f6f5bf6d620>)
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/7zip_password.7z', '/tmp/scancode-tk-tests -h5oxlfwx/us1bvfyf')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = 'normalize() argument 2 must be str, not bytes'
@py_assert4 = <built-in method startswith of str object at 0x7f6f5b0fcb10>
@py_assert8 = 'Password protected archive, unable to extract'
@py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5b0fcb10>\n{<built-in method startswith of ...assword protected archive, unable to extract' = str(Exception('Password protected archive, unable to extract'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           AssertionError: assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5b0fcb10>('Password protected archive, unable to extract')
E            +    where <built-in method startswith of str object at 0x7f6f5b0fcb10> = 'normalize() argument 2 must be str, not bytes'.startswith
E            +      where 'normalize() argument 2 must be str, not bytes' = str(TypeError('normalize() argument 2 must be str, not bytes'))
E            +    and   'Password protected archive, unable to extract' = str(Exception('Password protected archive, unable to extract'))

tests/extractcode_assert_utils.py:178: AssertionError
______________ TestSevenZip.test_extract_7z_with_password_with_7z ______________

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_password_with_7z>
excInstance = Exception('Password protected archive, unable to extract')
callableObj = <function extract at 0x7f6f5bf6d620>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/7zip_password.7z', '/tmp/scancode-tk-tests -h5oxlfwx/ra66q8x4')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = 'normalize() argument 2 must be str, not bytes'
@py_assert4 = <built-in method startswith of str object at 0x7f6f5b0fde30>
@py_assert8 = 'Password protected archive, unable to extract'
@py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5b0fde30>\n{<built-in method startswith of ...assword protected archive, unable to extract' = str(Exception('Password protected archive, unable to extract'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...od = LZMA:16 7zAES\nSolid = -\nBlocks = 1\n\n\nSub items Errors: 1\n\nArchives with Errors: 1\n\nSub items Errors: 1\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_password_with_7z>

    def test_extract_7z_with_password_with_7z(self):
        test_file = self.get_test_loc('archive/7z/7zip_password.7z')
        test_dir = self.get_temp_dir()
        expected = Exception('Password protected archive, unable to extract')
>       self.assertRaisesInstance(expected, sevenzip.extract, test_file, test_dir)

tests/test_archive.py:1823: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_password_with_7z>
excInstance = Exception('Password protected archive, unable to extract')
callableObj = <function extract at 0x7f6f5bf6d620>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/7zip_password.7z', '/tmp/scancode-tk-tests -h5oxlfwx/ra66q8x4')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = 'normalize() argument 2 must be str, not bytes'
@py_assert4 = <built-in method startswith of str object at 0x7f6f5b0fde30>
@py_assert8 = 'Password protected archive, unable to extract'
@py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5b0fde30>\n{<built-in method startswith of ...assword protected archive, unable to extract' = str(Exception('Password protected archive, unable to extract'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           AssertionError: assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5b0fde30>('Password protected archive, unable to extract')
E            +    where <built-in method startswith of str object at 0x7f6f5b0fde30> = 'normalize() argument 2 must be str, not bytes'.startswith
E            +      where 'normalize() argument 2 must be str, not bytes' = str(TypeError('normalize() argument 2 must be str, not bytes'))
E            +    and   'Password protected archive, unable to extract' = str(Exception('Password protected archive, unable to extract'))

tests/extractcode_assert_utils.py:178: AssertionError
_______________ TestSevenZip.test_extract_7z_with_relative_path ________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/7zip_relative.7z'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/_xvaym2p'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'../2folder/3folder/relative_file'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_relative_path>

    def test_extract_7z_with_relative_path(self):
        test_file = self.get_test_loc('archive/7z/7zip_relative.7z')
        test_dir = self.get_temp_dir()
>       result = archive.extract_7z(test_file, test_dir)

tests/test_archive.py:1803: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...Method = LZMA:16\nSolid = +\nBlocks = 1\n\nEverything is Ok\n\nFolders: 3\nFiles: 4\nSize:       56\nCompressed: 250\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______________ TestSevenZip.test_extract_7z_with_trailing_data ________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/7zip_trailing.7z'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/gylxmrsl'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'z/a/a.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7z_with_trailing_data>

    def test_extract_7z_with_trailing_data(self):
        test_file = self.get_test_loc('archive/7z/7zip_trailing.7z')
        test_dir = self.get_temp_dir()
>       result = archive.extract_7z(test_file, test_dir)

tests/test_archive.py:1759: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...\nEverything is Ok\n\nArchives with Warnings: 1\n\nWarnings: 1\nFolders: 4\nFiles: 3\nSize:       6\nCompressed: 222\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_ TestSevenZip.test_extract_7zip_extract_with_unicode_path_extracts_with_errors _

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/7zip_unicode.7z'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/v8pn9mlm'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'zip/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7zip_extract_with_unicode_path_extracts_with_errors>

    def test_extract_7zip_extract_with_unicode_path_extracts_with_errors(self):
        test_file = self.get_test_loc('archive/7z/7zip_unicode.7z')
        test_dir = self.get_temp_dir()
        try:
>           archive.extract_7z(test_file, test_dir)

tests/test_archive.py:1849: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ethod = LZMA2:12\nSolid = +\nBlocks = 1\n\nEverything is Ok\n\nFolders: 1\nFiles: 2\nSize:       18\nCompressed: 192\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_ TestSevenZip.test_extract_7zip_native_with_unicode_path_should_extract_without_error _

self = <test_archive.TestSevenZip testMethod=test_extract_7zip_native_with_unicode_path_should_extract_without_error>

    def test_extract_7zip_native_with_unicode_path_should_extract_without_error(self):
        test_file = self.get_test_loc('archive/7z/7zip_unicode.7z')
        test_dir = self.get_temp_dir()
>       result = sevenzip.extract(test_file, test_dir)

tests/test_archive.py:1834: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ethod = LZMA2:12\nSolid = +\nBlocks = 1\n\nEverything is Ok\n\nFolders: 1\nFiles: 2\nSize:       18\nCompressed: 192\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_ TestSevenZip.test_extract_7zip_with_fallback_with_unicode_path_should_extract_without_error _

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/7z/7zip_unicode.7z'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/qdiiaqli'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'zip/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestSevenZip testMethod=test_extract_7zip_with_fallback_with_unicode_path_should_extract_without_error>

    def test_extract_7zip_with_fallback_with_unicode_path_should_extract_without_error(self):
        test_file = self.get_test_loc('archive/7z/7zip_unicode.7z')
        test_dir = self.get_temp_dir()
>       result = archive.extract_7z(test_file, test_dir)

tests/test_archive.py:1841: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ethod = LZMA2:12\nSolid = +\nBlocks = 1\n\nEverything is Ok\n\nFolders: 1\nFiles: 2\nSize:       18\nCompressed: 192\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
________________________ TestIso.test_extract_iso_basic ________________________

self = <test_archive.TestIso testMethod=test_extract_iso_basic>

    def test_extract_iso_basic(self):
        test_file = self.get_test_loc('archive/iso/small.iso')
        test_dir = self.get_temp_dir()
>       archive.extract_iso(test_file, test_dir)

tests/test_archive.py:1867: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...\nModified = 2015-08-05 16:06:17\n\nEverything is Ok\n\nFolders: 1\nFiles: 4\nSize:       152881\nCompressed: 532480\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
______ TestIso.test_extract_iso_basic_with_with_weird_filename_extension _______

self = <test_archive.TestIso testMethod=test_extract_iso_basic_with_with_weird_filename_extension>

    def test_extract_iso_basic_with_with_weird_filename_extension(self):
        test_file = self.get_test_loc('archive/iso/t.iso.foo')
        test_dir = self.get_temp_dir()
>       archive.extract_iso(test_file, test_dir)

tests/test_archive.py:1886: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...49:23\nModified = 2013-02-27 12:49:23\n\nEverything is Ok\n\nFolders: 1\nFiles: 1\nSize:       2\nCompressed: 376832\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestXzLzma.test_extract_archive_tar_lzma_1 __________________

self = <test_archive.TestXzLzma testMethod=test_extract_archive_tar_lzma_1>

    def test_extract_archive_tar_lzma_1(self):
        test_file = 'archive/lzma_xz/coreutils-8.5-patches-1.tar.lzma'
>       self.check_lzma_extract(extract_fun=archive.extract_lzma,
                                test_file=test_file,
                                expected='coreutils-8.5-patches-1.tar')

tests/test_archive.py:1918: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:1898: in check_lzma_extract
    extract_fun(test_file, extract_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ive/lzma_xz/coreutils-8.5-patches-1.tar.lzma\nType = lzma\n\nEverything is Ok\n\nSize:       20480\nCompressed: 4456\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestXzLzma.test_extract_archive_tar_lzma_2 __________________

self = <test_archive.TestXzLzma testMethod=test_extract_archive_tar_lzma_2>

    def test_extract_archive_tar_lzma_2(self):
        test_file = 'archive/lzma_xz/orionsocket-1.0.9.tar.lzma'
>       self.check_lzma_extract(extract_fun=archive.extract_lzma,
                        test_file=test_file,
                        expected='orionsocket-1.0.9.tar')

tests/test_archive.py:1924: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:1898: in check_lzma_extract
    extract_fun(test_file, extract_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ata/archive/lzma_xz/orionsocket-1.0.9.tar.lzma\nType = lzma\n\nEverything is Ok\n\nSize:       2560\nCompressed: 198\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestXzLzma.test_extract_archive_tar_lzma_3 __________________

self = <test_archive.TestXzLzma testMethod=test_extract_archive_tar_lzma_3>

    def test_extract_archive_tar_lzma_3(self):
        test_file = 'archive/lzma_xz/MinGW-5.1.6.exe-src.tar.lzma'
        expected = 'MinGW-5.1.6.exe-src.tar'
>       self.check_lzma_extract(extract_fun=archive.extract_lzma,
                        test_file=test_file,
                        expected=expected)

tests/test_archive.py:1931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:1898: in check_lzma_extract
    extract_fun(test_file, extract_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...rchive/lzma_xz/MinGW-5.1.6.exe-src.tar.lzma\nType = lzma\n\nEverything is Ok\n\nSize:       71680\nCompressed: 17214\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
___________________ TestXzLzma.test_extract_archive_tar_xz_1 ___________________

self = <test_archive.TestXzLzma testMethod=test_extract_archive_tar_xz_1>

    def test_extract_archive_tar_xz_1(self):
        test_file = 'archive/lzma_xz/texlive-core-patches-20.tar.xz'
>       self.check_lzma_extract(extract_fun=archive.extract_lzma,
                                test_file=test_file,
                                expected='texlive-core-patches-20.tar')

tests/test_archive.py:1906: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:1898: in check_lzma_extract
    extract_fun(test_file, extract_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... = 2916\nMethod = LZMA2:23 CRC64\nStreams = 1\nBlocks = 1\n\nEverything is Ok\n\nSize:       20480\nCompressed: 2916\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
___________________ TestXzLzma.test_extract_archive_tar_xz_2 ___________________

self = <test_archive.TestXzLzma testMethod=test_extract_archive_tar_xz_2>

    def test_extract_archive_tar_xz_2(self):
        test_file = 'archive/lzma_xz/texlive-core-patches-20.tar.xz'
>       self.check_lzma_extract(extract_fun=archive.extract_lzma,
                                test_file=test_file,
                                expected='texlive-core-patches-20.tar')

tests/test_archive.py:1912: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:1898: in check_lzma_extract
    extract_fun(test_file, extract_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... = 2916\nMethod = LZMA2:23 CRC64\nStreams = 1\nBlocks = 1\n\nEverything is Ok\n\nSize:       20480\nCompressed: 2916\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestTarZ.test_extract_tarz_compress_basic ___________________

self = <test_archive.TestTarZ testMethod=test_extract_tarz_compress_basic>

    def test_extract_tarz_compress_basic(self):
        test_file = self.get_test_loc('archive/Z/tkWWW-0.11.tar.Z')
        test_dir = self.get_temp_dir()
>       archive.extract_Z(test_file, test_dir)

tests/test_archive.py:1999: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...1.0.0/tests/data/archive/Z/tkWWW-0.11.tar.Z\nType = Z\n\nEverything is Ok\n\nSize:       1546240\nCompressed: 573683\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
____________________ TestTarZ.test_extract_z_compress_basic ____________________

self = <test_archive.TestTarZ testMethod=test_extract_z_compress_basic>

    def test_extract_z_compress_basic(self):
        test_file = self.get_test_loc('archive/Z/tr2tex.Z')
        test_dir = self.get_temp_dir()
>       archive.extract_Z(test_file, test_dir)

tests/test_archive.py:2006: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ractcode-31.0.0/tests/data/archive/Z/tr2tex.Z\nType = Z\n\nEverything is Ok\n\nSize:       106862\nCompressed: 45963\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
________________________ TestXar.test_extract_xar_basic ________________________

self = <test_archive.TestXar testMethod=test_extract_xar_basic>

    def test_extract_xar_basic(self):
        test_file = self.get_test_loc('archive/xar/xar-1.4.xar')
        test_dir = self.get_temp_dir()
>       archive.extract_Z(test_file, test_dir)

tests/test_archive.py:2016: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...e = 157467\nHeaders Size = 6152\n\nEverything is Ok\n\nFolders: 5\nFiles: 72\nSize:       620621\nCompressed: 157467\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
____________ TestCb7.test_extract_cb7_basic_with_space_in_file_name ____________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/cb7/t .cb7'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/x4kdrhnh'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b't/t.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestCb7 testMethod=test_extract_cb7_basic_with_space_in_file_name>

    def test_extract_cb7_basic_with_space_in_file_name(self):
        test_file = self.get_test_loc('archive/cb7/t .cb7')
        test_dir = self.get_temp_dir()
>       archive.extract_7z(test_file, test_dir)

tests/test_archive.py:2034: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...nMethod = LZMA:16\nSolid = -\nBlocks = 1\n\nEverything is Ok\n\nFolders: 1\nFiles: 1\nSize:       2\nCompressed: 157\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_________ TestCb7.test_extract_cb7_basic_with_weird_filename_extension _________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/cb7/t.cb7.foo'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/0ahyc1eq'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b't/t.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestCb7 testMethod=test_extract_cb7_basic_with_weird_filename_extension>

    def test_extract_cb7_basic_with_weird_filename_extension(self):
        test_file = self.get_test_loc('archive/cb7/t.cb7.foo')
        test_dir = self.get_temp_dir()
>       archive.extract_7z(test_file, test_dir)

tests/test_archive.py:2042: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...nMethod = LZMA:16\nSolid = -\nBlocks = 1\n\nEverything is Ok\n\nFolders: 1\nFiles: 1\nSize:       2\nCompressed: 157\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
________________________ TestCab.test_extract_cab_basic ________________________

self = <test_archive.TestCab testMethod=test_extract_cab_basic>

    def test_extract_cab_basic(self):
        test_file = self.get_test_loc('archive/cab/basic.cab')
        test_dir = self.get_temp_dir()
>       archive.extract_cab(test_file, test_dir)

tests/test_archive.py:2059: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... LZX:21\nBlocks = 1\nVolumes = 1\nVolume Index = 0\nID = 903\n\nEverything is Ok\n\nSize:       42\nCompressed: 6291\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_________ TestCab.test_extract_cab_basic_with_weird_filename_extension _________

self = <test_archive.TestCab testMethod=test_extract_cab_basic_with_weird_filename_extension>

    def test_extract_cab_basic_with_weird_filename_extension(self):
        test_file = self.get_test_loc('archive/cab/t.cab.foo')
        test_dir = self.get_temp_dir()
>       archive.extract_cab(test_file, test_dir)

tests/test_archive.py:2067: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...od = None\nBlocks = 1\nVolumes = 1\nVolume Index = 0\nID = 1234\n\nEverything is Ok\n\nSize:       2\nCompressed: 78\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
________________________ TestCbr.test_extract_cbr_basic ________________________

self = <test_archive.TestCbr testMethod=test_extract_cbr_basic>

    def test_extract_cbr_basic(self):
        test_file = self.get_test_loc('archive/cbr/t.cbr')
        test_dir = self.get_temp_dir()
>       libarchive2.extract(test_file, test_dir)

tests/test_archive.py:2085: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b't/t.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_________ TestCbr.test_extract_cbr_basic_with_weird_filename_extension _________

self = <test_archive.TestCbr testMethod=test_extract_cbr_basic_with_weird_filename_extension>

    def test_extract_cbr_basic_with_weird_filename_extension(self):
        test_file = self.get_test_loc('archive/cbr/t.cbr.foo')
        test_dir = self.get_temp_dir()
>       libarchive2.extract(test_file, test_dir)

tests/test_archive.py:2093: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b't/t.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
________________________ TestCbt.test_extract_cbt_basic ________________________

self = <test_archive.TestCbt testMethod=test_extract_cbt_basic>

    def test_extract_cbt_basic(self):
        test_file = self.get_test_loc('archive/cbt/t.cbt')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:2110: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b't/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_________ TestCbt.test_extract_cbt_basic_with_weird_filename_extension _________

self = <test_archive.TestCbt testMethod=test_extract_cbt_basic_with_weird_filename_extension>

    def test_extract_cbt_basic_with_weird_filename_extension(self):
        test_file = self.get_test_loc('archive/cbt/t.cbt.foo')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:2118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b't/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
________________________ TestCbz.test_extract_cbz_basic ________________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/cbz/t.cbz'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/4zgeknhr'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b't/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestCbz testMethod=test_extract_cbz_basic>

    def test_extract_cbz_basic(self):
        test_file = self.get_test_loc('archive/cbz/t.cbz')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:2135: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...z/t.cbz\nType = zip\nPhysical Size = 194\n\nEverything is Ok\n\nFolders: 1\nFiles: 1\nSize:       2\nCompressed: 194\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_________ TestCbz.test_extract_cbz_basic_with_weird_filename_extension _________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/cbz/t.cbz.foo'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/r5pcg5k5'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b't/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestCbz testMethod=test_extract_cbz_basic_with_weird_filename_extension>

    def test_extract_cbz_basic_with_weird_filename_extension(self):
        test_file = self.get_test_loc('archive/cbz/t.cbz.foo')
        test_dir = self.get_temp_dir()
>       archive.extract_zip(test_file, test_dir)

tests/test_archive.py:2143: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...cbz.foo\nType = zip\nPhysical Size = 194\n\nEverything is Ok\n\nFolders: 1\nFiles: 1\nSize:       2\nCompressed: 194\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_____________________ TestLzip.test_extract_tarlzip_basic ______________________

self = <test_archive.TestLzip testMethod=test_extract_tarlzip_basic>

    def test_extract_tarlzip_basic(self):
        test_file = self.get_test_loc('archive/lzip/sample.tar.lz')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:2156: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'tst/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_____________________ TestLzip.test_uncompress_lzip_basic ______________________

self = <test_archive.TestLzip testMethod=test_uncompress_lzip_basic>

    def test_uncompress_lzip_basic(self):
        test_file = self.get_test_loc('archive/lzip/some.lz')
        test_dir = self.get_temp_dir()
>       archive.extract_lzip(test_file, test_dir)

tests/test_archive.py:2163: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:184: in extract
    msgs.extend(w for w in messages if w)
src/extractcode/libarchive2.py:184: in <genexpr>
    msgs.extend(w for w in messages if w)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

.0 = <map object at 0x7f6f5d6900a0>

>   messages = (w.strip('"\' ') for w in messages)
E   TypeError: a bytes-like object is required, not 'str'

src/extractcode/libarchive2.py:183: TypeError
______________________ TestLz4.test_extract_tarlz4_basic _______________________

self = <test_archive.TestLz4 testMethod=test_extract_tarlz4_basic>

    def test_extract_tarlz4_basic(self):
        test_file = self.get_test_loc('archive/lz4/sample.tar.lz4')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:2172: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'tst/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
______________________ TestLz4.test_uncompress_lz4_basic _______________________

self = <test_archive.TestLz4 testMethod=test_uncompress_lz4_basic>

    def test_uncompress_lz4_basic(self):
        test_file = self.get_test_loc('archive/lz4/some.lz4')
        test_dir = self.get_temp_dir()
>       archive.extract_lzip(test_file, test_dir)

tests/test_archive.py:2179: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:184: in extract
    msgs.extend(w for w in messages if w)
src/extractcode/libarchive2.py:184: in <genexpr>
    msgs.extend(w for w in messages if w)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

.0 = <map object at 0x7f6f5b7e3520>

>   messages = (w.strip('"\' ') for w in messages)
E   TypeError: a bytes-like object is required, not 'str'

src/extractcode/libarchive2.py:183: TypeError
_____________________ TestZstd.test_extract_tarzstd_basic ______________________

self = <test_archive.TestZstd testMethod=test_extract_tarzstd_basic>

    def test_extract_tarzstd_basic(self):
        test_file = self.get_test_loc('archive/zstd/sample.tar.zst')
        test_dir = self.get_temp_dir()
>       archive.extract_tar(test_file, test_dir)

tests/test_archive.py:2188: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'tst/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_____________________ TestZstd.test_uncompress_lzip_basic ______________________

self = <test_archive.TestZstd testMethod=test_uncompress_lzip_basic>

    def test_uncompress_lzip_basic(self):
        test_file = self.get_test_loc('archive/zstd/some.zst')
        test_dir = self.get_temp_dir()
>       archive.extract_lzip(test_file, test_dir)

tests/test_archive.py:2195: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:184: in extract
    msgs.extend(w for w in messages if w)
src/extractcode/libarchive2.py:184: in <genexpr>
    msgs.extend(w for w in messages if w)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

.0 = <map object at 0x7f6f5b823310>

>   messages = (w.strip('"\' ') for w in messages)
E   TypeError: a bytes-like object is required, not 'str'

src/extractcode/libarchive2.py:183: TypeError
_ TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix.test_extract_7zip_with_weird_filenames_with_libarchive_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix testMethod=test_extract_7zip_with_weird_filenames_with_libarchive_posix>

    def test_extract_7zip_with_weird_filenames_with_libarchive_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.7z')
>       self.check_extract_weird_names(
            libarchive2.extract, test_file, expected_warnings=[], expected_suffix='libarch')

tests/test_archive.py:2286: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:2234: in check_extract_weird_names
    warnings = test_function(test_file, test_dir)
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'weird_names/win/AUX'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_ TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix.test_extract_ar_with_weird_filenames_with_libarchive_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix testMethod=test_extract_ar_with_weird_filenames_with_libarchive_posix>
excInstance = Exception('Incorrect file header signature')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/weird_names/weird_names.ar', '/tmp/scancode-tk-tests -h5oxlfwx/zxbexcn7')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5b136c10>
@py_assert8 = 'Incorrect file header signature', @py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5b136c10>\n{<built-in method startswith of ... file header signature'\n{'Incorrect file header signature' = str(Exception('Incorrect file header signature'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'\\:.1.gz'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix testMethod=test_extract_ar_with_weird_filenames_with_libarchive_posix>

    def test_extract_ar_with_weird_filenames_with_libarchive_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.ar')
        test_dir = self.get_temp_dir()
        expected = Exception('Incorrect file header signature')
>       self.assertRaisesInstance(expected, libarchive2.extract, test_file, test_dir)

tests/test_archive.py:2293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix testMethod=test_extract_ar_with_weird_filenames_with_libarchive_posix>
excInstance = Exception('Incorrect file header signature')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/weird_names/weird_names.ar', '/tmp/scancode-tk-tests -h5oxlfwx/zxbexcn7')
kwargs = {}, excClass = <class 'Exception'>
@py_assert2 = "a bytes-like object is required, not 'str'"
@py_assert4 = <built-in method startswith of str object at 0x7f6f5b136c10>
@py_assert8 = 'Incorrect file header signature', @py_assert10 = False
@py_format12 = "assert False\n{False = <built-in method startswith of str object at 0x7f6f5b136c10>\n{<built-in method startswith of ... file header signature'\n{'Incorrect file header signature' = str(Exception('Incorrect file header signature'))\n})\n}"

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           assert False
E            +  where False = <built-in method startswith of str object at 0x7f6f5b136c10>('Incorrect file header signature')
E            +    where <built-in method startswith of str object at 0x7f6f5b136c10> = "a bytes-like object is required, not 'str'".startswith
E            +      where "a bytes-like object is required, not 'str'" = str(TypeError("a bytes-like object is required, not 'str'"))
E            +    and   'Incorrect file header signature' = str(Exception('Incorrect file header signature'))

tests/extractcode_assert_utils.py:178: AssertionError
_ TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix.test_extract_cpio_with_weird_filenames_with_libarchive_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix testMethod=test_extract_cpio_with_weird_filenames_with_libarchive_posix>

    def test_extract_cpio_with_weird_filenames_with_libarchive_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.cpio')
>       self.check_extract_weird_names(
            libarchive2.extract, test_file, expected_warnings=[], expected_suffix='libarch')

tests/test_archive.py:2297: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:2234: in check_extract_weird_names
    warnings = test_function(test_file, test_dir)
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'weird_names/man\\1/\\:.1.gz'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_ TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix.test_extract_tar_with_weird_filenames_with_libarchive_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix testMethod=test_extract_tar_with_weird_filenames_with_libarchive_posix>

    def test_extract_tar_with_weird_filenames_with_libarchive_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.tar')
>       self.check_extract_weird_names(
            libarchive2.extract, test_file, expected_warnings=[], expected_suffix='libarch')

tests/test_archive.py:2302: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:2234: in check_extract_weird_names
    warnings = test_function(test_file, test_dir)
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'weird_names/man\\1/\\:.1.gz'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_ TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix.test_extract_zip_with_weird_filenames_with_libarchive_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix testMethod=test_extract_zip_with_weird_filenames_with_libarchive_posix>

    def test_extract_zip_with_weird_filenames_with_libarchive_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.zip')
>       self.check_extract_weird_names(
            libarchive2.extract, test_file, expected_warnings=[], expected_suffix='libarch')

tests/test_archive.py:2307: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:2234: in check_extract_weird_names
    warnings = test_function(test_file, test_dir)
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'weird_names/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_ TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix.test_extract_7zip_with_weird_filenames_with_sevenzip_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix testMethod=test_extract_7zip_with_weird_filenames_with_sevenzip_posix>

    def test_extract_7zip_with_weird_filenames_with_sevenzip_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.7z')
>       self.check_extract_weird_names(
            sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip')

tests/test_archive.py:2349: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:2234: in check_extract_weird_names
    warnings = test_function(test_file, test_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...hod = LZMA:16\nSolid = +\nBlocks = 1\n\nEverything is Ok\n\nFolders: 4\nFiles: 109\nSize:       398\nCompressed: 799\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_ TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix.test_extract_ar_with_weird_filenames_with_sevenzip_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix testMethod=test_extract_ar_with_weird_filenames_with_sevenzip_posix>

    def test_extract_ar_with_weird_filenames_with_sevenzip_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.ar')
>       self.check_extract_weird_names(
            sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip')

tests/test_archive.py:2354: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:2234: in check_extract_weird_names
    warnings = test_function(test_file, test_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...e = ar\n\nEverything is Ok\n\nArchives with Warnings: 1\n\nWarnings: 1\nFiles: 67\nSize:       239\nCompressed: 7051\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_ TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix.test_extract_cpio_with_weird_filenames_with_sevenzip_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix testMethod=test_extract_cpio_with_weird_filenames_with_sevenzip_posix>

    def test_extract_cpio_with_weird_filenames_with_sevenzip_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.cpio')
>       self.check_extract_weird_names(
            sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip')

tests/test_archive.py:2359: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:2234: in check_extract_weird_names
    warnings = test_function(test_file, test_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... = 11669\nSubType = Portable ASCII\n\nEverything is Ok\n\nFolders: 4\nFiles: 109\nSize:       398\nCompressed: 11669\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_ TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix.test_extract_iso_with_weird_filenames_with_sevenzip_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix testMethod=test_extract_iso_with_weird_filenames_with_sevenzip_posix>

    def test_extract_iso_with_weird_filenames_with_sevenzip_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.iso')
>       self.check_extract_weird_names(
            sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip')

tests/test_archive.py:2364: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:2234: in check_extract_weird_names
    warnings = test_function(test_file, test_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...6\nModified = 2017-01-03 10:41:46\n\nEverything is Ok\n\nFolders: 4\nFiles: 109\nSize:       398\nCompressed: 624640\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_ TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix.test_extract_tar_with_weird_filenames_with_sevenzip_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix testMethod=test_extract_tar_with_weird_filenames_with_sevenzip_posix>

    def test_extract_tar_with_weird_filenames_with_sevenzip_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.tar')
>       self.check_extract_weird_names(
            sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip')

tests/test_archive.py:2375: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:2234: in check_extract_weird_names
    warnings = test_function(test_file, test_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...s Size = 58880\nCode Page = UTF-8\n\nEverything is Ok\n\nFolders: 4\nFiles: 109\nSize:       398\nCompressed: 114688\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_ TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix.test_extract_zip_with_weird_filenames_with_sevenzip_posix _

self = <test_archive.TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix testMethod=test_extract_zip_with_weird_filenames_with_sevenzip_posix>

    def test_extract_zip_with_weird_filenames_with_sevenzip_posix(self):
        test_file = self.get_test_loc('archive/weird_names/weird_names.zip')
>       self.check_extract_weird_names(
            sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip')

tests/test_archive.py:2380: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_archive.py:2234: in check_extract_weird_names
    warnings = test_function(test_file, test_dir)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...nType = zip\nPhysical Size = 19858\n\nEverything is Ok\n\nFolders: 4\nFiles: 109\nSize:       398\nCompressed: 19858\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__________________ TestZipSlip.test_extract_zipslip_tar_posix __________________

self = <test_archive.TestZipSlip testMethod=test_extract_zipslip_tar_posix>

    @pytest.mark.skipif(on_windows, reason='Fails with WindowsError: [Error 206] The filename or extension is too long:')
    def test_extract_zipslip_tar_posix(self):
        test_file = self.get_test_loc('archive/zipslip/zip-slip.tar')
        test_dir = self.get_temp_dir()
>       result = archive.extract_tar(test_file, test_dir)

tests/test_archive.py:2709: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'good.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
___________________ TestZipSlip.test_extract_zipslip_tar_win ___________________

self = <test_archive.TestZipSlip testMethod=test_extract_zipslip_tar_win>

    @pytest.mark.skipif(on_windows, reason='Fails with WindowsError: [Error 206] The filename or extension is too long:')
    def test_extract_zipslip_tar_win(self):
        test_file = self.get_test_loc('archive/zipslip/zip-slip-win.tar')
        test_dir = self.get_temp_dir()
>       result = archive.extract_tar(test_file, test_dir)

tests/test_archive.py:2721: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'good.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
__________________ TestZipSlip.test_extract_zipslip_zip_posix __________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zipslip/zip-slip.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/rhh5jc9v'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'good.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZipSlip testMethod=test_extract_zipslip_zip_posix>

    def test_extract_zipslip_zip_posix(self):
        test_file = self.get_test_loc('archive/zipslip/zip-slip.zip')
        test_dir = self.get_temp_dir()
>       result = archive.extract_zip(test_file, test_dir)

tests/test_archive.py:2672: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...pslip/zip-slip.zip\nType = zip\nPhysical Size = 545\n\nEverything is Ok\n\nFiles: 2\nSize:       39\nCompressed: 545\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
___________________ TestZipSlip.test_extract_zipslip_zip_win ___________________

location = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/archive/zipslip/zip-slip-win.zip'
target_dir = '/tmp/scancode-tk-tests -h5oxlfwx/00edhlx6'
extractor1 = <function extract at 0x7f6f5bf6c720>
extractor2 = <function extract at 0x7f6f5bf6d620>

    def extract_with_fallback(location, target_dir, extractor1, extractor2):
        """
        Extract archive at `location` to `target_dir` trying first the primary
        `extractor1` function. If extract fails with this function, attempt
        extraction again with the fallback `extractor2` function.
        Return a list of warning messages. Raise exceptions on errors.
    
        Note: there are a few cases where the primary extractor for a type may fail
        and a fallback extractor will succeed.
        """
        abs_location = os.path.abspath(os.path.expanduser(location))
        abs_target_dir = str(os.path.abspath(os.path.expanduser(target_dir)))
        # attempt extract first to a temp dir
        temp_target1 = str(fileutils.get_temp_dir(prefix='extractcode-extract1-'))
        try:
>           warnings = extractor1(abs_location, temp_target1)

src/extractcode/archive.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'good.txt'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError

During handling of the above exception, another exception occurred:

self = <test_archive.TestZipSlip testMethod=test_extract_zipslip_zip_win>

    def test_extract_zipslip_zip_win(self):
        test_file = self.get_test_loc('archive/zipslip/zip-slip-win.zip')
        test_dir = self.get_temp_dir()
>       result = archive.extract_zip(test_file, test_dir)

tests/test_archive.py:2690: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/archive.py:423: in extract_with_fallback
    warnings = extractor2(abs_location, temp_target2)
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...p/zip-slip-win.zip\nType = zip\nPhysical Size = 547\n\nEverything is Ok\n\nFiles: 2\nSize:       39\nCompressed: 547\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_________________ TestExtract.test_extract_archive_non_nested __________________

self = <test_extract.TestExtract testMethod=test_extract_archive_non_nested>

    def test_extract_archive_non_nested(self):
        test_dir = self.get_test_loc('extract/basic_non_nested.tar.gz', copy=True)
        expected = (
            'a/b/a.txt',
            'a/b/b.txt',
            'a/c/c.txt',
        )
        result = extract.extract(test_dir, recurse=False)
>       check_no_error(result)

tests/test_extract.py:70: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = <generator object extract at 0x7f6f5b7cda80>

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/_k1qr4e4/basic_non_nested.tar.gz', target='/tmp/scancode-tk-test...k1qr4e4/basic_non_nested.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
________ TestExtract.test_extract_archive_shallow_with_readonly_inside _________

self = <test_extract.TestExtract testMethod=test_extract_archive_shallow_with_readonly_inside>

    def test_extract_archive_shallow_with_readonly_inside(self):
        test_file = self.get_test_loc('extract/readonly/read_only.tar.gz', copy=True)
        """
        This test file was created with:
            import tarfile, time, datetime, io, os
            TEXT = 'something\n'
            tar = tarfile.open('read_only.tar.gz', 'w:gz')
            for i in range(0, 2):
                tarinfo = tarfile.TarInfo()
                tarinfo.name = 'somefilename-%i.txt' % i
                tarinfo.uid = 123
                tarinfo.gid = 456
                tarinfo.uname = 'johndoe'
                tarinfo.gname = 'fake'
                tarinfo.type = tarfile.REGTYPE
                tarinfo.mode = 0 # this is the readonly part
                tarinfo.mtime = time.mktime(datetime.datetime.now().timetuple())
                file = io.StringIO()
                file.write(TEXT)
                file.seek(0)
                tarinfo.size = len(TEXT)
                tar.addfile(tarinfo, file)
            tar.close()
        """
        result = list(extract.extract(test_file, recurse=False))
>       check_no_error(result)

tests/test_extract.py:102: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/s512k_mg/read_only.tar.gz', target='/tmp/scancode-tk-tests -h5o...lfwx/s512k_mg/read_only.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/s512k_mg/read_only.tar.gz', target='/tmp/scancode-tk-tests -h5oxlfwx/s512k_mg/read_only.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
____________ TestExtract.test_extract_can_extract_to_relative_paths ____________

test_dir = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tmp/tmpod01j4fq/basic.zip-extract'
expected = ['c/a/a.txt', 'c/b/a.txt', 'c/c/a.txt'], regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
>           assert result == expected_content
E           AssertionError: assert [] == ['c/a/a.txt',..., 'c/c/a.txt']
E             
E             Right contains 3 more items, first extra item: 'c/a/a.txt'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:83: AssertionError

During handling of the above exception, another exception occurred:

self = <test_extract.TestExtract testMethod=test_extract_can_extract_to_relative_paths>

    def test_extract_can_extract_to_relative_paths(self):
        # The setup is a tad complex because we want to have a relative dir
        # to the base dir where we run tests from, i.e. the git checkout dir
        # To use relative paths, we use our tmp dir at the root of the code tree
        from os.path import join, abspath
        import shutil
        import tempfile
    
        project_tmp = join(project_root, 'tmp')
        fileutils.create_dir(project_tmp)
        project_root_abs = abspath(project_root)
        test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root_abs, '').strip('\\/')
        test_file = self.get_test_loc('extract/relative_path/basic.zip')
        shutil.copy(test_file, test_src_dir)
        test_src_file = join(test_src_dir, 'basic.zip')
        test_tgt_dir = join(project_root, test_src_file) + extractcode.EXTRACT_SUFFIX
        result = list(extract.extract(test_src_file))
        expected = ['c/a/a.txt', 'c/b/a.txt', 'c/c/a.txt']
>       check_files(test_tgt_dir, expected)

tests/test_extract.py:815: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

test_dir = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tmp/tmpod01j4fq/basic.zip-extract'
expected = ['c/a/a.txt', 'c/b/a.txt', 'c/c/a.txt'], regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
            assert result == expected_content
        except AssertionError:
            files = [
                'test_dir: file://{}'.format(test_dir),
                'expected: file://{}'.format(expected if expected_is_json_file else ''),
            ]
>           assert result == files + expected_content
E           AssertionError: assert [] == ['test_dir: f..., 'c/c/a.txt']
E             
E             Right contains 5 more items, first extra item: 'test_dir: file:///builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tmp/tmpod01j4fq/basic.zip-extract'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:89: AssertionError
__________ TestExtract.test_extract_dir_shallow_with_readonly_inside ___________

self = <test_extract.TestExtract testMethod=test_extract_dir_shallow_with_readonly_inside>

    def test_extract_dir_shallow_with_readonly_inside(self):
        test_dir = self.get_test_loc('extract/readonly', copy=True)
        result = list(extract.extract(test_dir, recurse=False))
>       check_no_error(result)

tests/test_extract.py:114: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/qj3prk9z/readonly/read_only.tar.gz', target='/tmp/scancode-tk-t...rk9z/readonly/read_only.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/qj3prk9z/readonly/read_only.tar.gz', target='/tmp/scancode-tk-te...prk9z/readonly/read_only.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
____ TestExtract.test_extract_dir_with_nested_tar_file_shallow_then_recurse ____

self = <test_extract.TestExtract testMethod=test_extract_dir_with_nested_tar_file_shallow_then_recurse>

    def test_extract_dir_with_nested_tar_file_shallow_then_recurse(self):
        test_dir = self.get_test_loc('extract/nested', copy=True)
        expected = [
            'nested_tars.tar.gz',
            'nested_tars.tar.gz-extract/b/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/.svn/entries',
            'nested_tars.tar.gz-extract/b/.svn/format',
            'nested_tars.tar.gz-extract/b/a/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/a/.svn/entries',
            'nested_tars.tar.gz-extract/b/a/.svn/format',
            'nested_tars.tar.gz-extract/b/a/.svn/prop-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/a/.svn/text-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/a/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz-extract/a/b/a.txt',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz-extract/a/b/b.txt',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz-extract/a/c/c.txt',
            'nested_tars.tar.gz-extract/b/a/a.txt',
            'nested_tars.tar.gz-extract/b/b/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/b/.svn/entries',
            'nested_tars.tar.gz-extract/b/b/.svn/format',
            'nested_tars.tar.gz-extract/b/b/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/b/a.txt',
            'nested_tars.tar.gz-extract/b/c/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/c/.svn/entries',
            'nested_tars.tar.gz-extract/b/c/.svn/format',
            'nested_tars.tar.gz-extract/b/c/.svn/prop-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/c/.svn/text-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/c/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz-extract/a/b/a.txt',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz-extract/a/b/b.txt',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz-extract/a/c/c.txt',
            'nested_tars.tar.gz-extract/b/c/a.txt'
        ]
        result1 = list(extract.extract(test_dir, recurse=False))
        result2 = list(extract.extract(test_dir, recurse=True))
>       check_no_error(result1)

tests/test_extract.py:602: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/oz_1fl4l/nested/nested_tars.tar.gz', target='/tmp/scancode-tk-t...fl4l/nested/nested_tars.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/oz_1fl4l/nested/nested_tars.tar.gz', target='/tmp/scancode-tk-te...1fl4l/nested/nested_tars.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
__________ TestExtract.test_extract_directory_of_windows_ar_archives ___________

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/aorw67e6/winlib'
expected = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/extract/ar_tree/winlib-expected.json'
regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
>           assert result == expected_content
E           AssertionError: assert ['gsdll32.lib...', 'zlib.lib'] == ['gsdll32.lib..._12.dll', ...]
E             
E             At index 1 diff: 'htmlhelp.lib' != 'gsdll32.lib-extract/GSDLL32.dll'
E             Right contains 51 more items, first extra item: 'gsdll32.lib-extract/GSDLL32_12.dll'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:83: AssertionError

During handling of the above exception, another exception occurred:

self = <test_extract.TestExtract testMethod=test_extract_directory_of_windows_ar_archives>

    def test_extract_directory_of_windows_ar_archives(self):
        test_dir = self.get_test_loc('extract/ar_tree/winlib', copy=True)
        result = list(extract.extract(test_dir, recurse=True))
        expected = self.get_test_loc('extract/ar_tree/winlib-expected.json')
>       check_files(test_dir, expected, regen=False)

tests/test_extract.py:653: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/aorw67e6/winlib'
expected = '/builddir/build/BUILD/python-extractcode-31.0.0-build/extractcode-31.0.0/tests/data/extract/ar_tree/winlib-expected.json'
regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
            assert result == expected_content
        except AssertionError:
            files = [
                'test_dir: file://{}'.format(test_dir),
                'expected: file://{}'.format(expected if expected_is_json_file else ''),
            ]
>           assert result == files + expected_content
E           AssertionError: assert ['gsdll32.lib...', 'zlib.lib'] == ['test_dir: f..._10.dll', ...]
E             
E             At index 0 diff: 'gsdll32.lib' != 'test_dir: file:///tmp/scancode-tk-tests -h5oxlfwx/aorw67e6/winlib'
E             Right contains 53 more items, first extra item: 'gsdll32.lib-extract/GSDLL32_10.dll'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:89: AssertionError
_____________ TestExtract.test_extract_directory_with_office_docs ______________

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/z0znhg2j/office_docs'
expected = ['abc.docx', 'abc.docx-extract/[Content_Types].xml', 'abc.docx-extract/docProps/app.xml', 'abc.docx-extract/docProps/core.xml', 'abc.docx-extract/_rels/.rels', 'abc.docx-extract/word/fontTable.xml', ...]
regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
>           assert result == expected_content
E           AssertionError: assert ['abc.docx', ...', 'ppt.pptx'] == ['abc.docx', ...ml.rels', ...]
E             
E             At index 1 diff: 'excel.xlsx' != 'abc.docx-extract/[Content_Types].xml'
E             Right contains 76 more items, first extra item: 'abc.docx-extract/docProps/app.xml'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:83: AssertionError

During handling of the above exception, another exception occurred:

self = <test_extract.TestExtract testMethod=test_extract_directory_with_office_docs>

    def test_extract_directory_with_office_docs(self):
        test_dir = self.get_test_loc('extract/office_docs', copy=True)
        result = list(extract.extract(test_dir, kinds=(extractcode.docs,), recurse=True))
        expected = [
            'abc.docx',
            'abc.docx-extract/[Content_Types].xml',
            'abc.docx-extract/docProps/app.xml',
            'abc.docx-extract/docProps/core.xml',
            'abc.docx-extract/_rels/.rels',
            'abc.docx-extract/word/fontTable.xml',
            'abc.docx-extract/word/document.xml',
            'abc.docx-extract/word/settings.xml',
            'abc.docx-extract/word/numbering.xml',
            'abc.docx-extract/word/activeX/activeX1.xml',
            'abc.docx-extract/word/activeX/activeX2.xml',
            'abc.docx-extract/word/activeX/activeX3.xml',
            'abc.docx-extract/word/activeX/_rels/activeX1.xml.rels',
            'abc.docx-extract/word/activeX/_rels/activeX2.xml.rels',
            'abc.docx-extract/word/activeX/_rels/activeX3.xml.rels',
            'abc.docx-extract/word/activeX/activeX1.bin',
            'abc.docx-extract/word/activeX/activeX3.bin',
            'abc.docx-extract/word/activeX/activeX2.bin',
            'abc.docx-extract/word/webSettings.xml',
            'abc.docx-extract/word/styles.xml',
            'abc.docx-extract/word/theme/theme1.xml',
            'abc.docx-extract/word/_rels/document.xml.rels',
            'abc.docx-extract/word/stylesWithEffects.xml',
            'abc.docx-extract/word/media/image1.gif',
            'abc.docx-extract/word/media/image4.wmf',
            'abc.docx-extract/word/media/image2.wmf',
            'abc.docx-extract/word/media/image3.wmf',
    
            'excel.xlsx',
            'excel.xlsx-extract/[Content_Types].xml',
            'excel.xlsx-extract/docProps/app.xml',
            'excel.xlsx-extract/docProps/core.xml',
            'excel.xlsx-extract/_rels/.rels',
            'excel.xlsx-extract/xl/workbook.xml',
            'excel.xlsx-extract/xl/worksheets/sheet2.xml',
            'excel.xlsx-extract/xl/worksheets/sheet3.xml',
            'excel.xlsx-extract/xl/worksheets/sheet1.xml',
            'excel.xlsx-extract/xl/styles.xml',
            'excel.xlsx-extract/xl/theme/theme1.xml',
            'excel.xlsx-extract/xl/_rels/workbook.xml.rels',
            'excel.xlsx-extract/xl/sharedStrings.xml',
    
            'ppt.pptx',
            'ppt.pptx-extract/[Content_Types].xml',
            'ppt.pptx-extract/docProps/app.xml',
            'ppt.pptx-extract/docProps/thumbnail.jpeg',
            'ppt.pptx-extract/docProps/core.xml',
            'ppt.pptx-extract/_rels/.rels',
            'ppt.pptx-extract/ppt/viewProps.xml',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout9.xml',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout8.xml',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout5.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout4.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout2.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout3.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout8.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout9.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout11.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout10.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout6.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout7.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/_rels/slideLayout1.xml.rels',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout3.xml',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout2.xml',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout1.xml',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout5.xml',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout4.xml',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout6.xml',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout10.xml',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout11.xml',
            'ppt.pptx-extract/ppt/slideLayouts/slideLayout7.xml',
            'ppt.pptx-extract/ppt/presentation.xml',
            'ppt.pptx-extract/ppt/slideMasters/slideMaster1.xml',
            'ppt.pptx-extract/ppt/slideMasters/_rels/slideMaster1.xml.rels',
            'ppt.pptx-extract/ppt/slides/slide1.xml',
            'ppt.pptx-extract/ppt/slides/_rels/slide1.xml.rels',
            'ppt.pptx-extract/ppt/theme/theme1.xml',
            'ppt.pptx-extract/ppt/_rels/presentation.xml.rels',
            'ppt.pptx-extract/ppt/presProps.xml',
            'ppt.pptx-extract/ppt/tableStyles.xml',
            'ppt.pptx-extract/ppt/media/image1.png'
        ]
>       check_files(test_dir, expected)

tests/test_extract.py:754: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/z0znhg2j/office_docs'
expected = ['abc.docx', 'abc.docx-extract/[Content_Types].xml', 'abc.docx-extract/docProps/app.xml', 'abc.docx-extract/docProps/core.xml', 'abc.docx-extract/_rels/.rels', 'abc.docx-extract/word/fontTable.xml', ...]
regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
            assert result == expected_content
        except AssertionError:
            files = [
                'test_dir: file://{}'.format(test_dir),
                'expected: file://{}'.format(expected if expected_is_json_file else ''),
            ]
>           assert result == files + expected_content
E           AssertionError: assert ['abc.docx', ...', 'ppt.pptx'] == ['test_dir: f...app.xml', ...]
E             
E             At index 0 diff: 'abc.docx' != 'test_dir: file:///tmp/scancode-tk-tests -h5oxlfwx/z0znhg2j/office_docs'
E             Right contains 78 more items, first extra item: 'abc.docx-extract/[Content_Types].xml'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:89: AssertionError
____________________ TestExtract.test_extract_file_function ____________________

self = <test_extract.TestExtract testMethod=test_extract_file_function>

    def test_extract_file_function(self):
        test_file = self.get_test_loc('extract/basic_non_nested.tar.gz', copy=True)
        base = fileutils.parent_directory(test_file)
        expected = ['a/b/a.txt', 'a/b/b.txt', 'a/c/c.txt']
        cleaned_test_file = test_file.replace(base, '')
        expected_event = [
            extract.ExtractEvent(
                source=cleaned_test_file,
                target=extractcode.get_extraction_path(cleaned_test_file),
                done=False, warnings=[], errors=[]
            ),
            extract.ExtractEvent(
                source=cleaned_test_file,
                target=extractcode.get_extraction_path(cleaned_test_file),
                done=True, warnings=[], errors=[]
            )
        ]
    
        target = extractcode.get_extraction_path(test_file)
        result = list(extract.extract_file(test_file, target))
        result = [r._replace(
                    source=cleaned_test_file,
                    target=extractcode.get_extraction_path(cleaned_test_file))
                  for r in result]
>       assert expected_event == result
E       assert [ExtractEvent...], errors=[])] == [ExtractEvent..., not 'str"])]
E         
E         At index 1 diff: ExtractEvent(source='basic_non_nested.tar.gz', target='basic_non_nested.tar.gz-extract', done=True, warnings=[], errors=[]) != ExtractEvent(source='basic_non_nested.tar.gz', target='basic_non_nested.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])
E         Use -v to get more diff

tests/test_extract.py:59: AssertionError
_______ TestExtract.test_extract_file_handles_archives_of_default_kinds ________

self = <test_extract.TestExtract testMethod=test_extract_file_handles_archives_of_default_kinds>

    def test_extract_file_handles_archives_of_default_kinds(self):
        test_dir = self.get_test_loc('extract/all_formats/c.zip', copy=True)
        base = fileutils.parent_directory(test_dir)
        expected = [
            'c/a/a.txt',
            'c/b/a.txt',
            'c/c/a.txt',
        ]
        cleaned_test_file = test_dir.replace(base, '')
        expected_events = [
            extract.ExtractEvent(
                source=cleaned_test_file,
                target=extractcode.get_extraction_path(cleaned_test_file),
                done=False, warnings=[], errors=[]
            ),
            extract.ExtractEvent(
                source=cleaned_test_file,
                target=extractcode.get_extraction_path(cleaned_test_file),
                done=True, warnings=[], errors=[]
            )
        ]
    
        target = extractcode.get_extraction_path(test_dir)
        result = list(extract.extract_file(test_dir, target))
        result = [
            r._replace(
                source=cleaned_test_file,
                target=extractcode.get_extraction_path(cleaned_test_file))
            for r in result
        ]
>       assert result == expected_events
E       AssertionError: assert [ExtractEvent... not bytes'])] == [ExtractEvent...], errors=[])]
E         
E         At index 1 diff: ExtractEvent(source='c.zip', target='c.zip-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes']) != ExtractEvent(source='c.zip', target='c.zip-extract', done=True, warnings=[], errors=[])
E         Use -v to get more diff

tests/test_extract.py:962: AssertionError
______________ TestExtract.test_extract_file_works_with_all_kinds ______________

self = <test_extract.TestExtract testMethod=test_extract_file_works_with_all_kinds>

    def test_extract_file_works_with_all_kinds(self):
        test_dir = self.get_test_loc('extract/all_formats/doc.docx', copy=True)
        base = fileutils.parent_directory(test_dir)
        expected = [
            'c/a/a.txt',
            'c/b/a.txt',
            'c/c/a.txt',
        ]
        cleaned_test_file = test_dir.replace(base, '')
        expected_events = [
            extract.ExtractEvent(source='doc.docx', target='doc.docx-extract', done=False, warnings=[], errors=[]),
            extract.ExtractEvent(source='doc.docx', target='doc.docx-extract', done=True, warnings=[], errors=[]),
        ]
    
        target = extractcode.get_extraction_path(test_dir)
        result = list(extract.extract_file(test_dir, target, kinds=all_kinds))
        result = [
            r._replace(
                source=cleaned_test_file,
                target=extractcode.get_extraction_path(cleaned_test_file))
            for r in result
        ]
>       assert result == expected_events
E       AssertionError: assert [ExtractEvent... not bytes'])] == [ExtractEvent...], errors=[])]
E         
E         At index 1 diff: ExtractEvent(source='doc.docx', target='doc.docx-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes']) != ExtractEvent(source='doc.docx', target='doc.docx-extract', done=True, warnings=[], errors=[])
E         Use -v to get more diff

tests/test_extract.py:987: AssertionError
__________________ TestExtract.test_extract_ignore_directory ___________________

self = <test_extract.TestExtract testMethod=test_extract_ignore_directory>

    def test_extract_ignore_directory(self):
        test_dir = self.get_test_loc('extract/ignore', copy=True)
        expected = [
            'alpha.zip',
            'alpha.zip-extract/a.txt',
            'alpha.zip-extract/beta.zip',
            'alpha.zip-extract/beta.zip-extract/b.txt',
            'alpha.zip-extract/gamma.tar',
            'alpha.zip-extract/gamma.tar-extract/c.txt',
            'beta.tar',
            'beta.tar-extract/a.txt',
            'beta.tar-extract/b.txt',
            'beta.tar-extract/c.txt',
            'gamma/gamma.zip',
        ]
        result = list(extract.extract(test_dir, recurse=True, ignore_pattern=('gamma',)))
>       check_no_error(result)

tests/test_extract.py:892: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/regs8jpt/ignore/alpha.zip', target='/tmp/scancode-tk-tests -h5o...xlfwx/regs8jpt/ignore/beta.tar-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           AssertionError: assert not ['normalize() argument 2 must be str, not bytes']
E            +  where ['normalize() argument 2 must be str, not bytes'] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/regs8jpt/ignore/alpha.zip', target='/tmp/scancode-tk-tests -h5oxlfwx/regs8jpt/ignore/alpha.zip-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes']).errors

tests/extractcode_assert_utils.py:102: AssertionError
_____________________ TestExtract.test_extract_ignore_file _____________________

self = <test_extract.TestExtract testMethod=test_extract_ignore_file>

    def test_extract_ignore_file(self):
        test_dir = self.get_test_loc('extract/ignore', copy=True)
        expected = [
            'alpha.zip',
            'beta.tar',
            'beta.tar-extract/a.txt',
            'beta.tar-extract/b.txt',
            'beta.tar-extract/c.txt',
            'gamma/gamma.zip',
            'gamma/gamma.zip-extract/c.txt'
        ]
        result = list(extract.extract(test_dir, recurse=True, ignore_pattern=('alpha.zip',)))
>       check_no_error(result)

tests/test_extract.py:873: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/xrbihwpi/ignore/beta.tar', target='/tmp/scancode-tk-tests -h5ox...wpi/ignore/gamma/gamma.zip-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes'])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/xrbihwpi/ignore/beta.tar', target='/tmp/scancode-tk-tests -h5oxlfwx/xrbihwpi/ignore/beta.tar-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
___________________ TestExtract.test_extract_ignore_pattern ____________________

self = <test_extract.TestExtract testMethod=test_extract_ignore_pattern>

    def test_extract_ignore_pattern(self):
        test_dir = self.get_test_loc('extract/ignore', copy=True)
        expected = [
            'alpha.zip',
            'alpha.zip-extract/a.txt',
            'alpha.zip-extract/beta.zip',
            'alpha.zip-extract/gamma.tar',
            'alpha.zip-extract/gamma.tar-extract/c.txt',
            'beta.tar',
            'beta.tar-extract/a.txt',
            'beta.tar-extract/b.txt',
            'beta.tar-extract/c.txt',
            'gamma/gamma.zip',
            'gamma/gamma.zip-extract/c.txt'
        ]
        result = list(extract.extract(test_dir, recurse=True, ignore_pattern=('b*.zip',)))
>       check_no_error(result)

tests/test_extract.py:911: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/aztls96h/ignore/alpha.zip', target='/tmp/scancode-tk-tests -h5o...96h/ignore/gamma/gamma.zip-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes'])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           AssertionError: assert not ['normalize() argument 2 must be str, not bytes']
E            +  where ['normalize() argument 2 must be str, not bytes'] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/aztls96h/ignore/alpha.zip', target='/tmp/scancode-tk-tests -h5oxlfwx/aztls96h/ignore/alpha.zip-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes']).errors

tests/extractcode_assert_utils.py:102: AssertionError
_ TestExtract.test_extract_nested_arch_with_corruption_should_extract_inner_archives_only_once _

self = <test_extract.TestExtract testMethod=test_extract_nested_arch_with_corruption_should_extract_inner_archives_only_once>

    def test_extract_nested_arch_with_corruption_should_extract_inner_archives_only_once(self):
        test_file = self.get_test_loc(
            'extract/nested_not_compressed/nested_with_not_compressed_gz_file.tgz', copy=True)
        expected = [
            'nested_with_not_compressed_gz_file.tgz',
            'nested_with_not_compressed_gz_file.tgz-extract/top/file',
            'nested_with_not_compressed_gz_file.tgz-extract/top/notcompressed.gz'
        ]
        result = list(extract.extract(test_file, recurse=True))
>       check_no_error(result)

tests/test_extract.py:665: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/git6gfsq/nested_with_not_compressed_gz_file.tgz', target='/tmp/...ith_not_compressed_gz_file.tgz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/git6gfsq/nested_with_not_compressed_gz_file.tgz', target='/tmp/s...with_not_compressed_gz_file.tgz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
____________ TestExtract.test_extract_nested_tar_file_recurse_only _____________

self = <test_extract.TestExtract testMethod=test_extract_nested_tar_file_recurse_only>

    def test_extract_nested_tar_file_recurse_only(self):
        test_file = self.get_test_loc('extract/nested/nested_tars.tar.gz', copy=True)
        expected = [
            'nested_tars.tar.gz',
            'nested_tars.tar.gz-extract/b/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/.svn/entries',
            'nested_tars.tar.gz-extract/b/.svn/format',
            'nested_tars.tar.gz-extract/b/a/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/a/.svn/entries',
            'nested_tars.tar.gz-extract/b/a/.svn/format',
            'nested_tars.tar.gz-extract/b/a/.svn/prop-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/a/.svn/text-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/a/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz-extract/a/b/a.txt',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz-extract/a/b/b.txt',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz-extract/a/c/c.txt',
            'nested_tars.tar.gz-extract/b/a/a.txt',
            'nested_tars.tar.gz-extract/b/b/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/b/.svn/entries',
            'nested_tars.tar.gz-extract/b/b/.svn/format',
            'nested_tars.tar.gz-extract/b/b/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/b/a.txt',
            'nested_tars.tar.gz-extract/b/c/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/c/.svn/entries',
            'nested_tars.tar.gz-extract/b/c/.svn/format',
            'nested_tars.tar.gz-extract/b/c/.svn/prop-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/c/.svn/text-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/c/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz-extract/a/b/a.txt',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz-extract/a/b/b.txt',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz-extract/a/c/c.txt',
            'nested_tars.tar.gz-extract/b/c/a.txt'
        ]
        result = list(extract.extract(test_file, recurse=True))
>       check_no_error(result)

tests/test_extract.py:488: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/onrxwhb_/nested_tars.tar.gz', target='/tmp/scancode-tk-tests -h...wx/onrxwhb_/nested_tars.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/onrxwhb_/nested_tars.tar.gz', target='/tmp/scancode-tk-tests -h5oxlfwx/onrxwhb_/nested_tars.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
____________ TestExtract.test_extract_nested_tar_file_shallow_only _____________

self = <test_extract.TestExtract testMethod=test_extract_nested_tar_file_shallow_only>

    def test_extract_nested_tar_file_shallow_only(self):
        test_dir = self.get_test_loc('extract/nested/nested_tars.tar.gz', copy=True)
        expected = [
            'nested_tars.tar.gz',
            'nested_tars.tar.gz-extract/b/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/.svn/entries',
            'nested_tars.tar.gz-extract/b/.svn/format',
            'nested_tars.tar.gz-extract/b/a/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/a/.svn/entries',
            'nested_tars.tar.gz-extract/b/a/.svn/format',
            'nested_tars.tar.gz-extract/b/a/.svn/prop-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/a/.svn/text-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/a/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz',
            'nested_tars.tar.gz-extract/b/a/a.txt',
            'nested_tars.tar.gz-extract/b/b/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/b/.svn/entries',
            'nested_tars.tar.gz-extract/b/b/.svn/format',
            'nested_tars.tar.gz-extract/b/b/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/b/a.txt',
            'nested_tars.tar.gz-extract/b/c/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/c/.svn/entries',
            'nested_tars.tar.gz-extract/b/c/.svn/format',
            'nested_tars.tar.gz-extract/b/c/.svn/prop-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/c/.svn/text-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/c/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz',
            'nested_tars.tar.gz-extract/b/c/a.txt'
        ]
        result1 = list(extract.extract(test_dir, recurse=False))
>       check_no_error(result1)

tests/test_extract.py:521: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/jzer243_/nested_tars.tar.gz', target='/tmp/scancode-tk-tests -h...wx/jzer243_/nested_tars.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/jzer243_/nested_tars.tar.gz', target='/tmp/scancode-tk-tests -h5oxlfwx/jzer243_/nested_tars.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
________ TestExtract.test_extract_nested_tar_file_shallow_then_recurse _________

self = <test_extract.TestExtract testMethod=test_extract_nested_tar_file_shallow_then_recurse>

    def test_extract_nested_tar_file_shallow_then_recurse(self):
        test_file = self.get_test_loc('extract/nested/nested_tars.tar.gz', copy=True)
        expected = [
            'nested_tars.tar.gz',
            'nested_tars.tar.gz-extract/b/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/.svn/entries',
            'nested_tars.tar.gz-extract/b/.svn/format',
            'nested_tars.tar.gz-extract/b/a/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/a/.svn/entries',
            'nested_tars.tar.gz-extract/b/a/.svn/format',
            'nested_tars.tar.gz-extract/b/a/.svn/prop-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/a/.svn/text-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/a/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz-extract/a/b/a.txt',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz-extract/a/b/b.txt',
            'nested_tars.tar.gz-extract/b/a/a.tar.gz-extract/a/c/c.txt',
            'nested_tars.tar.gz-extract/b/a/a.txt',
            'nested_tars.tar.gz-extract/b/b/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/b/.svn/entries',
            'nested_tars.tar.gz-extract/b/b/.svn/format',
            'nested_tars.tar.gz-extract/b/b/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/b/a.txt',
            'nested_tars.tar.gz-extract/b/c/.svn/all-wcprops',
            'nested_tars.tar.gz-extract/b/c/.svn/entries',
            'nested_tars.tar.gz-extract/b/c/.svn/format',
            'nested_tars.tar.gz-extract/b/c/.svn/prop-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/c/.svn/text-base/a.tar.gz.svn-base',
            'nested_tars.tar.gz-extract/b/c/.svn/text-base/a.txt.svn-base',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz-extract/a/b/a.txt',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz-extract/a/b/b.txt',
            'nested_tars.tar.gz-extract/b/c/a.tar.gz-extract/a/c/c.txt',
            'nested_tars.tar.gz-extract/b/c/a.txt'
        ]
        result1 = list(extract.extract(test_file, recurse=False))
        result2 = list(extract.extract(test_file, recurse=True))
>       check_no_error(result1)

tests/test_extract.py:561: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/8uu3z1p2/nested_tars.tar.gz', target='/tmp/scancode-tk-tests -h...wx/8uu3z1p2/nested_tars.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/8uu3z1p2/nested_tars.tar.gz', target='/tmp/scancode-tk-tests -h5oxlfwx/8uu3z1p2/nested_tars.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
_____________ TestExtract.test_extract_tar_gz_with_spaces_in_name ______________

self = <test_extract.TestExtract testMethod=test_extract_tar_gz_with_spaces_in_name>

    def test_extract_tar_gz_with_spaces_in_name(self):
        test_dir = self.get_test_loc('extract/space-tgz', copy=True)
        expected = (
            'with spaces in name.tar.gz',
            'with spaces in name.tar.gz-extract/a/b/a.txt',
            'with spaces in name.tar.gz-extract/a/b/b.txt',
            'with spaces in name.tar.gz-extract/a/c/c.txt',
        )
        result = list(extract.extract(test_dir, recurse=True))
>       check_no_error(result)

tests/test_extract.py:625: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/6fyrgn_x/space-tgz/with spaces in name.tar.gz', target='/tmp/sc...tgz/with spaces in name.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/6fyrgn_x/space-tgz/with spaces in name.tar.gz', target='/tmp/sca...-tgz/with spaces in name.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
________________ TestExtract.test_extract_tar_with_broken_links ________________

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/eqod1k5c/broken_link'
expected = ('broken-link.tar.bz2', 'broken-link.tar.bz2-extract/openssl/test/Makefile')
regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
>           assert result == expected_content
E           AssertionError: assert ['broken-link.tar.bz2'] == ['broken-link...est/Makefile']
E             
E             Right contains one more item: 'broken-link.tar.bz2-extract/openssl/test/Makefile'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:83: AssertionError

During handling of the above exception, another exception occurred:

self = <test_extract.TestExtract testMethod=test_extract_tar_with_broken_links>

    def test_extract_tar_with_broken_links(self):
        test_dir = self.get_test_loc('extract/broken_link', copy=True)
        result = list(extract.extract(test_dir, recurse=True))
        expected = (
            'broken-link.tar.bz2',
            'broken-link.tar.bz2-extract/openssl/test/Makefile',
        )
>       check_files(test_dir, expected)

tests/test_extract.py:447: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/eqod1k5c/broken_link'
expected = ('broken-link.tar.bz2', 'broken-link.tar.bz2-extract/openssl/test/Makefile')
regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
            assert result == expected_content
        except AssertionError:
            files = [
                'test_dir: file://{}'.format(test_dir),
                'expected: file://{}'.format(expected if expected_is_json_file else ''),
            ]
>           assert result == files + expected_content
E           AssertionError: assert ['broken-link.tar.bz2'] == ['test_dir: f...est/Makefile']
E             
E             At index 0 diff: 'broken-link.tar.bz2' != 'test_dir: file:///tmp/scancode-tk-tests -h5oxlfwx/eqod1k5c/broken_link'
E             Right contains 3 more items, first extra item: 'expected: file://'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:89: AssertionError
_______________ TestExtract.test_extract_tar_with_special_files ________________

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/7vcls36f/special'
expected = ['t.tgz', 't.tgz-extract/0-REGTYPE', 't.tgz-extract/0-REGTYPE-TEXT', 't.tgz-extract/0-REGTYPE-VEEEERY_LONG_NAME_______...________________________________________________________155', 't.tgz-extract/1-LNKTYPE', 't.tgz-extract/S-SPARSE', ...]
regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
>           assert result == expected_content
E           AssertionError: assert ['t.tgz'] == ['t.tgz', 't....-SPARSE', ...]
E             
E             Right contains 6 more items, first extra item: 't.tgz-extract/0-REGTYPE'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:83: AssertionError

During handling of the above exception, another exception occurred:

self = <test_extract.TestExtract testMethod=test_extract_tar_with_special_files>

    def test_extract_tar_with_special_files(self):
        test_dir = self.get_test_loc('extract/special', copy=True)
        expected = [
            't.tgz',
            't.tgz-extract/0-REGTYPE',
            't.tgz-extract/0-REGTYPE-TEXT',
            't.tgz-extract/0-REGTYPE-VEEEERY_LONG_NAME_____________________________________________________________________________________________________________________155',
            # we skip links but not hardlinks
            't.tgz-extract/1-LNKTYPE',
            't.tgz-extract/S-SPARSE',
            't.tgz-extract/S-SPARSE-WITH-NULLS',
        ]
        result = list(extract.extract(test_dir, recurse=True))
>       check_files(test_dir, expected)

tests/test_extract.py:641: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/7vcls36f/special'
expected = ['t.tgz', 't.tgz-extract/0-REGTYPE', 't.tgz-extract/0-REGTYPE-TEXT', 't.tgz-extract/0-REGTYPE-VEEEERY_LONG_NAME_______...________________________________________________________155', 't.tgz-extract/1-LNKTYPE', 't.tgz-extract/S-SPARSE', ...]
regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
            assert result == expected_content
        except AssertionError:
            files = [
                'test_dir: file://{}'.format(test_dir),
                'expected: file://{}'.format(expected if expected_is_json_file else ''),
            ]
>           assert result == files + expected_content
E           AssertionError: assert ['t.tgz'] == ['test_dir: f...____155', ...]
E             
E             At index 0 diff: 't.tgz' != 'test_dir: file:///tmp/scancode-tk-tests -h5oxlfwx/7vcls36f/special'
E             Right contains 8 more items, first extra item: 'expected: file://'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:89: AssertionError
___________________ TestExtract.test_extract_tree_recursive ____________________

self = <test_extract.TestExtract testMethod=test_extract_tree_recursive>

    def test_extract_tree_recursive(self):
        expected = (
            'a/a.tar.gz',
            'a/a.txt',
            'a/a.tar.gz-extract/a/b/a.txt',
            'a/a.tar.gz-extract/a/b/b.txt',
            'a/a.tar.gz-extract/a/c/c.txt',
            'b/a.txt',
            'b/b.tar.gz',
            'b/b.tar.gz-extract/b/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/.svn/entries',
            'b/b.tar.gz-extract/b/.svn/format',
            'b/b.tar.gz-extract/b/a/a.tar.gz',
            'b/b.tar.gz-extract/b/a/a.txt',
            'b/b.tar.gz-extract/b/a/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/a/.svn/entries',
            'b/b.tar.gz-extract/b/a/.svn/format',
            'b/b.tar.gz-extract/b/a/.svn/prop-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/a/.svn/text-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/a/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz-extract/b/a/a.tar.gz-extract/a/b/a.txt',
            'b/b.tar.gz-extract/b/a/a.tar.gz-extract/a/b/b.txt',
            'b/b.tar.gz-extract/b/a/a.tar.gz-extract/a/c/c.txt',
            'b/b.tar.gz-extract/b/b/a.txt',
            'b/b.tar.gz-extract/b/b/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/b/.svn/entries',
            'b/b.tar.gz-extract/b/b/.svn/format',
            'b/b.tar.gz-extract/b/b/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz-extract/b/c/a.tar.gz',
            'b/b.tar.gz-extract/b/c/a.txt',
            'b/b.tar.gz-extract/b/c/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/c/.svn/entries',
            'b/b.tar.gz-extract/b/c/.svn/format',
            'b/b.tar.gz-extract/b/c/.svn/prop-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/c/.svn/text-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/c/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz-extract/b/c/a.tar.gz-extract/a/b/a.txt',
            'b/b.tar.gz-extract/b/c/a.tar.gz-extract/a/b/b.txt',
            'b/b.tar.gz-extract/b/c/a.tar.gz-extract/a/c/c.txt',
            'c/a.tar.gz',
            'c/a.txt',
            'c/a.tar.gz-extract/a/b/a.txt',
            'c/a.tar.gz-extract/a/b/b.txt',
            'c/a.tar.gz-extract/a/c/c.txt',
        )
        test_dir = self.get_test_loc('extract/tree', copy=True)
        result = list(extract.extract(test_dir, recurse=True))
>       check_no_error(result)

tests/test_extract.py:220: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/5cj3n3m0/tree/a/a.tar.gz', target='/tmp/scancode-tk-tests -h5ox...xlfwx/5cj3n3m0/tree/c/a.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/5cj3n3m0/tree/a/a.tar.gz', target='/tmp/scancode-tk-tests -h5oxlfwx/5cj3n3m0/tree/a/a.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
__________ TestExtract.test_extract_tree_recursive_replace_originals ___________

self = <test_extract.TestExtract testMethod=test_extract_tree_recursive_replace_originals>

    def test_extract_tree_recursive_replace_originals(self):
        expected = (
            'a/a.txt',
            'a/a.tar.gz/a/b/a.txt',
            'a/a.tar.gz/a/b/b.txt',
            'a/a.tar.gz/a/c/c.txt',
            'b/a.txt',
            'b/b.tar.gz/b/.svn/all-wcprops',
            'b/b.tar.gz/b/.svn/entries',
            'b/b.tar.gz/b/.svn/format',
            'b/b.tar.gz/b/a/a.txt',
            'b/b.tar.gz/b/a/.svn/all-wcprops',
            'b/b.tar.gz/b/a/.svn/entries',
            'b/b.tar.gz/b/a/.svn/format',
            'b/b.tar.gz/b/a/.svn/prop-base/a.tar.gz.svn-base',
            'b/b.tar.gz/b/a/.svn/text-base/a.tar.gz.svn-base',
            'b/b.tar.gz/b/a/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz/b/a/a.tar.gz/a/b/a.txt',
            'b/b.tar.gz/b/a/a.tar.gz/a/b/b.txt',
            'b/b.tar.gz/b/a/a.tar.gz/a/c/c.txt',
            'b/b.tar.gz/b/b/a.txt',
            'b/b.tar.gz/b/b/.svn/all-wcprops',
            'b/b.tar.gz/b/b/.svn/entries',
            'b/b.tar.gz/b/b/.svn/format',
            'b/b.tar.gz/b/b/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz/b/c/a.txt',
            'b/b.tar.gz/b/c/.svn/all-wcprops',
            'b/b.tar.gz/b/c/.svn/entries',
            'b/b.tar.gz/b/c/.svn/format',
            'b/b.tar.gz/b/c/.svn/prop-base/a.tar.gz.svn-base',
            'b/b.tar.gz/b/c/.svn/text-base/a.tar.gz.svn-base',
            'b/b.tar.gz/b/c/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz/b/c/a.tar.gz/a/b/a.txt',
            'b/b.tar.gz/b/c/a.tar.gz/a/b/b.txt',
            'b/b.tar.gz/b/c/a.tar.gz/a/c/c.txt',
            'c/a.txt',
            'c/a.tar.gz/a/b/a.txt',
            'c/a.tar.gz/a/b/b.txt',
            'c/a.tar.gz/a/c/c.txt',
        )
        test_dir = self.get_test_loc('extract/tree', copy=True)
        result = list(extract.extract(test_dir, recurse=True, replace_originals=True))
>       check_no_error(result)

tests/test_extract.py:269: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/1q7znz6d/tree/a/a.tar.gz', target='/tmp/scancode-tk-tests -h5ox...xlfwx/1q7znz6d/tree/c/a.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/1q7znz6d/tree/a/a.tar.gz', target='/tmp/scancode-tk-tests -h5oxlfwx/1q7znz6d/tree/a/a.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
__________________ TestExtract.test_extract_tree_shallow_only __________________

self = <test_extract.TestExtract testMethod=test_extract_tree_shallow_only>

    def test_extract_tree_shallow_only(self):
        expected = (
            'a/a.tar.gz',
            'a/a.txt',
            'a/a.tar.gz-extract/a/b/a.txt',
            'a/a.tar.gz-extract/a/b/b.txt',
            'a/a.tar.gz-extract/a/c/c.txt',
    
            'b/a.txt',
            'b/b.tar.gz',
            'b/b.tar.gz-extract/b/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/.svn/entries',
            'b/b.tar.gz-extract/b/.svn/format',
            'b/b.tar.gz-extract/b/a/a.tar.gz',
    
            'b/b.tar.gz-extract/b/a/a.txt',
            'b/b.tar.gz-extract/b/a/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/a/.svn/entries',
            'b/b.tar.gz-extract/b/a/.svn/format',
            'b/b.tar.gz-extract/b/a/.svn/prop-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/a/.svn/text-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/a/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz-extract/b/b/a.txt',
            'b/b.tar.gz-extract/b/b/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/b/.svn/entries',
            'b/b.tar.gz-extract/b/b/.svn/format',
            'b/b.tar.gz-extract/b/b/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz-extract/b/c/a.tar.gz',
            'b/b.tar.gz-extract/b/c/a.txt',
            'b/b.tar.gz-extract/b/c/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/c/.svn/entries',
            'b/b.tar.gz-extract/b/c/.svn/format',
            'b/b.tar.gz-extract/b/c/.svn/prop-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/c/.svn/text-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/c/.svn/text-base/a.txt.svn-base',
    
            'c/a.tar.gz',
            'c/a.txt',
            'c/a.tar.gz-extract/a/b/a.txt',
            'c/a.tar.gz-extract/a/b/b.txt',
            'c/a.tar.gz-extract/a/c/c.txt',
        )
        test_dir = self.get_test_loc('extract/tree', copy=True)
        result = list(extract.extract(test_dir, recurse=False))
>       check_no_error(result)

tests/test_extract.py:166: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/kvxqzm55/tree/a/a.tar.gz', target='/tmp/scancode-tk-tests -h5ox...xlfwx/kvxqzm55/tree/c/a.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/kvxqzm55/tree/a/a.tar.gz', target='/tmp/scancode-tk-tests -h5oxlfwx/kvxqzm55/tree/a/a.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
_____________ TestExtract.test_extract_tree_shallow_then_recursive _____________

self = <test_extract.TestExtract testMethod=test_extract_tree_shallow_then_recursive>

    def test_extract_tree_shallow_then_recursive(self):
        shallow = (
            'a/a.tar.gz',
            'a/a.txt',
            'a/a.tar.gz-extract/a/b/a.txt',
            'a/a.tar.gz-extract/a/b/b.txt',
            'a/a.tar.gz-extract/a/c/c.txt',
    
            'b/a.txt',
            'b/b.tar.gz',
            'b/b.tar.gz-extract/b/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/.svn/entries',
            'b/b.tar.gz-extract/b/.svn/format',
            'b/b.tar.gz-extract/b/a/a.tar.gz',
            'b/b.tar.gz-extract/b/a/a.txt',
            'b/b.tar.gz-extract/b/a/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/a/.svn/entries',
            'b/b.tar.gz-extract/b/a/.svn/format',
            'b/b.tar.gz-extract/b/a/.svn/prop-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/a/.svn/text-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/a/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz-extract/b/b/a.txt',
            'b/b.tar.gz-extract/b/b/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/b/.svn/entries',
            'b/b.tar.gz-extract/b/b/.svn/format',
            'b/b.tar.gz-extract/b/b/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz-extract/b/c/a.tar.gz',
            'b/b.tar.gz-extract/b/c/a.txt',
            'b/b.tar.gz-extract/b/c/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/c/.svn/entries',
            'b/b.tar.gz-extract/b/c/.svn/format',
            'b/b.tar.gz-extract/b/c/.svn/prop-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/c/.svn/text-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/c/.svn/text-base/a.txt.svn-base',
    
            'c/a.tar.gz',
            'c/a.txt',
            'c/a.tar.gz-extract/a/b/a.txt',
            'c/a.tar.gz-extract/a/b/b.txt',
            'c/a.tar.gz-extract/a/c/c.txt',
        )
        recursed = (
            'a/a.tar.gz',
            'a/a.txt',
            'a/a.tar.gz-extract/a/b/a.txt',
            'a/a.tar.gz-extract/a/b/b.txt',
            'a/a.tar.gz-extract/a/c/c.txt',
            'b/a.txt',
            'b/b.tar.gz',
            'b/b.tar.gz-extract/b/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/.svn/entries',
            'b/b.tar.gz-extract/b/.svn/format',
            'b/b.tar.gz-extract/b/a/a.tar.gz',
            'b/b.tar.gz-extract/b/a/a.txt',
            'b/b.tar.gz-extract/b/a/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/a/.svn/entries',
            'b/b.tar.gz-extract/b/a/.svn/format',
            'b/b.tar.gz-extract/b/a/.svn/prop-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/a/.svn/text-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/a/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz-extract/b/a/a.tar.gz-extract/a/b/a.txt',
            'b/b.tar.gz-extract/b/a/a.tar.gz-extract/a/b/b.txt',
            'b/b.tar.gz-extract/b/a/a.tar.gz-extract/a/c/c.txt',
            'b/b.tar.gz-extract/b/b/a.txt',
            'b/b.tar.gz-extract/b/b/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/b/.svn/entries',
            'b/b.tar.gz-extract/b/b/.svn/format',
            'b/b.tar.gz-extract/b/b/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz-extract/b/c/a.tar.gz',
            'b/b.tar.gz-extract/b/c/a.txt',
            'b/b.tar.gz-extract/b/c/.svn/all-wcprops',
            'b/b.tar.gz-extract/b/c/.svn/entries',
            'b/b.tar.gz-extract/b/c/.svn/format',
            'b/b.tar.gz-extract/b/c/.svn/prop-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/c/.svn/text-base/a.tar.gz.svn-base',
            'b/b.tar.gz-extract/b/c/.svn/text-base/a.txt.svn-base',
            'b/b.tar.gz-extract/b/c/a.tar.gz-extract/a/b/a.txt',
            'b/b.tar.gz-extract/b/c/a.tar.gz-extract/a/b/b.txt',
            'b/b.tar.gz-extract/b/c/a.tar.gz-extract/a/c/c.txt',
            'c/a.tar.gz',
            'c/a.txt',
            'c/a.tar.gz-extract/a/b/a.txt',
            'c/a.tar.gz-extract/a/b/b.txt',
            'c/a.tar.gz-extract/a/c/c.txt',
        )
    
        test_dir = self.get_test_loc('extract/tree', copy=True)
        result = list(extract.extract(test_dir, recurse=False))
>       check_no_error(result)

tests/test_extract.py:382: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/nvytmwl4/tree/a/a.tar.gz', target='/tmp/scancode-tk-tests -h5ox...xlfwx/nvytmwl4/tree/c/a.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           assert not ["a bytes-like object is required, not 'str"]
E            +  where ["a bytes-like object is required, not 'str"] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/nvytmwl4/tree/a/a.tar.gz', target='/tmp/scancode-tk-tests -h5oxlfwx/nvytmwl4/tree/a/a.tar.gz-extract', done=True, warnings=[], errors=["a bytes-like object is required, not 'str"]).errors

tests/extractcode_assert_utils.py:102: AssertionError
_________ TestExtract.test_extract_tree_with_corrupted_archives_linux __________

self = <extractcode.libarchive2.Archive object at 0x7f6f5b1467b0>

    def open(self):
        """
        Open the archive for reading. You must call close() when done to free up
        resources and avoid leaks. Or use instead the Archive class as a context
        manager with the "with" keyword.
        """
        # first close any existing opened struct for this file
        self.close()
        self.archive_struct = archive_reader()
        if self.uncompress:
            use_all_filters(self.archive_struct)
        if extract:
            use_all_formats(self.archive_struct)
        try:
            # TODO: ensure that we have proper exceptions raised?
>           open_file(self.archive_struct, self.location, self.block_size)
E           ctypes.ArgumentError: argument 2: TypeError: 'str' object cannot be interpreted as ctypes.c_char_p

src/extractcode/libarchive2.py:273: ArgumentError

During handling of the above exception, another exception occurred:

location = '/tmp/scancode-tk-tests -h5oxlfwx/p5p156gt/corrupted/a.tar.gz'
target = '/tmp/scancode-tk-tests -h5oxlfwx/p5p156gt/corrupted/a.tar.gz-extract'
kinds = (2, 3, 4), verbose = False, args = (), kwargs = {}, warnings = []
errors = [], extractor = <function extract at 0x7f6f5bf6c720>
tmp_tgt = '/tmp/scancode-tk-49325pqm'
abs_location = '/tmp/scancode-tk-tests -h5oxlfwx/p5p156gt/corrupted/a.tar.gz'

    def extract_file(
        location,
        target,
        kinds=extractcode.default_kinds,
        verbose=False,
        *args,
        **kwargs,
    ):
        """
        Extract a single archive file at ``location`` to the ``target`` directory if
        this file is of a kind supported in the ``kinds`` kind tuple. Yield
        ExtractEvents. Does not extract recursively.
        """
        warnings = []
        errors = []
        extractor = extractcode.archive.get_extractor(
            location=location,
            kinds=kinds,
        )
    
        if TRACE:
            emodule = getattr(extractor, '__module__', '')
            ename = getattr(extractor, '__name__', '')
            logger.debug(
                f'extract_file: extractor: for: {location} with kinds: '
                f'{kinds}: {emodule}.{ename}'
            )
    
        if extractor:
            yield ExtractEvent(
                source=location,
                target=target,
                done=False,
                warnings=[],
                errors=[],
            )
    
            try:
                # Extract first to a temp directory: if there is an error, the
                # extracted files will not be moved to the target.
                tmp_tgt = fileutils.get_temp_dir(prefix='extractcode-extract-')
                abs_location = abspath(expanduser(location))
>               warns = extractor(abs_location, tmp_tgt) or []

src/extractcode/extract.py:276: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:164: in extract
    for entry in list_entries(abs_location):
src/extractcode/libarchive2.py:220: in list_entries
    with Archive(abs_location) as archive:
src/extractcode/libarchive2.py:318: in __enter__
    return self.open()
src/extractcode/libarchive2.py:275: in open
    open_file_w(self.archive_struct, self.location, self.block_size)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

rc = -30, archive_func = <_FuncPtr object at 0x7f6f5b715c10>
args = (93938332223920, '/tmp/scancode-tk-tests -h5oxlfwx/p5p156gt/corrupted/a.tar.gz', 10240)
null = False

    def errcheck(rc, archive_func, args, null=False):
        """
        ctypes error check handler for functions returning int, or null if null is
        True.
        """
        if null:
            if rc is None:
                archive_struct = args and len(args) > 1 and args[0] or None
                raise ArchiveError(rc, archive_struct, archive_func)
            else:
                return rc
    
        if rc >= ARCHIVE_OK:
            return rc
    
        archive_struct = args[0]
        if rc == ARCHIVE_RETRY:
            raise ArchiveErrorRetryable(rc, archive_struct, archive_func)
    
        if rc == ARCHIVE_WARN:
            raise ArchiveWarning(rc, archive_struct, archive_func)
    
        # anything else is a serious error, in general not recoverable.
>       raise ArchiveError(rc, archive_struct, archive_func)
E       extractcode.libarchive2.ArchiveError: <exception str() failed>

src/extractcode/libarchive2.py:586: ArchiveError

During handling of the above exception, another exception occurred:

self = <test_extract.TestExtract testMethod=test_extract_tree_with_corrupted_archives_linux>

    @pytest.mark.skipif(not on_linux, reason='Expectations are different on Windows and macOS')
    def test_extract_tree_with_corrupted_archives_linux(self):
        expected = (
            'a.tar.gz',
        )
        test_dir = self.get_test_loc('extract/corrupted', copy=True)
>       result = list(extract.extract(test_dir, recurse=False))

tests/test_extract.py:409: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/extract.py:128: in extract
    for event in extract_events:
src/extractcode/extract.py:211: in extract_files
    for xevent in extract_file(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = '/tmp/scancode-tk-tests -h5oxlfwx/p5p156gt/corrupted/a.tar.gz'
target = '/tmp/scancode-tk-tests -h5oxlfwx/p5p156gt/corrupted/a.tar.gz-extract'
kinds = (2, 3, 4), verbose = False, args = (), kwargs = {}, warnings = []
errors = [], extractor = <function extract at 0x7f6f5bf6c720>
tmp_tgt = '/tmp/scancode-tk-49325pqm'
abs_location = '/tmp/scancode-tk-tests -h5oxlfwx/p5p156gt/corrupted/a.tar.gz'

    def extract_file(
        location,
        target,
        kinds=extractcode.default_kinds,
        verbose=False,
        *args,
        **kwargs,
    ):
        """
        Extract a single archive file at ``location`` to the ``target`` directory if
        this file is of a kind supported in the ``kinds`` kind tuple. Yield
        ExtractEvents. Does not extract recursively.
        """
        warnings = []
        errors = []
        extractor = extractcode.archive.get_extractor(
            location=location,
            kinds=kinds,
        )
    
        if TRACE:
            emodule = getattr(extractor, '__module__', '')
            ename = getattr(extractor, '__name__', '')
            logger.debug(
                f'extract_file: extractor: for: {location} with kinds: '
                f'{kinds}: {emodule}.{ename}'
            )
    
        if extractor:
            yield ExtractEvent(
                source=location,
                target=target,
                done=False,
                warnings=[],
                errors=[],
            )
    
            try:
                # Extract first to a temp directory: if there is an error, the
                # extracted files will not be moved to the target.
                tmp_tgt = fileutils.get_temp_dir(prefix='extractcode-extract-')
                abs_location = abspath(expanduser(location))
                warns = extractor(abs_location, tmp_tgt) or []
                warnings.extend(warns)
                fileutils.copytree(tmp_tgt, target)
                fileutils.delete(tmp_tgt)
    
            except Exception as e:
>               errors = [str(e).strip(' \'"')]
E               TypeError: __str__ returned non-string (type bytes)

src/extractcode/extract.py:282: TypeError
__ TestExtract.test_extract_with_empty_dir_and_small_files_ignores_empty_dirs __

self = <test_extract.TestExtract testMethod=test_extract_with_empty_dir_and_small_files_ignores_empty_dirs>

    def test_extract_with_empty_dir_and_small_files_ignores_empty_dirs(self):
        expected = (
            'empty_small.zip',
            'empty_small.zip-extract/empty_dirs_and_small_files/small_files/small_file.txt',)
        test_dir = self.get_test_loc('extract/small', copy=True)
        result = list(extract.extract(test_dir, recurse=True))
>       check_no_error(result)

tests/test_extract.py:437: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/7vqd6muf/small/empty_small.zip', target='/tmp/scancode-tk-tests...6muf/small/empty_small.zip-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes'])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           AssertionError: assert not ['normalize() argument 2 must be str, not bytes']
E            +  where ['normalize() argument 2 must be str, not bytes'] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/7vqd6muf/small/empty_small.zip', target='/tmp/scancode-tk-tests ...d6muf/small/empty_small.zip-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes']).errors

tests/extractcode_assert_utils.py:102: AssertionError
_______________ TestExtract.test_extract_zip_with_spaces_in_name _______________

self = <test_extract.TestExtract testMethod=test_extract_zip_with_spaces_in_name>

    def test_extract_zip_with_spaces_in_name(self):
        test_dir = self.get_test_loc('extract/space-zip', copy=True)
        expected = (
            'with spaces in name.zip',
            'with spaces in name.zip-extract/empty_dirs_and_small_files/small_files/small_file.txt'
        )
        result = list(extract.extract(test_dir, recurse=True))
>       check_no_error(result)

tests/test_extract.py:613: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = [ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/72ytkyws/space-zip/with spaces in name.zip', target='/tmp/scanc...ip/with spaces in name.zip-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes'])]

    def check_no_error(result):
        """
        Check that every ExtractEvent in the `result` list has no error or warning.
        """
        for r in result:
>           assert not r.errors
E           AssertionError: assert not ['normalize() argument 2 must be str, not bytes']
E            +  where ['normalize() argument 2 must be str, not bytes'] = ExtractEvent(source='/tmp/scancode-tk-tests -h5oxlfwx/72ytkyws/space-zip/with spaces in name.zip', target='/tmp/scanco...zip/with spaces in name.zip-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes']).errors

tests/extractcode_assert_utils.py:102: AssertionError
__________________ TestExtract.test_extract_zipslip_tar_posix __________________

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/ufoqb62j/zipslip'
expected = ['README.md', 'zip-slip-win.tar', 'zip-slip-win.tar-extract/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/do...t/dotdot/dotdot/Temp/evil.txt', 'zip-slip-win.tar-extract/good.txt', 'zip-slip-win.tar.ABOUT', 'zip-slip-win.zip', ...]
regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
>           assert result == expected_content
E           AssertionError: assert ['README.md',...lip.tar', ...] == ['README.md',...win.zip', ...]
E             
E             At index 2 diff: 'zip-slip-win.tar.ABOUT' != 'zip-slip-win.tar-extract/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/Temp/evil.txt'
E             Right contains 8 more items, first extra item: 'zip-slip.tar'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:83: AssertionError

During handling of the above exception, another exception occurred:

self = <test_extract.TestExtract testMethod=test_extract_zipslip_tar_posix>

    @pytest.mark.skipif(on_windows, reason='Windows behavior is slightly different with relative paths')
    def test_extract_zipslip_tar_posix(self):
        test_dir = self.get_test_loc('extract/zipslip', copy=True)
        expected = [
            'README.md',
            'zip-slip-win.tar',
            'zip-slip-win.tar-extract/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/Temp/evil.txt',
            'zip-slip-win.tar-extract/good.txt',
            'zip-slip-win.tar.ABOUT',
            'zip-slip-win.zip',
            'zip-slip-win.zip-extract/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/Temp/evil.txt',
            'zip-slip-win.zip-extract/good.txt',
            'zip-slip-win.zip.ABOUT',
            'zip-slip.tar',
            'zip-slip.tar-extract/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/tmp/evil.txt',
            'zip-slip.tar-extract/good.txt',
            'zip-slip.tar.ABOUT',
            'zip-slip.zip',
            'zip-slip.zip-extract/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/tmp/evil.txt',
            'zip-slip.zip-extract/good.txt',
            'zip-slip.zip.ABOUT',
        ]
    
        result = list(extract.extract(test_dir, recurse=True))
>       check_files(test_dir, expected)

tests/test_extract.py:847: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

test_dir = '/tmp/scancode-tk-tests -h5oxlfwx/ufoqb62j/zipslip'
expected = ['README.md', 'zip-slip-win.tar', 'zip-slip-win.tar-extract/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/dotdot/do...t/dotdot/dotdot/Temp/evil.txt', 'zip-slip-win.tar-extract/good.txt', 'zip-slip-win.tar.ABOUT', 'zip-slip-win.zip', ...]
regen = False

    def check_files(test_dir, expected, regen=False):
        """
        Walk test_dir.
        Check that all dirs are readable.
        Check that all files are:
         * non-special,
         * readable,
         * have a posix path that ends with one of the expected tuple paths.
        """
        result = []
        locs = []
        if filetype.is_file(test_dir):
            test_dir = fileutils.parent_directory(test_dir)
    
        test_dir_path = fileutils.as_posixpath(test_dir)
        for top, _, files in os.walk(test_dir):
            for f in files:
                location = os.path.join(top, f)
                locs.append(location)
                path = fileutils.as_posixpath(location)
                path = path.replace(test_dir_path, '').strip('/')
                result.append(path)
    
        expected_is_json_file = False
    
        if not isinstance(expected, (list, tuple)) and expected.endswith('.json'):
            expected_is_json_file = True
            # this is a path to a JSON file
            if regen:
                with open(expected, 'w') as ex:
                    json.dump(result, ex, indent=2, separators=(',', ':'))
                expected_content = result
            else:
                with open(expected) as ex:
                    expected_content = json.load(ex)
        else:
            expected_content = expected
    
        expected_content = sorted(expected_content)
        result = sorted(result)
    
        try:
            assert result == expected_content
        except AssertionError:
            files = [
                'test_dir: file://{}'.format(test_dir),
                'expected: file://{}'.format(expected if expected_is_json_file else ''),
            ]
>           assert result == files + expected_content
E           AssertionError: assert ['README.md',...lip.tar', ...] == ['test_dir: f...ood.txt', ...]
E             
E             At index 0 diff: 'README.md' != 'test_dir: file:///tmp/scancode-tk-tests -h5oxlfwx/ufoqb62j/zipslip'
E             Right contains 10 more items, first extra item: 'zip-slip-win.zip-extract/good.txt'
E             Use -v to get more diff

tests/extractcode_assert_utils.py:89: AssertionError
________ TestExtract.test_uncompress_corrupted_archive_with_libarchive _________

self = <extractcode.libarchive2.Archive object at 0x7f6f5ae44fa0>

    def open(self):
        """
        Open the archive for reading. You must call close() when done to free up
        resources and avoid leaks. Or use instead the Archive class as a context
        manager with the "with" keyword.
        """
        # first close any existing opened struct for this file
        self.close()
        self.archive_struct = archive_reader()
        if self.uncompress:
            use_all_filters(self.archive_struct)
        if extract:
            use_all_formats(self.archive_struct)
        try:
            # TODO: ensure that we have proper exceptions raised?
>           open_file(self.archive_struct, self.location, self.block_size)
E           ctypes.ArgumentError: argument 2: TypeError: 'str' object cannot be interpreted as ctypes.c_char_p

src/extractcode/libarchive2.py:273: ArgumentError

During handling of the above exception, another exception occurred:

self = <test_extract.TestExtract testMethod=test_uncompress_corrupted_archive_with_libarchive>
excInstance = Exception('gzip decompression failed')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/tmp/scancode-tk-tests -h5oxlfwx/d0cfnue5/a.tar.gz', '/tmp/scancode-tk-tests -h5oxlfwx/szoc06t1')
kwargs = {}, excClass = <class 'Exception'>

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
>           callableObj(*args, **kwargs)

tests/extractcode_assert_utils.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:164: in extract
    for entry in list_entries(abs_location):
src/extractcode/libarchive2.py:220: in list_entries
    with Archive(abs_location) as archive:
src/extractcode/libarchive2.py:318: in __enter__
    return self.open()
src/extractcode/libarchive2.py:275: in open
    open_file_w(self.archive_struct, self.location, self.block_size)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

rc = -30, archive_func = <_FuncPtr object at 0x7f6f5b715c10>
args = (93938335926896, '/tmp/scancode-tk-tests -h5oxlfwx/d0cfnue5/a.tar.gz', 10240)
null = False

    def errcheck(rc, archive_func, args, null=False):
        """
        ctypes error check handler for functions returning int, or null if null is
        True.
        """
        if null:
            if rc is None:
                archive_struct = args and len(args) > 1 and args[0] or None
                raise ArchiveError(rc, archive_struct, archive_func)
            else:
                return rc
    
        if rc >= ARCHIVE_OK:
            return rc
    
        archive_struct = args[0]
        if rc == ARCHIVE_RETRY:
            raise ArchiveErrorRetryable(rc, archive_struct, archive_func)
    
        if rc == ARCHIVE_WARN:
            raise ArchiveWarning(rc, archive_struct, archive_func)
    
        # anything else is a serious error, in general not recoverable.
>       raise ArchiveError(rc, archive_struct, archive_func)
E       extractcode.libarchive2.ArchiveError: <exception str() failed>

src/extractcode/libarchive2.py:586: ArchiveError

During handling of the above exception, another exception occurred:

self = <test_extract.TestExtract testMethod=test_uncompress_corrupted_archive_with_libarchive>

    def test_uncompress_corrupted_archive_with_libarchive(self):
        from extractcode import libarchive2
        test_file = self.get_test_loc('extract/corrupted/a.tar.gz', copy=True)
        test_dir = self.get_temp_dir()
        expected = Exception('gzip decompression failed')
>       self.assertRaisesInstance(expected, libarchive2.extract, test_file, test_dir)

tests/test_extract.py:401: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_extract.TestExtract testMethod=test_uncompress_corrupted_archive_with_libarchive>
excInstance = Exception('gzip decompression failed')
callableObj = <function extract at 0x7f6f5bf6c720>
args = ('/tmp/scancode-tk-tests -h5oxlfwx/d0cfnue5/a.tar.gz', '/tmp/scancode-tk-tests -h5oxlfwx/szoc06t1')
kwargs = {}, excClass = <class 'Exception'>

    def assertRaisesInstance(self, excInstance, callableObj, *args, **kwargs):
        """
        This assertion accepts an instance instead of a class for refined
        exception testing.
        """
        kwargs = kwargs or {}
        excClass = excInstance.__class__
        try:
            callableObj(*args, **kwargs)
        except excClass as e:
>           assert str(e).startswith(str(excInstance))
E           TypeError: __str__ returned non-string (type bytes)

tests/extractcode_assert_utils.py:178: TypeError
_____________________ TestExtractApi.test_extract_archive ______________________

self = <test_extractcode_api.TestExtractApi testMethod=test_extract_archive>

    def test_extract_archive(self):
        test_dir = self.get_test_loc('api/doc.docx', copy=True)
        base = fileutils.parent_directory(test_dir)
        expected = [
            'c/a/a.txt',
            'c/b/a.txt',
            'c/c/a.txt',
        ]
    
        cleaned_test_file = test_dir.replace(base, '')
        expected_event = [
            extract.ExtractEvent(source='doc.docx', target='doc.docx-extract', done=False, warnings=[], errors=[]),
            extract.ExtractEvent(source='doc.docx', target='doc.docx-extract', done=True, warnings=[], errors=[]),
        ]
        target = extractcode.get_extraction_path(test_dir)
        result = list(api.extract_archive(test_dir, target))
        result = [
            r._replace(
                source=cleaned_test_file,
                target=extractcode.get_extraction_path(cleaned_test_file))
            for r in result
        ]
>       assert expected_event == result
E       AssertionError: assert [ExtractEvent...], errors=[])] == [ExtractEvent... not bytes'])]
E         
E         At index 1 diff: ExtractEvent(source='doc.docx', target='doc.docx-extract', done=True, warnings=[], errors=[]) != ExtractEvent(source='doc.docx', target='doc.docx-extract', done=True, warnings=[], errors=['normalize() argument 2 must be str, not bytes'])
E         Use -v to get more diff

tests/test_extractcode_api.py:49: AssertionError
___ TestExtractorTest.test_libarchive_extract_can_extract_to_relative_paths ____

self = <test_libarchive2.TestExtractorTest testMethod=test_libarchive_extract_can_extract_to_relative_paths>

    def test_libarchive_extract_can_extract_to_relative_paths(self):
        # The setup is a tad complex because we want to have a relative dir
        # to the base dir where we run tests from, i.e. the git checkout dir
        # To use relative paths, we use our tmp dir at the root of the code tree
        from os.path import join, abspath
        import tempfile
        import shutil
        from extractcode.libarchive2 import extract
    
        test_file = self.get_test_loc('archive/relative_path/basic.zip')
        project_tmp = join(project_root, 'tmp')
        fileutils.create_dir(project_tmp)
        project_root_abs = abspath(project_root)
        test_src_dir = tempfile.mkdtemp(
            dir=project_tmp).replace(project_root_abs, '').strip('\\/')
        test_tgt_dir = tempfile.mkdtemp(
            dir=project_tmp).replace(project_root_abs, '').strip('\\/')
        shutil.copy(test_file, test_src_dir)
        test_src_file = join(test_src_dir, 'basic.zip')
>       result = list(extract(test_src_file, test_tgt_dir))

tests/test_libarchive2.py:45: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/libarchive2.py:206: in extract
    _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True))
src/extractcode/libarchive2.py:447: in write
    clean_path = transform_path(self.path)
/usr/lib/python3.13/site-packages/commoncode/paths.py:46: in safe_path
    if not is_posixpath(path):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = b'c/'

    def is_posixpath(location):
        """
        Return True if the `location` path is likely a POSIX-like path using POSIX path
        separators (slash or "/")or has no path separator.
    
        Return False if the `location` path is likely a Windows-like path using backslash
        as path separators (e.g. "\").
        """
>       has_slashes = '/' in location
E       TypeError: a bytes-like object is required, not 'str'

/usr/lib/python3.13/site-packages/commoncode/fileutils.py:148: TypeError
_____________ TestSevenZip.test_extract_of_tar_with_aboslute_path ______________

self = <test_sevenzip.TestSevenZip testMethod=test_extract_of_tar_with_aboslute_path>

    def test_extract_of_tar_with_aboslute_path(self):
        test_loc = self.get_test_loc('sevenzip/absolute_path.tar')
        target_dir = self.get_temp_dir()
>       sevenzip.extract(test_loc, target_dir, file_by_file=False)

tests/test_sevenzip.py:126: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...eaders Size = 9216\nCode Page = UTF-8\n\nEverything is Ok\n\nFolders: 1\nFiles: 2\nSize:       14\nCompressed: 10240\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
________ TestSevenZipListEntries.test_extract_of_tar_with_aboslute_path ________

self = <test_sevenzip.TestSevenZipListEntries testMethod=test_extract_of_tar_with_aboslute_path>

    def test_extract_of_tar_with_aboslute_path(self):
        test_loc = self.get_test_loc('sevenzip/absolute_path.tar')
        target_dir = self.get_temp_dir()
>       sevenzip.extract(test_loc, target_dir, file_by_file=False)

tests/test_sevenzip.py:126: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...eaders Size = 9216\nCode Page = UTF-8\n\nEverything is Ok\n\nFolders: 1\nFiles: 2\nSize:       14\nCompressed: 10240\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_________ TestSevenParseListing.test_extract_of_tar_with_aboslute_path _________

self = <test_sevenzip.TestSevenParseListing testMethod=test_extract_of_tar_with_aboslute_path>

    def test_extract_of_tar_with_aboslute_path(self):
        test_loc = self.get_test_loc('sevenzip/absolute_path.tar')
        target_dir = self.get_temp_dir()
>       sevenzip.extract(test_loc, target_dir, file_by_file=False)

tests/test_sevenzip.py:126: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...eaders Size = 9216\nCode Page = UTF-8\n\nEverything is Ok\n\nFolders: 1\nFiles: 2\nSize:       14\nCompressed: 10240\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
________ TestSevenZipFileByFile.test_extract_file_by_file_of_nested_zip ________

self = <test_sevenzip.TestSevenZipFileByFile testMethod=test_extract_file_by_file_of_nested_zip>

    def test_extract_file_by_file_of_nested_zip(self):
>       self.check_extract_file_by_file('sevenzip/relative_nested.zip', regen=False)

tests/test_sevenzip.py:276: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sevenzip.py:261: in check_extract_file_by_file
    sevenzip.extract_file_by_file(test_loc, target_dir)
src/extractcode/sevenzip.py:413: in extract_file_by_file
    return extract_all_files_at_once(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...ative_nested.zip\nType = zip\nPhysical Size = 1060\n\nEverything is Ok\n\nFiles: 4\nSize:       36\nCompressed: 1060\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______ TestSevenZipFileByFile.test_extract_file_by_file_of_special_tar ________

self = <test_sevenzip.TestSevenZipFileByFile testMethod=test_extract_file_by_file_of_special_tar>

    def test_extract_file_by_file_of_special_tar(self):
>       self.check_extract_file_by_file('sevenzip/special.tar', regen=False)

tests/test_sevenzip.py:279: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sevenzip.py:261: in check_extract_file_by_file
    sevenzip.extract_file_by_file(test_loc, target_dir)
src/extractcode/sevenzip.py:413: in extract_file_by_file
    return extract_all_files_at_once(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... Size = 10752\nCode Page = UTF-8\n\nEverything is Ok\n\nFolders: 1\nFiles: 9\nSize:       125792\nCompressed: 112640\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
__ TestSevenZipFileByFile.test_extract_file_by_file_of_tar_with_absolute_path __

self = <test_sevenzip.TestSevenZipFileByFile testMethod=test_extract_file_by_file_of_tar_with_absolute_path>

    def test_extract_file_by_file_of_tar_with_absolute_path(self):
>       self.check_extract_file_by_file('sevenzip/absolute_path.tar', regen=False)

tests/test_sevenzip.py:273: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sevenzip.py:261: in check_extract_file_by_file
    sevenzip.extract_file_by_file(test_loc, target_dir)
src/extractcode/sevenzip.py:413: in extract_file_by_file
    return extract_all_files_at_once(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...eaders Size = 9216\nCode Page = UTF-8\n\nEverything is Ok\n\nFolders: 1\nFiles: 2\nSize:       14\nCompressed: 10240\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______ TestSevenZipFileByFile.test_extract_file_by_file_weird_names_ar ________

self = <test_sevenzip.TestSevenZipFileByFile testMethod=test_extract_file_by_file_weird_names_ar>

    @pytest.mark.xfail(on_windows, reason='Fails on Windows becasue it has file names that cannot be extracted there')
    def test_extract_file_by_file_weird_names_ar(self):
>       self.check_extract_file_by_file('sevenzip/weird_names.ar', regen=False)

tests/test_sevenzip.py:289: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sevenzip.py:261: in check_extract_file_by_file
    sevenzip.extract_file_by_file(test_loc, target_dir)
src/extractcode/sevenzip.py:438: in extract_file_by_file
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... to process\nEverything is Ok\n\nArchives with Warnings: 1\n\nWarnings: 1\nFiles: 0\nSize:       0\nCompressed: 7051\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
______ TestSevenZipFileByFile.test_extract_file_by_file_weird_names_cpio _______

self = <test_sevenzip.TestSevenZipFileByFile testMethod=test_extract_file_by_file_weird_names_cpio>

    def test_extract_file_by_file_weird_names_cpio(self):
>       self.check_extract_file_by_file('sevenzip/weird_names.cpio', regen=False)

tests/test_sevenzip.py:292: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sevenzip.py:261: in check_extract_file_by_file
    sevenzip.extract_file_by_file(test_loc, target_dir)
src/extractcode/sevenzip.py:438: in extract_file_by_file
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...9\nSubType = Portable ASCII\n\n\nNo files to process\nEverything is Ok\n\nFiles: 0\nSize:       0\nCompressed: 11669\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______ TestSevenZipFileByFile.test_extract_file_by_file_weird_names_tar _______

self = <test_sevenzip.TestSevenZipFileByFile testMethod=test_extract_file_by_file_weird_names_tar>

    def test_extract_file_by_file_weird_names_tar(self):
>       self.check_extract_file_by_file('sevenzip/weird_names.tar', regen=False)

tests/test_sevenzip.py:295: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sevenzip.py:261: in check_extract_file_by_file
    sevenzip.extract_file_by_file(test_loc, target_dir)
src/extractcode/sevenzip.py:438: in extract_file_by_file
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...= 58880\nCode Page = UTF-8\n\n\nNo files to process\nEverything is Ok\n\nFiles: 0\nSize:       0\nCompressed: 114688\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_______ TestSevenZipFileByFile.test_extract_file_by_file_weird_names_zip _______

self = <test_sevenzip.TestSevenZipFileByFile testMethod=test_extract_file_by_file_weird_names_zip>

    def test_extract_file_by_file_weird_names_zip(self):
>       self.check_extract_file_by_file('sevenzip/weird_names.zip', regen=False)

tests/test_sevenzip.py:285: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sevenzip.py:261: in check_extract_file_by_file
    sevenzip.extract_file_by_file(test_loc, target_dir)
src/extractcode/sevenzip.py:438: in extract_file_by_file
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,... zip\nPhysical Size = 19858\n\n\nNo files to process\nEverything is Ok\n\nFiles: 0\nSize:       0\nCompressed: 19858\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
_____ TestSevenZipFileByFile.test_extract_file_by_file_with_weird_names_7z _____

self = <test_sevenzip.TestSevenZipFileByFile testMethod=test_extract_file_by_file_with_weird_names_7z>

    def test_extract_file_by_file_with_weird_names_7z(self):
>       self.check_extract_file_by_file('sevenzip/weird_names.7z', regen=False)

tests/test_sevenzip.py:282: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sevenzip.py:261: in check_extract_file_by_file
    sevenzip.extract_file_by_file(test_loc, target_dir)
src/extractcode/sevenzip.py:438: in extract_file_by_file
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...9\nHeaders Size = 657\nMethod = LZMA:16\nSolid = +\nBlocks = 1\n\nEverything is Ok\n\nSize:       1\nCompressed: 799\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
________ TestSevenZipFileByFile.test_extract_of_tar_with_aboslute_path _________

self = <test_sevenzip.TestSevenZipFileByFile testMethod=test_extract_of_tar_with_aboslute_path>

    def test_extract_of_tar_with_aboslute_path(self):
        test_loc = self.get_test_loc('sevenzip/absolute_path.tar')
        target_dir = self.get_temp_dir()
>       sevenzip.extract(test_loc, target_dir, file_by_file=False)

tests/test_sevenzip.py:126: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/extractcode/sevenzip.py:242: in extract
    return extractor(
src/extractcode/sevenzip.py:273: in extract_all_files_at_once
    rc, stdout, stderr = command.execute(**ex_args)
/usr/lib/python3.13/site-packages/commoncode/command.py:113: in execute
    sop = text.toascii(sor).strip()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b'\n7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\np7zip Version 16.02 (locale=C.UTF-8,Utf16=on,...eaders Size = 9216\nCode Page = UTF-8\n\nEverything is Ok\n\nFolders: 1\nFiles: 2\nSize:       14\nCompressed: 10240\n'
translit = False

    def toascii(s, translit=False):
        """
        Convert a Unicode or byte string to ASCII characters, including replacing
        accented characters with their non-accented equivalent.
    
        If `translit` is False use the Unicode NFKD equivalence.
        If `translit` is True, use a transliteration with the unidecode library.
    
        Non ISO-Latin and non ASCII characters are stripped from the output. When no
        transliteration is possible, the resulting character is replaced by an
        underscore "_".
    
        For Unicode NFKD equivalence, see http://en.wikipedia.org/wiki/Unicode_equivalence
        The convertion may NOT preserve the original string length and with NFKD some
        characters may be deleted.
        Inspired from: http://code.activestate.com/recipes/251871/#c10 by Aaron Bentley.
        """
        if not isinstance(s, str):
            s = as_unicode(s)
        if translit:
            converted = unidecode(s)
        else:
>           converted = unicodedata.normalize('NFKD', s)
E           TypeError: normalize() argument 2 must be str, not bytes

/usr/lib/python3.13/site-packages/commoncode/text.py:113: TypeError
=============================== warnings summary ===============================
tests/test_archive.py: 103 warnings
tests/test_extract.py: 71 warnings
tests/test_extractcode_api.py: 1 warning
tests/test_sevenzip.py: 8 warnings
  /usr/lib/python3.13/site-packages/commoncode/filetype.py:167: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    datetime.utcfromtimestamp(os.path.getmtime(location))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_archive.py::TestGetExtractorTest::test_7zip_extract_can_extract_to_relative_paths
FAILED tests/test_archive.py::TestGetExtractorTest::test_get_extractors_2 - A...
FAILED tests/test_archive.py::TestTarGzip::test_extract_targz_basic - TypeErr...
FAILED tests/test_archive.py::TestTarGzip::test_extract_targz_broken - TypeEr...
FAILED tests/test_archive.py::TestTarGzip::test_extract_targz_from_apache_should_not_return_errors
FAILED tests/test_archive.py::TestTarGzip::test_extract_targz_symlinks - Type...
FAILED tests/test_archive.py::TestTarGzip::test_extract_targz_with_absolute_path
FAILED tests/test_archive.py::TestTarGzip::test_extract_targz_with_mixed_case_and_symlink
FAILED tests/test_archive.py::TestTarGzip::test_extract_targz_with_relative_path
FAILED tests/test_archive.py::TestTarGzip::test_extract_targz_with_trailing_data
FAILED tests/test_archive.py::TestTarGzip::test_extract_targz_with_trailing_data2
FAILED tests/test_archive.py::TestTarGzip::test_extract_targz_with_unicode_path_should_extract_without_error
FAILED tests/test_archive.py::TestTarBz2::test_extract_tar_bz2_absolute_path
FAILED tests/test_archive.py::TestTarBz2::test_extract_tar_bz2_basic - TypeEr...
FAILED tests/test_archive.py::TestTarBz2::test_extract_tar_bz2_basic_bz - Typ...
FAILED tests/test_archive.py::TestTarBz2::test_extract_tar_bz2_broken - TypeE...
FAILED tests/test_archive.py::TestTarBz2::test_extract_tar_bz2_iproute - Type...
FAILED tests/test_archive.py::TestTarBz2::test_extract_tar_bz2_multistream - ...
FAILED tests/test_archive.py::TestTarBz2::test_extract_tar_bz2_relative_path
FAILED tests/test_archive.py::TestTarBz2::test_extract_tar_bz2_with_trailing_data__and_wrong_extension
FAILED tests/test_archive.py::TestSevenzipBz2::test_sevenzip_extract_can_handle_bz2_multistream_differently
FAILED tests/test_archive.py::TestShellArchives::test_extract_springboot - As...
FAILED tests/test_archive.py::TestZip::test_extract_zip_basic - TypeError: no...
FAILED tests/test_archive.py::TestZip::test_extract_zip_can_extract_windows_media_player_skins
FAILED tests/test_archive.py::TestZip::test_extract_zip_can_extract_zip_with_directory_not_marked_with_trailing_slash
FAILED tests/test_archive.py::TestZip::test_extract_zip_java_jar - TypeError:...
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_backslash_in_path_1
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_backslash_in_path_2
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_backslash_in_path_3
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_duplicated_lowercase_paths
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_invalid_path - T...
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_password - Asser...
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_relative_path_deeply_nested
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_relative_path_deeply_nested_with_libarchive
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_relative_path_using_default_function
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_relative_path_using_libarchive
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_timezone - TypeE...
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_timezone_2 - Typ...
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_trailing_data - ...
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_trailing_data2
FAILED tests/test_archive.py::TestZip::test_extract_zip_with_unicode_path_should_extract_without_error
FAILED tests/test_archive.py::TestTar::test_extract_python_testtar_tar_archive_with_special_files
FAILED tests/test_archive.py::TestTar::test_extract_rubygem - TypeError: a by...
FAILED tests/test_archive.py::TestTar::test_extract_tar_absolute_path - TypeE...
FAILED tests/test_archive.py::TestTar::test_extract_tar_archive_with_special_files
FAILED tests/test_archive.py::TestTar::test_extract_tar_basic - TypeError: a ...
FAILED tests/test_archive.py::TestTar::test_extract_tar_broken - TypeError: _...
FAILED tests/test_archive.py::TestTar::test_extract_tar_with_absolute_path2
FAILED tests/test_archive.py::TestTar::test_extract_tar_with_relative_path - ...
FAILED tests/test_archive.py::TestDebian::test_extract_deb_package_1 - TypeEr...
FAILED tests/test_archive.py::TestDebian::test_extract_deb_package_2 - TypeEr...
FAILED tests/test_archive.py::TestDebian::test_extract_deb_package_3 - TypeEr...
FAILED tests/test_archive.py::TestAr::test_extract_ar_basic - TypeError: norm...
FAILED tests/test_archive.py::TestAr::test_extract_ar_basic_7z - TypeError: n...
FAILED tests/test_archive.py::TestAr::test_extract_ar_broken - TypeError: nor...
FAILED tests/test_archive.py::TestAr::test_extract_ar_broken_7z - TypeError: ...
FAILED tests/test_archive.py::TestAr::test_extract_ar_broken_libarchive - ass...
FAILED tests/test_archive.py::TestAr::test_extract_ar_libarchive - TypeError:...
FAILED tests/test_archive.py::TestAr::test_extract_ar_static_library_does_not_delete_symdefs
FAILED tests/test_archive.py::TestAr::test_extract_ar_static_library_does_not_delete_symdefs_7z
FAILED tests/test_archive.py::TestAr::test_extract_ar_verify_dates - TypeErro...
FAILED tests/test_archive.py::TestAr::test_extract_ar_with_invalid_path - Typ...
FAILED tests/test_archive.py::TestAr::test_extract_ar_with_permissions - Type...
FAILED tests/test_archive.py::TestAr::test_extract_ar_with_permissions_7z - T...
FAILED tests/test_archive.py::TestAr::test_extract_ar_with_permissions_libarchive
FAILED tests/test_archive.py::TestAr::test_extract_ar_with_relative_path_and_backslashes_in_names_7z
FAILED tests/test_archive.py::TestAr::test_extract_ar_with_relative_path_and_backslashes_in_names_libarch
FAILED tests/test_archive.py::TestAr::test_extract_ar_with_relative_path_libarch
FAILED tests/test_archive.py::TestAr::test_extract_ar_with_relative_path_sevenzip
FAILED tests/test_archive.py::TestAr::test_extract_ar_with_trailing_data - Ty...
FAILED tests/test_archive.py::TestCpio::test_extract_cpio_basic - TypeError: ...
FAILED tests/test_archive.py::TestCpio::test_extract_cpio_broken2 - TypeError...
FAILED tests/test_archive.py::TestCpio::test_extract_cpio_broken_7z - Asserti...
FAILED tests/test_archive.py::TestCpio::test_extract_cpio_with_absolute_path
FAILED tests/test_archive.py::TestCpio::test_extract_cpio_with_invalidpath - ...
FAILED tests/test_archive.py::TestCpio::test_extract_cpio_with_relative_path
FAILED tests/test_archive.py::TestCpio::test_extract_cpio_with_trailing_data
FAILED tests/test_archive.py::TestCpio::test_extract_cpio_with_weird_filename_extension
FAILED tests/test_archive.py::TestRpm::test_extract_rpm_basic_1 - TypeError: ...
FAILED tests/test_archive.py::TestRpm::test_extract_rpm_basic_2 - TypeError: ...
FAILED tests/test_archive.py::TestRpm::test_extract_rpm_broken - AssertionErr...
FAILED tests/test_archive.py::TestRpm::test_extract_rpm_nested_correctly - Ty...
FAILED tests/test_archive.py::TestRpm::test_extract_rpm_with_renamed_content
FAILED tests/test_archive.py::TestRpm::test_extract_rpm_with_trailing_data - ...
FAILED tests/test_archive.py::TestExtractTwice::test_extract_twice_can_extract_to_relative_paths
FAILED tests/test_archive.py::TestExtractTwice::test_extract_twice_with_rpm_with_xz_compressed_cpio
FAILED tests/test_archive.py::TestRar::test_extract_rar_basic - TypeError: a ...
FAILED tests/test_archive.py::TestRar::test_extract_rar_broken - assert False
FAILED tests/test_archive.py::TestRar::test_extract_rar_with_absolute_path - ...
FAILED tests/test_archive.py::TestRar::test_extract_rar_with_invalid_path - T...
FAILED tests/test_archive.py::TestRar::test_extract_rar_with_non_ascii_path
FAILED tests/test_archive.py::TestRar::test_extract_rar_with_password - asser...
FAILED tests/test_archive.py::TestRar::test_extract_rar_with_relative_path - ...
FAILED tests/test_archive.py::TestSevenZip::test_extract_7z_basic - TypeError...
FAILED tests/test_archive.py::TestSevenZip::test_extract_7z_basic_with_space_in_file_name
FAILED tests/test_archive.py::TestSevenZip::test_extract_7z_with_broken_archive_does_not_fail_when_using_fallback
FAILED tests/test_archive.py::TestSevenZip::test_extract_7z_with_broken_archive_with7z
FAILED tests/test_archive.py::TestSevenZip::test_extract_7z_with_invalid_path
FAILED tests/test_archive.py::TestSevenZip::test_extract_7z_with_invalid_path_using_7z
FAILED tests/test_archive.py::TestSevenZip::test_extract_7z_with_password - A...
FAILED tests/test_archive.py::TestSevenZip::test_extract_7z_with_password_with_7z
FAILED tests/test_archive.py::TestSevenZip::test_extract_7z_with_relative_path
FAILED tests/test_archive.py::TestSevenZip::test_extract_7z_with_trailing_data
FAILED tests/test_archive.py::TestSevenZip::test_extract_7zip_extract_with_unicode_path_extracts_with_errors
FAILED tests/test_archive.py::TestSevenZip::test_extract_7zip_native_with_unicode_path_should_extract_without_error
FAILED tests/test_archive.py::TestSevenZip::test_extract_7zip_with_fallback_with_unicode_path_should_extract_without_error
FAILED tests/test_archive.py::TestIso::test_extract_iso_basic - TypeError: no...
FAILED tests/test_archive.py::TestIso::test_extract_iso_basic_with_with_weird_filename_extension
FAILED tests/test_archive.py::TestXzLzma::test_extract_archive_tar_lzma_1 - T...
FAILED tests/test_archive.py::TestXzLzma::test_extract_archive_tar_lzma_2 - T...
FAILED tests/test_archive.py::TestXzLzma::test_extract_archive_tar_lzma_3 - T...
FAILED tests/test_archive.py::TestXzLzma::test_extract_archive_tar_xz_1 - Typ...
FAILED tests/test_archive.py::TestXzLzma::test_extract_archive_tar_xz_2 - Typ...
FAILED tests/test_archive.py::TestTarZ::test_extract_tarz_compress_basic - Ty...
FAILED tests/test_archive.py::TestTarZ::test_extract_z_compress_basic - TypeE...
FAILED tests/test_archive.py::TestXar::test_extract_xar_basic - TypeError: no...
FAILED tests/test_archive.py::TestCb7::test_extract_cb7_basic_with_space_in_file_name
FAILED tests/test_archive.py::TestCb7::test_extract_cb7_basic_with_weird_filename_extension
FAILED tests/test_archive.py::TestCab::test_extract_cab_basic - TypeError: no...
FAILED tests/test_archive.py::TestCab::test_extract_cab_basic_with_weird_filename_extension
FAILED tests/test_archive.py::TestCbr::test_extract_cbr_basic - TypeError: a ...
FAILED tests/test_archive.py::TestCbr::test_extract_cbr_basic_with_weird_filename_extension
FAILED tests/test_archive.py::TestCbt::test_extract_cbt_basic - TypeError: a ...
FAILED tests/test_archive.py::TestCbt::test_extract_cbt_basic_with_weird_filename_extension
FAILED tests/test_archive.py::TestCbz::test_extract_cbz_basic - TypeError: no...
FAILED tests/test_archive.py::TestCbz::test_extract_cbz_basic_with_weird_filename_extension
FAILED tests/test_archive.py::TestLzip::test_extract_tarlzip_basic - TypeErro...
FAILED tests/test_archive.py::TestLzip::test_uncompress_lzip_basic - TypeErro...
FAILED tests/test_archive.py::TestLz4::test_extract_tarlz4_basic - TypeError:...
FAILED tests/test_archive.py::TestLz4::test_uncompress_lz4_basic - TypeError:...
FAILED tests/test_archive.py::TestZstd::test_extract_tarzstd_basic - TypeErro...
FAILED tests/test_archive.py::TestZstd::test_uncompress_lzip_basic - TypeErro...
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix::test_extract_7zip_with_weird_filenames_with_libarchive_posix
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix::test_extract_ar_with_weird_filenames_with_libarchive_posix
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix::test_extract_cpio_with_weird_filenames_with_libarchive_posix
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix::test_extract_tar_with_weird_filenames_with_libarchive_posix
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithLibarchiveOnPosix::test_extract_zip_with_weird_filenames_with_libarchive_posix
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix::test_extract_7zip_with_weird_filenames_with_sevenzip_posix
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix::test_extract_ar_with_weird_filenames_with_sevenzip_posix
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix::test_extract_cpio_with_weird_filenames_with_sevenzip_posix
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix::test_extract_iso_with_weird_filenames_with_sevenzip_posix
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix::test_extract_tar_with_weird_filenames_with_sevenzip_posix
FAILED tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix::test_extract_zip_with_weird_filenames_with_sevenzip_posix
FAILED tests/test_archive.py::TestZipSlip::test_extract_zipslip_tar_posix - T...
FAILED tests/test_archive.py::TestZipSlip::test_extract_zipslip_tar_win - Typ...
FAILED tests/test_archive.py::TestZipSlip::test_extract_zipslip_zip_posix - T...
FAILED tests/test_archive.py::TestZipSlip::test_extract_zipslip_zip_win - Typ...
FAILED tests/test_extract.py::TestExtract::test_extract_archive_non_nested - ...
FAILED tests/test_extract.py::TestExtract::test_extract_archive_shallow_with_readonly_inside
FAILED tests/test_extract.py::TestExtract::test_extract_can_extract_to_relative_paths
FAILED tests/test_extract.py::TestExtract::test_extract_dir_shallow_with_readonly_inside
FAILED tests/test_extract.py::TestExtract::test_extract_dir_with_nested_tar_file_shallow_then_recurse
FAILED tests/test_extract.py::TestExtract::test_extract_directory_of_windows_ar_archives
FAILED tests/test_extract.py::TestExtract::test_extract_directory_with_office_docs
FAILED tests/test_extract.py::TestExtract::test_extract_file_function - asser...
FAILED tests/test_extract.py::TestExtract::test_extract_file_handles_archives_of_default_kinds
FAILED tests/test_extract.py::TestExtract::test_extract_file_works_with_all_kinds
FAILED tests/test_extract.py::TestExtract::test_extract_ignore_directory - As...
FAILED tests/test_extract.py::TestExtract::test_extract_ignore_file - assert ...
FAILED tests/test_extract.py::TestExtract::test_extract_ignore_pattern - Asse...
FAILED tests/test_extract.py::TestExtract::test_extract_nested_arch_with_corruption_should_extract_inner_archives_only_once
FAILED tests/test_extract.py::TestExtract::test_extract_nested_tar_file_recurse_only
FAILED tests/test_extract.py::TestExtract::test_extract_nested_tar_file_shallow_only
FAILED tests/test_extract.py::TestExtract::test_extract_nested_tar_file_shallow_then_recurse
FAILED tests/test_extract.py::TestExtract::test_extract_tar_gz_with_spaces_in_name
FAILED tests/test_extract.py::TestExtract::test_extract_tar_with_broken_links
FAILED tests/test_extract.py::TestExtract::test_extract_tar_with_special_files
FAILED tests/test_extract.py::TestExtract::test_extract_tree_recursive - asse...
FAILED tests/test_extract.py::TestExtract::test_extract_tree_recursive_replace_originals
FAILED tests/test_extract.py::TestExtract::test_extract_tree_shallow_only - a...
FAILED tests/test_extract.py::TestExtract::test_extract_tree_shallow_then_recursive
FAILED tests/test_extract.py::TestExtract::test_extract_tree_with_corrupted_archives_linux
FAILED tests/test_extract.py::TestExtract::test_extract_with_empty_dir_and_small_files_ignores_empty_dirs
FAILED tests/test_extract.py::TestExtract::test_extract_zip_with_spaces_in_name
FAILED tests/test_extract.py::TestExtract::test_extract_zipslip_tar_posix - A...
FAILED tests/test_extract.py::TestExtract::test_uncompress_corrupted_archive_with_libarchive
FAILED tests/test_extractcode_api.py::TestExtractApi::test_extract_archive - ...
FAILED tests/test_libarchive2.py::TestExtractorTest::test_libarchive_extract_can_extract_to_relative_paths
FAILED tests/test_sevenzip.py::TestSevenZip::test_extract_of_tar_with_aboslute_path
FAILED tests/test_sevenzip.py::TestSevenZipListEntries::test_extract_of_tar_with_aboslute_path
FAILED tests/test_sevenzip.py::TestSevenParseListing::test_extract_of_tar_with_aboslute_path
FAILED tests/test_sevenzip.py::TestSevenZipFileByFile::test_extract_file_by_file_of_nested_zip
FAILED tests/test_sevenzip.py::TestSevenZipFileByFile::test_extract_file_by_file_of_special_tar
FAILED tests/test_sevenzip.py::TestSevenZipFileByFile::test_extract_file_by_file_of_tar_with_absolute_path
FAILED tests/test_sevenzip.py::TestSevenZipFileByFile::test_extract_file_by_file_weird_names_ar
FAILED tests/test_sevenzip.py::TestSevenZipFileByFile::test_extract_file_by_file_weird_names_cpio
FAILED tests/test_sevenzip.py::TestSevenZipFileByFile::test_extract_file_by_file_weird_names_tar
FAILED tests/test_sevenzip.py::TestSevenZipFileByFile::test_extract_file_by_file_weird_names_zip
FAILED tests/test_sevenzip.py::TestSevenZipFileByFile::test_extract_file_by_file_with_weird_names_7z
FAILED tests/test_sevenzip.py::TestSevenZipFileByFile::test_extract_of_tar_with_aboslute_path
XFAIL tests/test_archive.py::TestUncompressGzip::test_uncompress_gzip_with_trailing_data - Fails for now on Python 3
XFAIL tests/test_archive.py::TestZip::test_extract_zip_with_relative_path_deeply_nested_with_7zip_posix_py3 - Expectations are different on Windows and this may fail on Windows
XFAIL tests/test_archive.py::TestDia::test_extract_dia_with_trailing_data - Fails for now on Python 3
XFAIL tests/test_archive.py::TestDia::test_extract_dia_with_trailing_data_py3 - Fails for now on Python 3
XFAIL tests/test_archive.py::TestExtractArchiveWithIllegalFilenamesWithSevenzipOnPosix::test_extract_rar_with_weird_filenames_with_sevenzip_posix
= 190 failed, 119 passed, 229 skipped, 17 deselected, 5 xfailed, 183 warnings in 17.21s =
error: Bad exit status from /var/tmp/rpm-tmp.XUjbrN (%check)
    Bad exit status from /var/tmp/rpm-tmp.XUjbrN (%check)

RPM build errors:
Finish: rpmbuild python-extractcode-31.0.0-6.fc43.src.rpm
Finish: build phase for python-extractcode-31.0.0-6.fc43.src.rpm
INFO: chroot_scan: 1 files copied to /var/lib/copr-rpmbuild/results/chroot_scan
INFO: /var/lib/mock/fedora-rawhide-x86_64-1741783375.735297/root/var/log/dnf5.log
INFO: chroot_scan: creating tarball /var/lib/copr-rpmbuild/results/chroot_scan.tar.gz
/bin/tar: Removing leading `/' from member names
ERROR: Exception(/var/lib/copr-rpmbuild/results/python-extractcode-31.0.0-6.fc43.src.rpm) Config(fedora-rawhide-x86_64) 0 minutes 50 seconds
INFO: Results and/or logs in: /var/lib/copr-rpmbuild/results
INFO: Cleaning up build root ('cleanup_on_failure=True')
Start: clean chroot
INFO: unmounting tmpfs.
Finish: clean chroot
ERROR: Command failed: 
 # /usr/bin/systemd-nspawn -q -M b35048db5141415885e539a98c67b3a3 -D /var/lib/mock/fedora-rawhide-x86_64-1741783375.735297/root -a -u mockbuild --capability=cap_ipc_lock --rlimit=RLIMIT_NOFILE=10240 --capability=cap_ipc_lock --bind=/tmp/mock-resolv.61yafm05:/etc/resolv.conf --bind=/dev/btrfs-control --bind=/dev/mapper/control --bind=/dev/fuse --bind=/dev/loop-control --bind=/dev/loop0 --bind=/dev/loop1 --bind=/dev/loop2 --bind=/dev/loop3 --bind=/dev/loop4 --bind=/dev/loop5 --bind=/dev/loop6 --bind=/dev/loop7 --bind=/dev/loop8 --bind=/dev/loop9 --bind=/dev/loop10 --bind=/dev/loop11 --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin '--setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007"' '--setenv=PS1=<mock-chroot> \s-\v\$ ' --setenv=LANG=C.UTF-8 --resolv-conf=off bash --login -c '/usr/bin/rpmbuild -ba --noprep  --target x86_64 /builddir/build/originals/python-extractcode.spec'

Copr build error: Build failed