Tue May 14 06:09:32 UTC 2024 I: starting to build python-urllib3/experimental/amd64 on jenkins on '2024-05-14 06:09' Tue May 14 06:09:32 UTC 2024 I: The jenkins build log is/was available at https://jenkins.debian.net/userContent/reproducible/debian/build_service/amd64_10/6224/console.log Tue May 14 06:09:32 UTC 2024 I: Downloading source for experimental/python-urllib3=2.0.7-1 --2024-05-14 06:09:32-- http://cdn-fastly.deb.debian.org/debian/pool/main/p/python-urllib3/python-urllib3_2.0.7-1.dsc Connecting to 46.16.76.132:3128... connected. Proxy request sent, awaiting response... 200 OK Length: 2646 (2.6K) [text/prs.lines.tag] Saving to: ‘python-urllib3_2.0.7-1.dsc’ 0K .. 100% 338M=0s 2024-05-14 06:09:32 (338 MB/s) - ‘python-urllib3_2.0.7-1.dsc’ saved [2646/2646] Tue May 14 06:09:32 UTC 2024 I: python-urllib3_2.0.7-1.dsc -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Format: 3.0 (quilt) Source: python-urllib3 Binary: python3-urllib3 Architecture: all Version: 2.0.7-1 Maintainer: Debian Python Team Uploaders: Daniele Tricoli Homepage: https://urllib3.readthedocs.org Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/python-team/packages/python-urllib3 Vcs-Git: https://salsa.debian.org/python-team/packages/python-urllib3.git Testsuite: autopkgtest Testsuite-Triggers: python3-all, python3-brotli, python3-coverage, python3-cryptography, python3-idna, python3-mock, python3-openssl, python3-pytest, python3-pytest-timeout, python3-six, python3-socks, python3-tornado, python3-trustme Build-Depends: debhelper-compat (= 13), dh-python, pybuild-plugin-pyproject, python3-all, python3-brotli , python3-coverage , python3-cryptography , python3-hatchling, python3-idna , python3-mock , python3-openssl , python3-pytest , python3-pytest-timeout , python3-socks , python3-tornado , python3-trustme Package-List: python3-urllib3 deb python optional arch=all Checksums-Sha1: f462f7171c35b6206ade5a301a49f94d4a439edf 282546 python-urllib3_2.0.7.orig.tar.gz bbc3004985ea3fe06d38e357acdf27834a86ff51 10248 python-urllib3_2.0.7-1.debian.tar.xz Checksums-Sha256: c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 282546 python-urllib3_2.0.7.orig.tar.gz 1c2995964691587349d3c0cc6416aa14b87fd91d0a128c3bc0176254c86d1dab 10248 python-urllib3_2.0.7-1.debian.tar.xz Files: 5a264ef3ae827e5842bbc80536a343dd 282546 python-urllib3_2.0.7.orig.tar.gz 23fd9f079fe300bfaa58e913859deb54 10248 python-urllib3_2.0.7-1.debian.tar.xz -----BEGIN PGP SIGNATURE----- iQJFBAEBCgAvFiEExlrvn+W/jMvW7bAZi69SLA1szt0FAmVRW+wRHGVyaW9sQGRl Ymlhbi5vcmcACgkQi69SLA1szt0wShAAvqa3EtifH/1t437leppW9pl2WRrYvWhl 9+TnIU7uVaWGUXC4tGW1hg0YMC2/sRzklZEX3pOlcwIxqLvovjXFE5GC1mwVSlnF 0YGPred48mWuAfxyNGfLxq2izVc32J4VnCMo1th6q8P0+c6OX/0qHx1rij4JXRFd Gg1+mgmRHH/o3Yid1cXJBhlJ3EWsYfCnhUEqWeNDQpMLN4RKvczBcpsNzfYgMycK bRS4FYVgHRqY80WTiAM75sGXpYx0JUZutf81hlngSwE3WyBqEB5uvx96g5sXzeBC BgASM1iihEvlwF/p/3+JO5MtLr8YuzZH+SP29cyGZJcwhN9PC5VR+h9elQd78aK7 Q92WZn8Doc+FhI1niQGOLivI4LEz7tf3Ngq9Hzv7hHarda6XyqOnVh9aPVswLlWh AYSHdwUtP3oi23Zl0KD0IS8t0ig0L6N5yNP7eGpBzxwQSd2EPKlpyARYOY+tlcOd cps6a4WI5owIXO7pV8y8G/vwYBSpbtO1bfG2jM36ceq/S8jJ9vlgmgaBxzEr14b1 6mov2fcEHQtsRmls7jxpVcrW/h8Dp3n6vQOY/6+6GOSlhFwwzgPiiojXUxRAoFj4 xO02oim1oCt/Kip/3VxyK71svr1uzqKe4a7nRqhwH5ul6Lx5IUptDPlXJH3WuAgN gm6PpixkYoU= =+2Cf -----END PGP SIGNATURE----- Tue May 14 06:09:32 UTC 2024 I: Checking whether the package is not for us Tue May 14 06:09:32 UTC 2024 I: Starting 1st build on remote node ionos5-amd64.debian.net. Tue May 14 06:09:32 UTC 2024 I: Preparing to do remote build '1' on ionos5-amd64.debian.net. Tue May 14 06:14:48 UTC 2024 I: Deleting $TMPDIR on ionos5-amd64.debian.net. I: pbuilder: network access will be disabled during build I: Current time: Mon Jun 16 00:32:32 -12 2025 I: pbuilder-time-stamp: 1750077152 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/experimental-reproducible-base.tgz] I: copying local configuration W: --override-config is not set; not updating apt.conf Read the manpage for details. I: mounting /proc filesystem I: mounting /sys filesystem I: creating /{dev,run}/shm I: mounting /dev/pts filesystem I: redirecting /dev/ptmx to /dev/pts/ptmx I: policy-rc.d already exists I: Copying source file I: copying [python-urllib3_2.0.7-1.dsc] I: copying [./python-urllib3_2.0.7.orig.tar.gz] I: copying [./python-urllib3_2.0.7-1.debian.tar.xz] I: Extracting source gpgv: Signature made Sun Nov 12 23:12:44 2023 gpgv: using RSA key C65AEF9FE5BF8CCBD6EDB0198BAF522C0D6CCEDD gpgv: issuer "eriol@debian.org" gpgv: Can't check signature: No public key dpkg-source: warning: cannot verify inline signature for ./python-urllib3_2.0.7-1.dsc: no acceptable signature found dpkg-source: info: extracting python-urllib3 in python-urllib3-2.0.7 dpkg-source: info: unpacking python-urllib3_2.0.7.orig.tar.gz dpkg-source: info: unpacking python-urllib3_2.0.7-1.debian.tar.xz dpkg-source: info: using patch list from debian/patches/series dpkg-source: info: applying tests-requires-network dpkg-source: info: applying tests-mark-requires-network dpkg-source: info: applying dont-hit-evilcom dpkg-source: info: applying integration-tests-flag I: Not using root during the build. I: Installing the build-deps I: user script /srv/workspace/pbuilder/3012803/tmp/hooks/D02_print_environment starting I: set BUILDDIR='/build/reproducible-path' BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' BUILDUSERNAME='pbuilder1' BUILD_ARCH='amd64' DEBIAN_FRONTEND='noninteractive' DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=42 ' DISTRIBUTION='experimental' HOME='/root' HOST_ARCH='amd64' IFS=' ' INVOCATION_ID='3d23854769d040fda6fe73e268973e63' LANG='C' LANGUAGE='en_US:en' LC_ALL='C' MAIL='/var/mail/root' OPTIND='1' PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' PBCURRENTCOMMANDLINEOPERATION='build' PBUILDER_OPERATION='build' PBUILDER_PKGDATADIR='/usr/share/pbuilder' PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' PBUILDER_SYSCONFDIR='/etc' PPID='3012803' PS1='# ' PS2='> ' PS4='+ ' PWD='/' SHELL='/bin/bash' SHLVL='2' SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.tRjFP2ou/pbuilderrc_c098 --distribution experimental --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/experimental-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.tRjFP2ou/b1 --logfile b1/build.log python-urllib3_2.0.7-1.dsc' SUDO_GID='110' SUDO_UID='105' SUDO_USER='jenkins' TERM='unknown' TZ='/usr/share/zoneinfo/Etc/GMT+12' USER='root' _='/usr/bin/systemd-run' http_proxy='http://213.165.73.152:3128' I: uname -a Linux ionos5-amd64 6.6.13+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.13-1~bpo12+1 (2024-02-15) x86_64 GNU/Linux I: ls -l /bin lrwxrwxrwx 1 root root 7 Jun 15 13:58 /bin -> usr/bin I: user script /srv/workspace/pbuilder/3012803/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy Version: 0.invalid.0 Architecture: amd64 Maintainer: Debian Pbuilder Team Description: Dummy package to satisfy dependencies with aptitude - created by pbuilder This package was created automatically by pbuilder to satisfy the build-dependencies of the package being currently built. Depends: debhelper-compat (= 13), dh-python, pybuild-plugin-pyproject, python3-all, python3-brotli, python3-coverage, python3-cryptography, python3-hatchling, python3-idna, python3-mock, python3-openssl, python3-pytest, python3-pytest-timeout, python3-socks, python3-tornado, python3-trustme dpkg-deb: building package 'pbuilder-satisfydepends-dummy' in '/tmp/satisfydepends-aptitude/pbuilder-satisfydepends-dummy.deb'. Selecting previously unselected package pbuilder-satisfydepends-dummy. (Reading database ... 19699 files and directories currently installed.) Preparing to unpack .../pbuilder-satisfydepends-dummy.deb ... Unpacking pbuilder-satisfydepends-dummy (0.invalid.0) ... dpkg: pbuilder-satisfydepends-dummy: dependency problems, but configuring anyway as you requested: pbuilder-satisfydepends-dummy depends on debhelper-compat (= 13); however: Package debhelper-compat is not installed. pbuilder-satisfydepends-dummy depends on dh-python; however: Package dh-python is not installed. pbuilder-satisfydepends-dummy depends on pybuild-plugin-pyproject; however: Package pybuild-plugin-pyproject is not installed. pbuilder-satisfydepends-dummy depends on python3-all; however: Package python3-all is not installed. pbuilder-satisfydepends-dummy depends on python3-brotli; however: Package python3-brotli is not installed. pbuilder-satisfydepends-dummy depends on python3-coverage; however: Package python3-coverage is not installed. pbuilder-satisfydepends-dummy depends on python3-cryptography; however: Package python3-cryptography is not installed. pbuilder-satisfydepends-dummy depends on python3-hatchling; however: Package python3-hatchling is not installed. pbuilder-satisfydepends-dummy depends on python3-idna; however: Package python3-idna is not installed. pbuilder-satisfydepends-dummy depends on python3-mock; however: Package python3-mock is not installed. pbuilder-satisfydepends-dummy depends on python3-openssl; however: Package python3-openssl is not installed. pbuilder-satisfydepends-dummy depends on python3-pytest; however: Package python3-pytest is not installed. pbuilder-satisfydepends-dummy depends on python3-pytest-timeout; however: Package python3-pytest-timeout is not installed. pbuilder-satisfydepends-dummy depends on python3-socks; however: Package python3-socks is not installed. pbuilder-satisfydepends-dummy depends on python3-tornado; however: Package python3-tornado is not installed. pbuilder-satisfydepends-dummy depends on python3-trustme; however: Package python3-trustme is not installed. Setting up pbuilder-satisfydepends-dummy (0.invalid.0) ... Reading package lists... Building dependency tree... Reading state information... Initializing package states... Writing extended state information... Building tag database... pbuilder-satisfydepends-dummy is already installed at the requested version (0.invalid.0) pbuilder-satisfydepends-dummy is already installed at the requested version (0.invalid.0) The following NEW packages will be installed: autoconf{a} automake{a} autopoint{a} autotools-dev{a} bsdextrautils{a} ca-certificates{a} debhelper{a} dh-autoreconf{a} dh-python{a} dh-strip-nondeterminism{a} dwz{a} file{a} gettext{a} gettext-base{a} groff-base{a} intltool-debian{a} libarchive-zip-perl{a} libdebhelper-perl{a} libelf1t64{a} libexpat1{a} libfile-stripnondeterminism-perl{a} libicu72{a} libmagic-mgc{a} libmagic1t64{a} libpipeline1{a} libpython3-stdlib{a} libpython3.11-minimal{a} libpython3.11-stdlib{a} libpython3.12-minimal{a} libpython3.12-stdlib{a} libreadline8t64{a} libsub-override-perl{a} libtool{a} libuchardet0{a} libxml2{a} m4{a} man-db{a} media-types{a} netbase{a} openssl{a} po-debconf{a} pybuild-plugin-pyproject{a} python3{a} python3-all{a} python3-brotli{a} python3-build{a} python3-cffi-backend{a} python3-coverage{a} python3-cryptography{a} python3-distutils{a} python3-hatchling{a} python3-idna{a} python3-iniconfig{a} python3-installer{a} python3-lib2to3{a} python3-minimal{a} python3-mock{a} python3-openssl{a} python3-packaging{a} python3-pathspec{a} python3-pkg-resources{a} python3-pluggy{a} python3-pyproject-hooks{a} python3-pytest{a} python3-pytest-timeout{a} python3-setuptools{a} python3-socks{a} python3-toml{a} python3-tornado{a} python3-trove-classifiers{a} python3-trustme{a} python3-wheel{a} python3.11{a} python3.11-minimal{a} python3.12{a} python3.12-minimal{a} readline-common{a} sensible-utils{a} tzdata{a} The following packages are RECOMMENDED but will NOT be installed: curl libarchive-cpio-perl libltdl-dev libmail-sendmail-perl lynx python3-pygments wget 0 packages upgraded, 79 newly installed, 0 to remove and 0 not upgraded. Need to get 35.8 MB of archives. After unpacking 144 MB will be used. Writing extended state information... Get: 1 http://deb.debian.org/debian unstable/main amd64 libpython3.11-minimal amd64 3.11.9-1 [817 kB] Get: 2 http://deb.debian.org/debian unstable/main amd64 libexpat1 amd64 2.6.2-1 [103 kB] Get: 3 http://deb.debian.org/debian unstable/main amd64 python3.11-minimal amd64 3.11.9-1 [1879 kB] Get: 4 http://deb.debian.org/debian unstable/main amd64 python3-minimal amd64 3.11.8-1 [26.3 kB] Get: 5 http://deb.debian.org/debian unstable/main amd64 media-types all 10.1.0 [26.9 kB] Get: 6 http://deb.debian.org/debian unstable/main amd64 netbase all 6.4 [12.8 kB] Get: 7 http://deb.debian.org/debian unstable/main amd64 tzdata all 2024a-4 [255 kB] Get: 8 http://deb.debian.org/debian unstable/main amd64 readline-common all 8.2-4 [69.3 kB] Get: 9 http://deb.debian.org/debian unstable/main amd64 libreadline8t64 amd64 8.2-4 [167 kB] Get: 10 http://deb.debian.org/debian unstable/main amd64 libpython3.11-stdlib amd64 3.11.9-1 [1792 kB] Get: 11 http://deb.debian.org/debian unstable/main amd64 python3.11 amd64 3.11.9-1 [602 kB] Get: 12 http://deb.debian.org/debian unstable/main amd64 libpython3-stdlib amd64 3.11.8-1 [9332 B] Get: 13 http://deb.debian.org/debian unstable/main amd64 python3 amd64 3.11.8-1 [27.4 kB] Get: 14 http://deb.debian.org/debian unstable/main amd64 libpython3.12-minimal amd64 3.12.3-1 [809 kB] Get: 15 http://deb.debian.org/debian unstable/main amd64 python3.12-minimal amd64 3.12.3-1 [2139 kB] Get: 16 http://deb.debian.org/debian unstable/main amd64 sensible-utils all 0.0.22 [22.4 kB] Get: 17 http://deb.debian.org/debian unstable/main amd64 openssl amd64 3.2.1-3 [1360 kB] Get: 18 http://deb.debian.org/debian unstable/main amd64 ca-certificates all 20240203 [158 kB] Get: 19 http://deb.debian.org/debian unstable/main amd64 libmagic-mgc amd64 1:5.45-3 [314 kB] Get: 20 http://deb.debian.org/debian unstable/main amd64 libmagic1t64 amd64 1:5.45-3 [105 kB] Get: 21 http://deb.debian.org/debian unstable/main amd64 file amd64 1:5.45-3 [42.9 kB] Get: 22 http://deb.debian.org/debian unstable/main amd64 gettext-base amd64 0.21-14+b1 [161 kB] Get: 23 http://deb.debian.org/debian unstable/main amd64 libuchardet0 amd64 0.0.8-1+b1 [68.8 kB] Get: 24 http://deb.debian.org/debian unstable/main amd64 groff-base amd64 1.23.0-4 [1180 kB] Get: 25 http://deb.debian.org/debian unstable/main amd64 bsdextrautils amd64 2.40-8 [92.8 kB] Get: 26 http://deb.debian.org/debian unstable/main amd64 libpipeline1 amd64 1.5.7-2 [38.0 kB] Get: 27 http://deb.debian.org/debian unstable/main amd64 man-db amd64 2.12.1-1 [1411 kB] Get: 28 http://deb.debian.org/debian unstable/main amd64 m4 amd64 1.4.19-4 [287 kB] Get: 29 http://deb.debian.org/debian unstable/main amd64 autoconf all 2.71-3 [332 kB] Get: 30 http://deb.debian.org/debian unstable/main amd64 autotools-dev all 20220109.1 [51.6 kB] Get: 31 http://deb.debian.org/debian unstable/main amd64 automake all 1:1.16.5-1.3 [823 kB] Get: 32 http://deb.debian.org/debian unstable/main amd64 autopoint all 0.21-14 [496 kB] Get: 33 http://deb.debian.org/debian unstable/main amd64 libdebhelper-perl all 13.15.3 [88.0 kB] Get: 34 http://deb.debian.org/debian unstable/main amd64 libtool all 2.4.7-7 [517 kB] Get: 35 http://deb.debian.org/debian unstable/main amd64 dh-autoreconf all 20 [17.1 kB] Get: 36 http://deb.debian.org/debian unstable/main amd64 libarchive-zip-perl all 1.68-1 [104 kB] Get: 37 http://deb.debian.org/debian unstable/main amd64 libsub-override-perl all 0.10-1 [10.6 kB] Get: 38 http://deb.debian.org/debian unstable/main amd64 libfile-stripnondeterminism-perl all 1.13.1-1 [19.4 kB] Get: 39 http://deb.debian.org/debian unstable/main amd64 dh-strip-nondeterminism all 1.13.1-1 [8620 B] Get: 40 http://deb.debian.org/debian unstable/main amd64 libelf1t64 amd64 0.191-1+b1 [189 kB] Get: 41 http://deb.debian.org/debian unstable/main amd64 dwz amd64 0.15-1+b1 [110 kB] Get: 42 http://deb.debian.org/debian unstable/main amd64 libicu72 amd64 72.1-4+b1 [9395 kB] Get: 43 http://deb.debian.org/debian unstable/main amd64 libxml2 amd64 2.9.14+dfsg-1.3+b3 [692 kB] Get: 44 http://deb.debian.org/debian unstable/main amd64 gettext amd64 0.21-14+b1 [1301 kB] Get: 45 http://deb.debian.org/debian unstable/main amd64 intltool-debian all 0.35.0+20060710.6 [22.9 kB] Get: 46 http://deb.debian.org/debian unstable/main amd64 po-debconf all 1.0.21+nmu1 [248 kB] Get: 47 http://deb.debian.org/debian unstable/main amd64 debhelper all 13.15.3 [901 kB] Get: 48 http://deb.debian.org/debian unstable/main amd64 python3-pkg-resources all 68.1.2-2 [241 kB] Get: 49 http://deb.debian.org/debian unstable/main amd64 python3-lib2to3 all 3.12.3-1 [77.6 kB] Get: 50 http://deb.debian.org/debian unstable/main amd64 python3-distutils all 3.12.3-1 [131 kB] Get: 51 http://deb.debian.org/debian unstable/main amd64 python3-setuptools all 68.1.2-2 [468 kB] Get: 52 http://deb.debian.org/debian unstable/main amd64 dh-python all 6.20240422 [107 kB] Get: 53 http://deb.debian.org/debian unstable/main amd64 libpython3.12-stdlib amd64 3.12.3-1 [1951 kB] Get: 54 http://deb.debian.org/debian unstable/main amd64 python3-packaging all 24.0-1 [45.5 kB] Get: 55 http://deb.debian.org/debian unstable/main amd64 python3-pyproject-hooks all 1.0.0-2 [10.6 kB] Get: 56 http://deb.debian.org/debian unstable/main amd64 python3-toml all 0.10.2-1 [16.2 kB] Get: 57 http://deb.debian.org/debian unstable/main amd64 python3-wheel all 0.43.0-1 [52.5 kB] Get: 58 http://deb.debian.org/debian unstable/main amd64 python3-build all 1.2.1-1 [34.1 kB] Get: 59 http://deb.debian.org/debian unstable/main amd64 python3-installer all 0.7.0+dfsg1-3 [18.6 kB] Get: 60 http://deb.debian.org/debian unstable/main amd64 pybuild-plugin-pyproject all 6.20240422 [11.1 kB] Get: 61 http://deb.debian.org/debian unstable/main amd64 python3.12 amd64 3.12.3-1 [659 kB] Get: 62 http://deb.debian.org/debian unstable/main amd64 python3-all amd64 3.11.8-1 [1056 B] Get: 63 http://deb.debian.org/debian unstable/main amd64 python3-brotli amd64 1.1.0-2+b3 [312 kB] Get: 64 http://deb.debian.org/debian unstable/main amd64 python3-cffi-backend amd64 1.16.0-2+b2 [112 kB] Get: 65 http://deb.debian.org/debian unstable/main amd64 python3-coverage amd64 7.2.7+dfsg1-1+b1 [170 kB] Get: 66 http://deb.debian.org/debian unstable/main amd64 python3-cryptography amd64 42.0.5-2 [1186 kB] Get: 67 http://deb.debian.org/debian unstable/main amd64 python3-pathspec all 0.12.1-1 [28.1 kB] Get: 68 http://deb.debian.org/debian unstable/main amd64 python3-pluggy all 1.5.0-1 [26.9 kB] Get: 69 http://deb.debian.org/debian unstable/main amd64 python3-trove-classifiers all 2024.1.31-1 [9968 B] Get: 70 http://deb.debian.org/debian unstable/main amd64 python3-hatchling all 1.24.2-1 [53.2 kB] Get: 71 http://deb.debian.org/debian unstable/main amd64 python3-idna all 3.6-2 [37.0 kB] Get: 72 http://deb.debian.org/debian unstable/main amd64 python3-iniconfig all 1.1.1-2 [6396 B] Get: 73 http://deb.debian.org/debian unstable/main amd64 python3-mock all 5.1.0-1 [70.2 kB] Get: 74 http://deb.debian.org/debian unstable/main amd64 python3-openssl all 24.1.0-1 [51.9 kB] Get: 75 http://deb.debian.org/debian unstable/main amd64 python3-pytest all 8.1.2-1 [246 kB] Get: 76 http://deb.debian.org/debian unstable/main amd64 python3-pytest-timeout all 2.3.1-1 [21.9 kB] Get: 77 http://deb.debian.org/debian unstable/main amd64 python3-socks all 1.7.1+dfsg-1 [23.3 kB] Get: 78 http://deb.debian.org/debian unstable/main amd64 python3-tornado amd64 6.4.0-1 [347 kB] Get: 79 http://deb.debian.org/debian unstable/main amd64 python3-trustme all 0.9.0-1.1 [12.1 kB] Fetched 35.8 MB in 0s (143 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libpython3.11-minimal:amd64. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19699 files and directories currently installed.) Preparing to unpack .../libpython3.11-minimal_3.11.9-1_amd64.deb ... Unpacking libpython3.11-minimal:amd64 (3.11.9-1) ... Selecting previously unselected package libexpat1:amd64. Preparing to unpack .../libexpat1_2.6.2-1_amd64.deb ... Unpacking libexpat1:amd64 (2.6.2-1) ... Selecting previously unselected package python3.11-minimal. Preparing to unpack .../python3.11-minimal_3.11.9-1_amd64.deb ... Unpacking python3.11-minimal (3.11.9-1) ... Setting up libpython3.11-minimal:amd64 (3.11.9-1) ... Setting up libexpat1:amd64 (2.6.2-1) ... Setting up python3.11-minimal (3.11.9-1) ... Selecting previously unselected package python3-minimal. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 20015 files and directories currently installed.) Preparing to unpack .../0-python3-minimal_3.11.8-1_amd64.deb ... Unpacking python3-minimal (3.11.8-1) ... Selecting previously unselected package media-types. Preparing to unpack .../1-media-types_10.1.0_all.deb ... Unpacking media-types (10.1.0) ... Selecting previously unselected package netbase. Preparing to unpack .../2-netbase_6.4_all.deb ... Unpacking netbase (6.4) ... Selecting previously unselected package tzdata. Preparing to unpack .../3-tzdata_2024a-4_all.deb ... Unpacking tzdata (2024a-4) ... Selecting previously unselected package readline-common. Preparing to unpack .../4-readline-common_8.2-4_all.deb ... Unpacking readline-common (8.2-4) ... Selecting previously unselected package libreadline8t64:amd64. Preparing to unpack .../5-libreadline8t64_8.2-4_amd64.deb ... Adding 'diversion of /lib/x86_64-linux-gnu/libhistory.so.8 to /lib/x86_64-linux-gnu/libhistory.so.8.usr-is-merged by libreadline8t64' Adding 'diversion of /lib/x86_64-linux-gnu/libhistory.so.8.2 to /lib/x86_64-linux-gnu/libhistory.so.8.2.usr-is-merged by libreadline8t64' Adding 'diversion of /lib/x86_64-linux-gnu/libreadline.so.8 to /lib/x86_64-linux-gnu/libreadline.so.8.usr-is-merged by libreadline8t64' Adding 'diversion of /lib/x86_64-linux-gnu/libreadline.so.8.2 to /lib/x86_64-linux-gnu/libreadline.so.8.2.usr-is-merged by libreadline8t64' Unpacking libreadline8t64:amd64 (8.2-4) ... Selecting previously unselected package libpython3.11-stdlib:amd64. Preparing to unpack .../6-libpython3.11-stdlib_3.11.9-1_amd64.deb ... Unpacking libpython3.11-stdlib:amd64 (3.11.9-1) ... Selecting previously unselected package python3.11. Preparing to unpack .../7-python3.11_3.11.9-1_amd64.deb ... Unpacking python3.11 (3.11.9-1) ... Selecting previously unselected package libpython3-stdlib:amd64. Preparing to unpack .../8-libpython3-stdlib_3.11.8-1_amd64.deb ... Unpacking libpython3-stdlib:amd64 (3.11.8-1) ... Setting up python3-minimal (3.11.8-1) ... Selecting previously unselected package python3. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 21007 files and directories currently installed.) Preparing to unpack .../00-python3_3.11.8-1_amd64.deb ... Unpacking python3 (3.11.8-1) ... Selecting previously unselected package libpython3.12-minimal:amd64. Preparing to unpack .../01-libpython3.12-minimal_3.12.3-1_amd64.deb ... Unpacking libpython3.12-minimal:amd64 (3.12.3-1) ... Selecting previously unselected package python3.12-minimal. Preparing to unpack .../02-python3.12-minimal_3.12.3-1_amd64.deb ... Unpacking python3.12-minimal (3.12.3-1) ... Selecting previously unselected package sensible-utils. Preparing to unpack .../03-sensible-utils_0.0.22_all.deb ... Unpacking sensible-utils (0.0.22) ... Selecting previously unselected package openssl. Preparing to unpack .../04-openssl_3.2.1-3_amd64.deb ... Unpacking openssl (3.2.1-3) ... Selecting previously unselected package ca-certificates. Preparing to unpack .../05-ca-certificates_20240203_all.deb ... Unpacking ca-certificates (20240203) ... Selecting previously unselected package libmagic-mgc. Preparing to unpack .../06-libmagic-mgc_1%3a5.45-3_amd64.deb ... Unpacking libmagic-mgc (1:5.45-3) ... Selecting previously unselected package libmagic1t64:amd64. Preparing to unpack .../07-libmagic1t64_1%3a5.45-3_amd64.deb ... Unpacking libmagic1t64:amd64 (1:5.45-3) ... Selecting previously unselected package file. Preparing to unpack .../08-file_1%3a5.45-3_amd64.deb ... Unpacking file (1:5.45-3) ... Selecting previously unselected package gettext-base. Preparing to unpack .../09-gettext-base_0.21-14+b1_amd64.deb ... Unpacking gettext-base (0.21-14+b1) ... Selecting previously unselected package libuchardet0:amd64. Preparing to unpack .../10-libuchardet0_0.0.8-1+b1_amd64.deb ... Unpacking libuchardet0:amd64 (0.0.8-1+b1) ... Selecting previously unselected package groff-base. Preparing to unpack .../11-groff-base_1.23.0-4_amd64.deb ... Unpacking groff-base (1.23.0-4) ... Selecting previously unselected package bsdextrautils. Preparing to unpack .../12-bsdextrautils_2.40-8_amd64.deb ... Unpacking bsdextrautils (2.40-8) ... Selecting previously unselected package libpipeline1:amd64. Preparing to unpack .../13-libpipeline1_1.5.7-2_amd64.deb ... Unpacking libpipeline1:amd64 (1.5.7-2) ... Selecting previously unselected package man-db. Preparing to unpack .../14-man-db_2.12.1-1_amd64.deb ... Unpacking man-db (2.12.1-1) ... Selecting previously unselected package m4. Preparing to unpack .../15-m4_1.4.19-4_amd64.deb ... Unpacking m4 (1.4.19-4) ... Selecting previously unselected package autoconf. Preparing to unpack .../16-autoconf_2.71-3_all.deb ... Unpacking autoconf (2.71-3) ... Selecting previously unselected package autotools-dev. Preparing to unpack .../17-autotools-dev_20220109.1_all.deb ... Unpacking autotools-dev (20220109.1) ... Selecting previously unselected package automake. Preparing to unpack .../18-automake_1%3a1.16.5-1.3_all.deb ... Unpacking automake (1:1.16.5-1.3) ... Selecting previously unselected package autopoint. Preparing to unpack .../19-autopoint_0.21-14_all.deb ... Unpacking autopoint (0.21-14) ... Selecting previously unselected package libdebhelper-perl. Preparing to unpack .../20-libdebhelper-perl_13.15.3_all.deb ... Unpacking libdebhelper-perl (13.15.3) ... Selecting previously unselected package libtool. Preparing to unpack .../21-libtool_2.4.7-7_all.deb ... Unpacking libtool (2.4.7-7) ... Selecting previously unselected package dh-autoreconf. Preparing to unpack .../22-dh-autoreconf_20_all.deb ... Unpacking dh-autoreconf (20) ... Selecting previously unselected package libarchive-zip-perl. Preparing to unpack .../23-libarchive-zip-perl_1.68-1_all.deb ... Unpacking libarchive-zip-perl (1.68-1) ... Selecting previously unselected package libsub-override-perl. Preparing to unpack .../24-libsub-override-perl_0.10-1_all.deb ... Unpacking libsub-override-perl (0.10-1) ... Selecting previously unselected package libfile-stripnondeterminism-perl. Preparing to unpack .../25-libfile-stripnondeterminism-perl_1.13.1-1_all.deb ... Unpacking libfile-stripnondeterminism-perl (1.13.1-1) ... Selecting previously unselected package dh-strip-nondeterminism. Preparing to unpack .../26-dh-strip-nondeterminism_1.13.1-1_all.deb ... Unpacking dh-strip-nondeterminism (1.13.1-1) ... Selecting previously unselected package libelf1t64:amd64. Preparing to unpack .../27-libelf1t64_0.191-1+b1_amd64.deb ... Unpacking libelf1t64:amd64 (0.191-1+b1) ... Selecting previously unselected package dwz. Preparing to unpack .../28-dwz_0.15-1+b1_amd64.deb ... Unpacking dwz (0.15-1+b1) ... Selecting previously unselected package libicu72:amd64. Preparing to unpack .../29-libicu72_72.1-4+b1_amd64.deb ... Unpacking libicu72:amd64 (72.1-4+b1) ... Selecting previously unselected package libxml2:amd64. Preparing to unpack .../30-libxml2_2.9.14+dfsg-1.3+b3_amd64.deb ... Unpacking libxml2:amd64 (2.9.14+dfsg-1.3+b3) ... Selecting previously unselected package gettext. Preparing to unpack .../31-gettext_0.21-14+b1_amd64.deb ... Unpacking gettext (0.21-14+b1) ... Selecting previously unselected package intltool-debian. Preparing to unpack .../32-intltool-debian_0.35.0+20060710.6_all.deb ... Unpacking intltool-debian (0.35.0+20060710.6) ... Selecting previously unselected package po-debconf. Preparing to unpack .../33-po-debconf_1.0.21+nmu1_all.deb ... Unpacking po-debconf (1.0.21+nmu1) ... Selecting previously unselected package debhelper. Preparing to unpack .../34-debhelper_13.15.3_all.deb ... Unpacking debhelper (13.15.3) ... Selecting previously unselected package python3-pkg-resources. Preparing to unpack .../35-python3-pkg-resources_68.1.2-2_all.deb ... Unpacking python3-pkg-resources (68.1.2-2) ... Selecting previously unselected package python3-lib2to3. Preparing to unpack .../36-python3-lib2to3_3.12.3-1_all.deb ... Unpacking python3-lib2to3 (3.12.3-1) ... Selecting previously unselected package python3-distutils. Preparing to unpack .../37-python3-distutils_3.12.3-1_all.deb ... Unpacking python3-distutils (3.12.3-1) ... Selecting previously unselected package python3-setuptools. Preparing to unpack .../38-python3-setuptools_68.1.2-2_all.deb ... Unpacking python3-setuptools (68.1.2-2) ... Selecting previously unselected package dh-python. Preparing to unpack .../39-dh-python_6.20240422_all.deb ... Unpacking dh-python (6.20240422) ... Selecting previously unselected package libpython3.12-stdlib:amd64. Preparing to unpack .../40-libpython3.12-stdlib_3.12.3-1_amd64.deb ... Unpacking libpython3.12-stdlib:amd64 (3.12.3-1) ... Selecting previously unselected package python3-packaging. Preparing to unpack .../41-python3-packaging_24.0-1_all.deb ... Unpacking python3-packaging (24.0-1) ... Selecting previously unselected package python3-pyproject-hooks. Preparing to unpack .../42-python3-pyproject-hooks_1.0.0-2_all.deb ... Unpacking python3-pyproject-hooks (1.0.0-2) ... Selecting previously unselected package python3-toml. Preparing to unpack .../43-python3-toml_0.10.2-1_all.deb ... Unpacking python3-toml (0.10.2-1) ... Selecting previously unselected package python3-wheel. Preparing to unpack .../44-python3-wheel_0.43.0-1_all.deb ... Unpacking python3-wheel (0.43.0-1) ... Selecting previously unselected package python3-build. Preparing to unpack .../45-python3-build_1.2.1-1_all.deb ... Unpacking python3-build (1.2.1-1) ... Selecting previously unselected package python3-installer. Preparing to unpack .../46-python3-installer_0.7.0+dfsg1-3_all.deb ... Unpacking python3-installer (0.7.0+dfsg1-3) ... Selecting previously unselected package pybuild-plugin-pyproject. Preparing to unpack .../47-pybuild-plugin-pyproject_6.20240422_all.deb ... Unpacking pybuild-plugin-pyproject (6.20240422) ... Selecting previously unselected package python3.12. Preparing to unpack .../48-python3.12_3.12.3-1_amd64.deb ... Unpacking python3.12 (3.12.3-1) ... Selecting previously unselected package python3-all. Preparing to unpack .../49-python3-all_3.11.8-1_amd64.deb ... Unpacking python3-all (3.11.8-1) ... Selecting previously unselected package python3-brotli. Preparing to unpack .../50-python3-brotli_1.1.0-2+b3_amd64.deb ... Unpacking python3-brotli (1.1.0-2+b3) ... Selecting previously unselected package python3-cffi-backend:amd64. Preparing to unpack .../51-python3-cffi-backend_1.16.0-2+b2_amd64.deb ... Unpacking python3-cffi-backend:amd64 (1.16.0-2+b2) ... Selecting previously unselected package python3-coverage. Preparing to unpack .../52-python3-coverage_7.2.7+dfsg1-1+b1_amd64.deb ... Unpacking python3-coverage (7.2.7+dfsg1-1+b1) ... Selecting previously unselected package python3-cryptography. Preparing to unpack .../53-python3-cryptography_42.0.5-2_amd64.deb ... Unpacking python3-cryptography (42.0.5-2) ... Selecting previously unselected package python3-pathspec. Preparing to unpack .../54-python3-pathspec_0.12.1-1_all.deb ... Unpacking python3-pathspec (0.12.1-1) ... Selecting previously unselected package python3-pluggy. Preparing to unpack .../55-python3-pluggy_1.5.0-1_all.deb ... Unpacking python3-pluggy (1.5.0-1) ... Selecting previously unselected package python3-trove-classifiers. Preparing to unpack .../56-python3-trove-classifiers_2024.1.31-1_all.deb ... Unpacking python3-trove-classifiers (2024.1.31-1) ... Selecting previously unselected package python3-hatchling. Preparing to unpack .../57-python3-hatchling_1.24.2-1_all.deb ... Unpacking python3-hatchling (1.24.2-1) ... Selecting previously unselected package python3-idna. Preparing to unpack .../58-python3-idna_3.6-2_all.deb ... Unpacking python3-idna (3.6-2) ... Selecting previously unselected package python3-iniconfig. Preparing to unpack .../59-python3-iniconfig_1.1.1-2_all.deb ... Unpacking python3-iniconfig (1.1.1-2) ... Selecting previously unselected package python3-mock. Preparing to unpack .../60-python3-mock_5.1.0-1_all.deb ... Unpacking python3-mock (5.1.0-1) ... Selecting previously unselected package python3-openssl. Preparing to unpack .../61-python3-openssl_24.1.0-1_all.deb ... Unpacking python3-openssl (24.1.0-1) ... Selecting previously unselected package python3-pytest. Preparing to unpack .../62-python3-pytest_8.1.2-1_all.deb ... Unpacking python3-pytest (8.1.2-1) ... Selecting previously unselected package python3-pytest-timeout. Preparing to unpack .../63-python3-pytest-timeout_2.3.1-1_all.deb ... Unpacking python3-pytest-timeout (2.3.1-1) ... Selecting previously unselected package python3-socks. Preparing to unpack .../64-python3-socks_1.7.1+dfsg-1_all.deb ... Unpacking python3-socks (1.7.1+dfsg-1) ... Selecting previously unselected package python3-tornado. Preparing to unpack .../65-python3-tornado_6.4.0-1_amd64.deb ... Unpacking python3-tornado (6.4.0-1) ... Selecting previously unselected package python3-trustme. Preparing to unpack .../66-python3-trustme_0.9.0-1.1_all.deb ... Unpacking python3-trustme (0.9.0-1.1) ... Setting up media-types (10.1.0) ... Setting up libpipeline1:amd64 (1.5.7-2) ... Setting up libicu72:amd64 (72.1-4+b1) ... Setting up bsdextrautils (2.40-8) ... Setting up libmagic-mgc (1:5.45-3) ... Setting up libarchive-zip-perl (1.68-1) ... Setting up libdebhelper-perl (13.15.3) ... Setting up libmagic1t64:amd64 (1:5.45-3) ... Setting up libpython3.12-minimal:amd64 (3.12.3-1) ... Setting up gettext-base (0.21-14+b1) ... Setting up m4 (1.4.19-4) ... Setting up file (1:5.45-3) ... Setting up libelf1t64:amd64 (0.191-1+b1) ... Setting up tzdata (2024a-4) ... Current default time zone: 'Etc/UTC' Local time is now: Mon Jun 16 12:33:01 UTC 2025. Universal Time is now: Mon Jun 16 12:33:01 UTC 2025. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up autotools-dev (20220109.1) ... Setting up autopoint (0.21-14) ... Setting up autoconf (2.71-3) ... Setting up dwz (0.15-1+b1) ... Setting up sensible-utils (0.0.22) ... Setting up libuchardet0:amd64 (0.0.8-1+b1) ... Setting up libsub-override-perl (0.10-1) ... Setting up netbase (6.4) ... Setting up openssl (3.2.1-3) ... Setting up readline-common (8.2-4) ... Setting up libxml2:amd64 (2.9.14+dfsg-1.3+b3) ... Setting up automake (1:1.16.5-1.3) ... update-alternatives: using /usr/bin/automake-1.16 to provide /usr/bin/automake (automake) in auto mode Setting up libfile-stripnondeterminism-perl (1.13.1-1) ... Setting up python3.12-minimal (3.12.3-1) ... Setting up gettext (0.21-14+b1) ... Setting up libtool (2.4.7-7) ... Setting up intltool-debian (0.35.0+20060710.6) ... Setting up dh-autoreconf (20) ... Setting up ca-certificates (20240203) ... Updating certificates in /etc/ssl/certs... 146 added, 0 removed; done. Setting up libreadline8t64:amd64 (8.2-4) ... Setting up dh-strip-nondeterminism (1.13.1-1) ... Setting up groff-base (1.23.0-4) ... Setting up libpython3.12-stdlib:amd64 (3.12.3-1) ... Setting up po-debconf (1.0.21+nmu1) ... Setting up libpython3.11-stdlib:amd64 (3.11.9-1) ... Setting up python3.12 (3.12.3-1) ... Setting up man-db (2.12.1-1) ... Not building database; man-db/auto-update is not 'true'. Setting up libpython3-stdlib:amd64 (3.11.8-1) ... Setting up python3.11 (3.11.9-1) ... Setting up debhelper (13.15.3) ... Setting up python3 (3.11.8-1) ... Setting up python3-wheel (0.43.0-1) ... Setting up python3-mock (5.1.0-1) ... Setting up python3-packaging (24.0-1) ... Setting up python3-pyproject-hooks (1.0.0-2) ... Setting up python3-brotli (1.1.0-2+b3) ... Setting up python3-idna (3.6-2) ... Setting up python3-toml (0.10.2-1) ... Setting up python3-installer (0.7.0+dfsg1-3) ... Setting up python3-pluggy (1.5.0-1) ... Setting up python3-trove-classifiers (2024.1.31-1) ... Setting up python3-build (1.2.1-1) ... Setting up python3-pathspec (0.12.1-1) ... Setting up python3-lib2to3 (3.12.3-1) ... Setting up python3-cffi-backend:amd64 (1.16.0-2+b2) ... Setting up python3-pkg-resources (68.1.2-2) ... Setting up python3-distutils (3.12.3-1) ... python3.12: can't get files for byte-compilation Setting up python3-iniconfig (1.1.1-2) ... Setting up python3-tornado (6.4.0-1) ... Setting up python3-setuptools (68.1.2-2) ... Setting up python3-socks (1.7.1+dfsg-1) ... Setting up python3-pytest (8.1.2-1) ... Setting up python3-all (3.11.8-1) ... Setting up python3-coverage (7.2.7+dfsg1-1+b1) ... Setting up python3-cryptography (42.0.5-2) ... Setting up python3-hatchling (1.24.2-1) ... Setting up dh-python (6.20240422) ... Setting up python3-pytest-timeout (2.3.1-1) ... Setting up pybuild-plugin-pyproject (6.20240422) ... Setting up python3-openssl (24.1.0-1) ... Setting up python3-trustme (0.9.0-1.1) ... Processing triggers for libc-bin (2.38-11) ... Processing triggers for ca-certificates (20240203) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. Reading package lists... Building dependency tree... Reading state information... Reading extended state information... Initializing package states... Writing extended state information... Building tag database... -> Finished parsing the build-deps I: Building the package I: Running cd /build/reproducible-path/python-urllib3-2.0.7/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../python-urllib3_2.0.7-1_source.changes dpkg-buildpackage: info: source package python-urllib3 dpkg-buildpackage: info: source version 2.0.7-1 dpkg-buildpackage: info: source distribution experimental dpkg-buildpackage: info: source changed by Daniele Tricoli dpkg-source --before-build . dpkg-buildpackage: info: host architecture amd64 debian/rules clean dh clean --with python3 --buildsystem=pybuild dh_auto_clean -O--buildsystem=pybuild dh_autoreconf_clean -O--buildsystem=pybuild debian/rules override_dh_clean make[1]: Entering directory '/build/reproducible-path/python-urllib3-2.0.7' dh_clean find . -type d -name .pytest_cache -exec rm -rf {} + make[1]: Leaving directory '/build/reproducible-path/python-urllib3-2.0.7' debian/rules binary dh binary --with python3 --buildsystem=pybuild dh_update_autotools_config -O--buildsystem=pybuild dh_autoreconf -O--buildsystem=pybuild dh_auto_configure -O--buildsystem=pybuild dh_auto_build -O--buildsystem=pybuild I: pybuild plugin_pyproject:129: Building wheel for python3.12 with "build" module I: pybuild base:311: python3.12 -m build --skip-dependency-check --no-isolation --wheel --outdir /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3 * Building wheel... Successfully built urllib3-2.0.7-py3-none-any.whl I: pybuild plugin_pyproject:144: Unpacking wheel built for python3.12 with "installer" module I: pybuild plugin_pyproject:129: Building wheel for python3.11 with "build" module I: pybuild base:311: python3.11 -m build --skip-dependency-check --no-isolation --wheel --outdir /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3 * Building wheel... Successfully built urllib3-2.0.7-py3-none-any.whl I: pybuild plugin_pyproject:144: Unpacking wheel built for python3.11 with "installer" module dh_auto_test -O--buildsystem=pybuild I: pybuild base:311: cd /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build; python3.12 -m pytest -k "not requires_network" ============================= test session starts ============================== platform linux -- Python 3.12.3, pytest-8.1.2, pluggy-1.5.0 rootdir: /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build configfile: pyproject.toml plugins: timeout-2.3.1 collected 2307 items / 44 deselected / 2263 selected test/contrib/test_pyopenssl.py ......................................... [ 1%] .................ssssssssssssss.sssssssss..ssssss...sssssssssss.s.ssssss [ 4%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 8%] ssssssssssssssssssss.s........................................s......s.. [ 11%] ................................s.....s....s.........................F.. [ 14%] .....sss.... [ 15%] test/contrib/test_pyopenssl_dependencies.py .. [ 15%] test/contrib/test_securetransport.py sssssssssssssssssssssssssssssssssss [ 16%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 19%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 23%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 26%] sss [ 26%] test/contrib/test_socks.py ................... [ 27%] test/test_collections.py ............................................. [ 29%] test/test_compatibility.py . [ 29%] test/test_connection.py .....................F....... [ 30%] test/test_connectionpool.py ............................................ [ 32%] .............................. [ 33%] test/test_exceptions.py .............. [ 34%] test/test_fields.py .................... [ 35%] test/test_filepost.py ......... [ 35%] test/test_no_ssl.py .. [ 35%] test/test_poolmanager.py s.................................... [ 37%] test/test_proxymanager.py ...... [ 37%] test/test_queue_monkeypatch.py . [ 37%] test/test_response.py ..........................sssssss................. [ 39%] .......................................... [ 41%] test/test_retry.py ..................................................... [ 44%] ........ [ 44%] test/test_ssl.py .................................. [ 46%] test/test_ssltransport.py ................. [ 46%] test/test_util.py ...................................................... [ 49%] ........................................................................ [ 52%] ........................................................................ [ 55%] .........................................s.ss..s.ss..................... [ 58%] .................................................................. [ 61%] test/test_wait.py ............. [ 62%] test/with_dummyserver/test_chunked_transfer.py ................. [ 62%] test/with_dummyserver/test_connection.py ........ [ 63%] test/with_dummyserver/test_connectionpool.py ........................... [ 64%] ........................................................................ [ 67%] ........................................................................ [ 70%] ........................................................................ [ 74%] ........................................................................ [ 77%] .................................................... [ 79%] test/with_dummyserver/test_https.py ssssssssssssss.sssssssss..ssssss...s [ 81%] ssssssssss.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 84%] ssssssssssssssssssssssssssssssssssss.s.................................. [ 87%] .............s..................................s..........s..s..s.....s [ 90%] s...ss [ 90%] test/with_dummyserver/test_no_ssl.py .. [ 90%] test/with_dummyserver/test_poolmanager.py .............................. [ 92%] ................s [ 93%] test/with_dummyserver/test_proxy_poolmanager.py ....s................... [ 94%] ..s....s..s...... [ 94%] test/with_dummyserver/test_socketlevel.py .............................. [ 96%] ..FFF.......sss......s......................................s.s.s....... [ 99%] .............. [100%] =================================== FAILURES =================================== ______________ TestSocketSSL.test_ssl_failure_midway_through_conn ______________ self = args = (,), kwargs = {} def recv_into(self, *args: typing.Any, **kwargs: typing.Any) -> int: try: > return self.connection.recv_into(*args, **kwargs) # type: ignore[no-any-return] urllib3/contrib/pyopenssl.py:326: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/OpenSSL/SSL.py:2099: in recv_into self._raise_ssl_error(self._ssl, result) /usr/lib/python3/dist-packages/OpenSSL/SSL.py:1834: in _raise_ssl_error _openssl_assert( /usr/lib/python3/dist-packages/OpenSSL/_util.py:71: in openssl_assert exception_from_error_queue(error) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ exception_type = def exception_from_error_queue(exception_type: Type[Exception]) -> NoReturn: """ Convert an OpenSSL library failure into a Python exception. When a call to the native OpenSSL library fails, this is usually signalled by the return value, and an error code is stored in an error queue associated with the current thread. The err library provides functions to obtain these error codes and textual error messages. """ errors = [] while True: error = lib.ERR_get_error() if error == 0: break errors.append( ( text(lib.ERR_lib_error_string(error)), text(lib.ERR_func_error_string(error)), text(lib.ERR_reason_error_string(error)), ) ) > raise exception_type(errors) E OpenSSL.SSL.Error: [('SSL routines', '', 'packet length too long'), ('SSL routines', '', 'record layer failure')] /usr/lib/python3/dist-packages/OpenSSL/_util.py:57: Error The above exception was the direct cause of the following exception: self = method = 'GET', url = '/', body = None, headers = {} retries = Retry(total=False, connect=None, read=None, redirect=0, status=None) redirect = True, assert_same_host = True, timeout = <_TYPE_DEFAULT.token: -1> pool_timeout = None, release_conn = True, chunked = False, body_pos = None preload_content = True, decode_content = True, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) urllib3/connectionpool.py:791: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/connectionpool.py:537: in _make_request response = conn.getresponse() urllib3/connection.py:461: in getresponse httplib_response = super().getresponse() /usr/lib/python3.12/http/client.py:1428: in getresponse response.begin() /usr/lib/python3.12/http/client.py:331: in begin version, status, reason = self._read_status() /usr/lib/python3.12/http/client.py:292: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") /usr/lib/python3.12/socket.py:707: in readinto return self._sock.recv_into(b) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = (,), kwargs = {} def recv_into(self, *args: typing.Any, **kwargs: typing.Any) -> int: try: return self.connection.recv_into(*args, **kwargs) # type: ignore[no-any-return] except OpenSSL.SSL.SysCallError as e: if self.suppress_ragged_eofs and e.args == (-1, "Unexpected EOF"): return 0 else: raise OSError(e.args[0], str(e)) from e except OpenSSL.SSL.ZeroReturnError: if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN: return 0 else: raise except OpenSSL.SSL.WantReadError as e: if not util.wait_for_read(self.socket, self.socket.gettimeout()): raise timeout("The read operation timed out") from e else: return self.recv_into(*args, **kwargs) # TLS 1.3 post-handshake authentication except OpenSSL.SSL.Error as e: > raise ssl.SSLError(f"read error: {e!r}") from e E ssl.SSLError: ("read error: Error([('SSL routines', '', 'packet length too long'), ('SSL routines', '', 'record layer failure')])",) urllib3/contrib/pyopenssl.py:345: SSLError During handling of the above exception, another exception occurred: self = def test_ssl_failure_midway_through_conn(self) -> None: def socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock2 = sock.dup() ssl_sock = original_ssl_wrap_socket( sock, server_side=True, keyfile=DEFAULT_CERTS["keyfile"], certfile=DEFAULT_CERTS["certfile"], ca_certs=DEFAULT_CA, ) buf = b"" while not buf.endswith(b"\r\n\r\n"): buf += ssl_sock.recv(65536) # Deliberately send from the non-SSL socket. sock2.send( b"HTTP/1.1 200 OK\r\n" b"Content-Type: text/plain\r\n" b"Content-Length: 2\r\n" b"\r\n" b"Hi" ) sock2.close() ssl_sock.close() self._start_server(socket_handler) with HTTPSConnectionPool(self.host, self.port, ca_certs=DEFAULT_CA) as pool: with pytest.raises( SSLError, match=r"(wrong version number|record overflow)" ): > pool.request("GET", "/", retries=False) test/with_dummyserver/test_socketlevel.py:1316: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/_request_methods.py:110: in request return self.request_encode_url( urllib3/_request_methods.py:143: in request_encode_url return self.urlopen(method, url, **extra_kw) urllib3/connectionpool.py:845: in urlopen retries = retries.increment( urllib3/util/retry.py:445: in increment raise reraise(type(error), error, _stacktrace) urllib3/util/util.py:38: in reraise raise value.with_traceback(tb) urllib3/connectionpool.py:791: in urlopen response = self._make_request( urllib3/connectionpool.py:537: in _make_request response = conn.getresponse() urllib3/connection.py:461: in getresponse httplib_response = super().getresponse() /usr/lib/python3.12/http/client.py:1428: in getresponse response.begin() /usr/lib/python3.12/http/client.py:331: in begin version, status, reason = self._read_status() /usr/lib/python3.12/http/client.py:292: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") /usr/lib/python3.12/socket.py:707: in readinto return self._sock.recv_into(b) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = (,), kwargs = {} def recv_into(self, *args: typing.Any, **kwargs: typing.Any) -> int: try: return self.connection.recv_into(*args, **kwargs) # type: ignore[no-any-return] except OpenSSL.SSL.SysCallError as e: if self.suppress_ragged_eofs and e.args == (-1, "Unexpected EOF"): return 0 else: raise OSError(e.args[0], str(e)) from e except OpenSSL.SSL.ZeroReturnError: if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN: return 0 else: raise except OpenSSL.SSL.WantReadError as e: if not util.wait_for_read(self.socket, self.socket.gettimeout()): raise timeout("The read operation timed out") from e else: return self.recv_into(*args, **kwargs) # TLS 1.3 post-handshake authentication except OpenSSL.SSL.Error as e: > raise ssl.SSLError(f"read error: {e!r}") from e E urllib3.exceptions.SSLError: ("read error: Error([('SSL routines', '', 'packet length too long'), ('SSL routines', '', 'record layer failure')])",) urllib3/contrib/pyopenssl.py:345: SSLError During handling of the above exception, another exception occurred: self = def test_ssl_failure_midway_through_conn(self) -> None: def socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock2 = sock.dup() ssl_sock = original_ssl_wrap_socket( sock, server_side=True, keyfile=DEFAULT_CERTS["keyfile"], certfile=DEFAULT_CERTS["certfile"], ca_certs=DEFAULT_CA, ) buf = b"" while not buf.endswith(b"\r\n\r\n"): buf += ssl_sock.recv(65536) # Deliberately send from the non-SSL socket. sock2.send( b"HTTP/1.1 200 OK\r\n" b"Content-Type: text/plain\r\n" b"Content-Length: 2\r\n" b"\r\n" b"Hi" ) sock2.close() ssl_sock.close() self._start_server(socket_handler) with HTTPSConnectionPool(self.host, self.port, ca_certs=DEFAULT_CA) as pool: > with pytest.raises( SSLError, match=r"(wrong version number|record overflow)" ): E AssertionError: Regex pattern did not match. E Regex: '(wrong version number|record overflow)' E Input: '("read error: Error([(\'SSL routines\', \'\', \'packet length too long\'), (\'SSL routines\', \'\', \'record layer failure\')])",)' test/with_dummyserver/test_socketlevel.py:1313: AssertionError ------------------------------ Captured log call ------------------------------- DEBUG urllib3.util.retry:retry.py:282 Converted retries value: False -> Retry(total=False, connect=None, read=None, redirect=0, status=None) DEBUG urllib3.connectionpool:connectionpool.py:1053 Starting new HTTPS connection (1): localhost:41709 _______________________ TestConnection.test_recent_date ________________________ self = def test_recent_date(self) -> None: # This test is to make sure that the RECENT_DATE value # doesn't get too far behind what the current date is. # When this test fails update urllib3.connection.RECENT_DATE # according to the rules defined in that file. two_years = datetime.timedelta(days=365 * 2) > assert RECENT_DATE > (datetime.datetime.today() - two_years).date() E AssertionError: assert datetime.date(2022, 1, 1) > datetime.date(2023, 6, 17) E + where datetime.date(2023, 6, 17) = () E + where = (datetime.datetime(2025, 6, 16, 0, 33, 32, 850245) - datetime.timedelta(days=730)).date E + where datetime.datetime(2025, 6, 16, 0, 33, 32, 850245) = () E + where = .today E + where = datetime.datetime test/test_connection.py:206: AssertionError ____ TestProxyManager.test_https_proxymanager_connected_to_http_proxy[http] ____ self = target_scheme = 'http' @pytest.mark.parametrize("target_scheme", ["http", "https"]) def test_https_proxymanager_connected_to_http_proxy( self, target_scheme: str ) -> None: errored = Event() def http_socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock.send(b"HTTP/1.0 501 Not Implemented\r\nConnection: close\r\n\r\n") errored.wait() sock.close() self._start_server(http_socket_handler) base_url = f"https://{self.host}:{self.port}" with ProxyManager(base_url, cert_reqs="NONE") as proxy: with pytest.raises(MaxRetryError) as e: proxy.request("GET", f"{target_scheme}://example.com", retries=0) errored.set() # Avoid a ConnectionAbortedError on Windows. assert type(e.value.reason) == ProxyError > assert "Your proxy appears to only use HTTP and not HTTPS" in str( e.value.reason ) E assert 'Your proxy appears to only use HTTP and not HTTPS' in "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))" E + where "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))" = str(ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))) E + where ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))) = MaxRetryError("HTTPSConnectionPool(host='localhost', port=42103): Max retries exceeded with url: http://example.com (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))))").reason E + where MaxRetryError("HTTPSConnectionPool(host='localhost', port=42103): Max retries exceeded with url: http://example.com (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))))") = .value test/with_dummyserver/test_socketlevel.py:1278: AssertionError ___ TestProxyManager.test_https_proxymanager_connected_to_http_proxy[https] ____ self = target_scheme = 'https' @pytest.mark.parametrize("target_scheme", ["http", "https"]) def test_https_proxymanager_connected_to_http_proxy( self, target_scheme: str ) -> None: errored = Event() def http_socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock.send(b"HTTP/1.0 501 Not Implemented\r\nConnection: close\r\n\r\n") errored.wait() sock.close() self._start_server(http_socket_handler) base_url = f"https://{self.host}:{self.port}" with ProxyManager(base_url, cert_reqs="NONE") as proxy: with pytest.raises(MaxRetryError) as e: proxy.request("GET", f"{target_scheme}://example.com", retries=0) errored.set() # Avoid a ConnectionAbortedError on Windows. assert type(e.value.reason) == ProxyError > assert "Your proxy appears to only use HTTP and not HTTPS" in str( e.value.reason ) E assert 'Your proxy appears to only use HTTP and not HTTPS' in "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))" E + where "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))" = str(ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))) E + where ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))) = MaxRetryError("HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))))").reason E + where MaxRetryError("HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))))") = .value test/with_dummyserver/test_socketlevel.py:1278: AssertionError _________________ TestSSL.test_ssl_failure_midway_through_conn _________________ self = method = 'GET', url = '/', body = None, headers = {} retries = Retry(total=False, connect=None, read=None, redirect=0, status=None) redirect = True, assert_same_host = True, timeout = <_TYPE_DEFAULT.token: -1> pool_timeout = None, release_conn = True, chunked = False, body_pos = None preload_content = True, decode_content = True, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) urllib3/connectionpool.py:791: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/connectionpool.py:537: in _make_request response = conn.getresponse() urllib3/connection.py:461: in getresponse httplib_response = super().getresponse() /usr/lib/python3.12/http/client.py:1428: in getresponse response.begin() /usr/lib/python3.12/http/client.py:331: in begin version, status, reason = self._read_status() /usr/lib/python3.12/http/client.py:292: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") /usr/lib/python3.12/socket.py:707: in readinto return self._sock.recv_into(b) /usr/lib/python3.12/ssl.py:1252: in recv_into return self.read(nbytes, buffer) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , len = 8192 buffer = def read(self, len=1024, buffer=None): """Read up to LEN bytes and return them. Return zero-length string on EOF.""" self._checkClosed() if self._sslobj is None: raise ValueError("Read on closed or unwrapped SSL socket.") try: if buffer is not None: > return self._sslobj.read(len, buffer) E ssl.SSLError: [SSL] record layer failure (_ssl.c:2559) /usr/lib/python3.12/ssl.py:1104: SSLError During handling of the above exception, another exception occurred: self = def test_ssl_failure_midway_through_conn(self) -> None: def socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock2 = sock.dup() ssl_sock = original_ssl_wrap_socket( sock, server_side=True, keyfile=DEFAULT_CERTS["keyfile"], certfile=DEFAULT_CERTS["certfile"], ca_certs=DEFAULT_CA, ) buf = b"" while not buf.endswith(b"\r\n\r\n"): buf += ssl_sock.recv(65536) # Deliberately send from the non-SSL socket. sock2.send( b"HTTP/1.1 200 OK\r\n" b"Content-Type: text/plain\r\n" b"Content-Length: 2\r\n" b"\r\n" b"Hi" ) sock2.close() ssl_sock.close() self._start_server(socket_handler) with HTTPSConnectionPool(self.host, self.port, ca_certs=DEFAULT_CA) as pool: with pytest.raises( SSLError, match=r"(wrong version number|record overflow)" ): > pool.request("GET", "/", retries=False) test/with_dummyserver/test_socketlevel.py:1316: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/_request_methods.py:110: in request return self.request_encode_url( urllib3/_request_methods.py:143: in request_encode_url return self.urlopen(method, url, **extra_kw) urllib3/connectionpool.py:845: in urlopen retries = retries.increment( urllib3/util/retry.py:445: in increment raise reraise(type(error), error, _stacktrace) urllib3/util/util.py:38: in reraise raise value.with_traceback(tb) urllib3/connectionpool.py:791: in urlopen response = self._make_request( urllib3/connectionpool.py:537: in _make_request response = conn.getresponse() urllib3/connection.py:461: in getresponse httplib_response = super().getresponse() /usr/lib/python3.12/http/client.py:1428: in getresponse response.begin() /usr/lib/python3.12/http/client.py:331: in begin version, status, reason = self._read_status() /usr/lib/python3.12/http/client.py:292: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") /usr/lib/python3.12/socket.py:707: in readinto return self._sock.recv_into(b) /usr/lib/python3.12/ssl.py:1252: in recv_into return self.read(nbytes, buffer) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , len = 8192 buffer = def read(self, len=1024, buffer=None): """Read up to LEN bytes and return them. Return zero-length string on EOF.""" self._checkClosed() if self._sslobj is None: raise ValueError("Read on closed or unwrapped SSL socket.") try: if buffer is not None: > return self._sslobj.read(len, buffer) E urllib3.exceptions.SSLError: [SSL] record layer failure (_ssl.c:2559) /usr/lib/python3.12/ssl.py:1104: SSLError During handling of the above exception, another exception occurred: self = def test_ssl_failure_midway_through_conn(self) -> None: def socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock2 = sock.dup() ssl_sock = original_ssl_wrap_socket( sock, server_side=True, keyfile=DEFAULT_CERTS["keyfile"], certfile=DEFAULT_CERTS["certfile"], ca_certs=DEFAULT_CA, ) buf = b"" while not buf.endswith(b"\r\n\r\n"): buf += ssl_sock.recv(65536) # Deliberately send from the non-SSL socket. sock2.send( b"HTTP/1.1 200 OK\r\n" b"Content-Type: text/plain\r\n" b"Content-Length: 2\r\n" b"\r\n" b"Hi" ) sock2.close() ssl_sock.close() self._start_server(socket_handler) with HTTPSConnectionPool(self.host, self.port, ca_certs=DEFAULT_CA) as pool: > with pytest.raises( SSLError, match=r"(wrong version number|record overflow)" ): E AssertionError: Regex pattern did not match. E Regex: '(wrong version number|record overflow)' E Input: '[SSL] record layer failure (_ssl.c:2559)' test/with_dummyserver/test_socketlevel.py:1313: AssertionError =============================== warnings summary =============================== test/contrib/test_pyopenssl.py: 4 warnings test/with_dummyserver/test_https.py: 14 warnings test/with_dummyserver/test_no_ssl.py: 1 warning test/with_dummyserver/test_proxy_poolmanager.py: 13 warnings /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/dummyserver/server.py:173: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated ctx = ssl.SSLContext(ssl_version) test/contrib/test_pyopenssl.py::TestHTTPS::test_alpn_default test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_2::test_alpn_default test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_3::test_alpn_default test/with_dummyserver/test_https.py::TestHTTPS::test_alpn_default test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_2::test_alpn_default test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_3::test_alpn_default test/with_dummyserver/test_socketlevel.py::TestALPN::test_alpn_protocol_in_first_request_packet /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/__init__.py:97: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated ctx = ctx_cls(protocol=ssl_.PROTOCOL_TLS) # type: ignore[misc, attr-defined] test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1::test_simple test/with_dummyserver/test_https.py::TestHTTPS_TLSv1::test_simple /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/dummyserver/server.py:173: DeprecationWarning: ssl.PROTOCOL_TLSv1 is deprecated ctx = ssl.SSLContext(ssl_version) test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_1::test_simple test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_1::test_simple /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/dummyserver/server.py:173: DeprecationWarning: ssl.PROTOCOL_TLSv1_1 is deprecated ctx = ssl.SSLContext(ssl_version) test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_2::test_simple test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_2::test_simple /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/dummyserver/server.py:173: DeprecationWarning: ssl.PROTOCOL_TLSv1_2 is deprecated ctx = ssl.SSLContext(ssl_version) test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_2::test_server_hostname /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_3::test_server_hostname /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/contrib/test_pyopenssl.py: 29 warnings test/contrib/test_socks.py: 17 warnings test/test_ssltransport.py: 12 warnings test/with_dummyserver/test_chunked_transfer.py: 17 warnings test/with_dummyserver/test_connectionpool.py: 5 warnings test/with_dummyserver/test_socketlevel.py: 108 warnings /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/dummyserver/server.py:133: NoIPv6Warning: No IPv6 support. Falling back to IPv4. warnings.warn("No IPv6 support. Falling back to IPv4.", NoIPv6Warning) test/contrib/test_pyopenssl.py: 14 warnings test/with_dummyserver/test_socketlevel.py: 16 warnings /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_socketlevel.py:160: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated context = ssl.SSLContext(ssl_version) test/contrib/test_socks.py::TestSOCKSWithTLS::test_basic_request /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/contrib/test_socks.py:747: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated context = better_ssl.SSLContext(ssl.PROTOCOL_SSLv23) # type: ignore[misc] test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs0] test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs1] test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs2] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/urllib3/util/ssl_.py:290: DeprecationWarning: ssl.TLSVersion.TLSv1 is deprecated context.minimum_version = ssl_minimum_version test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs0] test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs1] test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs2] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/urllib3/util/ssl_.py:295: DeprecationWarning: ssl.TLSVersion.TLSv1 is deprecated context.maximum_version = ssl_maximum_version test/test_ssltransport.py::SingleTLSLayerTestCase::test_unwrap_existing_socket /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/test_ssltransport.py::SingleTLSLayerTestCase::test_unwrap_existing_socket /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/dummyserver/server.py:146: ResourceWarning: unclosed self.socket_handler(sock) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/test_ssltransport.py::SingleTLSLayerTestCase::test_ssl_object_attributes /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/urllib3/util/ssltransport.py:198: DeprecationWarning: ssl NPN is deprecated, use ALPN instead return self.sslobj.selected_npn_protocol() test/with_dummyserver/test_connection.py::test_returns_urllib3_HTTPResponse /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connection.py::test_does_not_release_conn /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connection.py::test_double_getresponse /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPoolTimeouts::test_conn_closed /usr/lib/python3/dist-packages/pluggy/_callers.py:73: ResourceWarning: unclosed args = [caller_kwargs[argname] for argname in hook_impl.argnames] Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_source_address /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_connectionpool.py:784: NoIPv6Warning: No IPv6 support: skipping. warnings.warn("No IPv6 support: skipping.", NoIPv6Warning) test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[dict-False-True] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_connectionpool.py:1072: ResourceWarning: unclosed conn = pool._get_conn() Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[dict-False-True] /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[dict-False-False] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_connectionpool.py:1072: ResourceWarning: unclosed conn = pool._get_conn() Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[dict-False-False] /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[HTTPHeaderDict-False-True] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_connectionpool.py:1072: ResourceWarning: unclosed conn = pool._get_conn() Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[HTTPHeaderDict-False-True] /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[HTTPHeaderDict-False-False] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_connectionpool.py:1072: ResourceWarning: unclosed conn = pool._get_conn() Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[HTTPHeaderDict-False-False] /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_request_chunked_is_deprecated /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_2::test_server_hostname /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_3::test_server_hostname /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_client_cert_with_string_password test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_client_cert_with_bytes_password /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_socketlevel.py:370: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated ssl_context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23) test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_load_keyfile_with_invalid_password /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_socketlevel.py:390: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23) test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_load_invalid_cert_file /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_socketlevel.py:403: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23) test/with_dummyserver/test_socketlevel.py::TestSSL::test_ssl_dont_load_default_certs_when_given /usr/lib/python3.12/unittest/mock.py:2188: ResourceWarning: unclosed def __init__(self, name, parent): Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED test/contrib/test_pyopenssl.py::TestSocketSSL::test_ssl_failure_midway_through_conn - AssertionError: Regex pattern did not match. Regex: '(wrong version number|record overflow)' Input: '("read error: Error([(\'SSL routines\', \'\', \'packet length too long\'), (\'SSL routines\', \'\', \'record layer failure\')])",)' FAILED test/test_connection.py::TestConnection::test_recent_date - AssertionError: assert datetime.date(2022, 1, 1) > datetime.date(2023, 6, 17) + where datetime.date(2023, 6, 17) = () + where = (datetime.datetime(2025, 6, 16, 0, 33, 32, 850245) - datetime.timedelta(days=730)).date + where datetime.datetime(2025, 6, 16, 0, 33, 32, 850245) = () + where = .today + where = datetime.datetime FAILED test/with_dummyserver/test_socketlevel.py::TestProxyManager::test_https_proxymanager_connected_to_http_proxy[http] - assert 'Your proxy appears to only use HTTP and not HTTPS' in "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))" + where "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))" = str(ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))) + where ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))) = MaxRetryError("HTTPSConnectionPool(host='localhost', port=42103): Max retries exceeded with url: http://example.com (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))))").reason + where MaxRetryError("HTTPSConnectionPool(host='localhost', port=42103): Max retries exceeded with url: http://example.com (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))))") = .value FAILED test/with_dummyserver/test_socketlevel.py::TestProxyManager::test_https_proxymanager_connected_to_http_proxy[https] - assert 'Your proxy appears to only use HTTP and not HTTPS' in "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))" + where "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))" = str(ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)')))) + where ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))) = MaxRetryError("HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))))").reason + where MaxRetryError("HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1000)'))))") = .value FAILED test/with_dummyserver/test_socketlevel.py::TestSSL::test_ssl_failure_midway_through_conn - AssertionError: Regex pattern did not match. Regex: '(wrong version number|record overflow)' Input: '[SSL] record layer failure (_ssl.c:2559)' = 5 failed, 1683 passed, 575 skipped, 44 deselected, 296 warnings in 131.40s (0:02:11) = sys:1: ResourceWarning: unclosed ResourceWarning: Enable tracemalloc to get the object allocation traceback sys:1: ResourceWarning: unclosed ResourceWarning: Enable tracemalloc to get the object allocation traceback sys:1: ResourceWarning: unclosed ResourceWarning: Enable tracemalloc to get the object allocation traceback sys:1: ResourceWarning: unclosed ResourceWarning: Enable tracemalloc to get the object allocation traceback E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.12_urllib3/build; python3.12 -m pytest -k "not requires_network" I: pybuild base:311: cd /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build; python3.11 -m pytest -k "not requires_network" ============================= test session starts ============================== platform linux -- Python 3.11.9, pytest-8.1.2, pluggy-1.5.0 rootdir: /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build configfile: pyproject.toml plugins: timeout-2.3.1 collected 2307 items / 44 deselected / 2263 selected test/contrib/test_pyopenssl.py ......................................... [ 1%] .................ssssssssssssss.sssssssss..ssssss...sssssssssss.s.ssssss [ 4%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 8%] ssssssssssssssssssss.s........................................s......s.. [ 11%] ................................s.....s....s.........................F.. [ 14%] .....sss.... [ 15%] test/contrib/test_pyopenssl_dependencies.py .. [ 15%] test/contrib/test_securetransport.py sssssssssssssssssssssssssssssssssss [ 16%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 19%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 23%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 26%] sss [ 26%] test/contrib/test_socks.py ................... [ 27%] test/test_collections.py ............................................. [ 29%] test/test_compatibility.py . [ 29%] test/test_connection.py .....................F....... [ 30%] test/test_connectionpool.py ............................................ [ 32%] .............................. [ 33%] test/test_exceptions.py .............. [ 34%] test/test_fields.py .................... [ 35%] test/test_filepost.py ......... [ 35%] test/test_no_ssl.py .. [ 35%] test/test_poolmanager.py s.................................... [ 37%] test/test_proxymanager.py ...... [ 37%] test/test_queue_monkeypatch.py . [ 37%] test/test_response.py ..........................sssssss................. [ 39%] .......................................... [ 41%] test/test_retry.py ..................................................... [ 44%] ........ [ 44%] test/test_ssl.py .................................. [ 46%] test/test_ssltransport.py ................. [ 46%] test/test_util.py ...................................................... [ 49%] ........................................................................ [ 52%] ........................................................................ [ 55%] .........................................s.ss..s.ss..................... [ 58%] .................................................................. [ 61%] test/test_wait.py ............. [ 62%] test/with_dummyserver/test_chunked_transfer.py ................. [ 62%] test/with_dummyserver/test_connection.py ........ [ 63%] test/with_dummyserver/test_connectionpool.py ........................... [ 64%] ........................................................................ [ 67%] ........................................................................ [ 70%] ........................................................................ [ 74%] ........................................................................ [ 77%] .................................................... [ 79%] test/with_dummyserver/test_https.py ssssssssssssss.sssssssss..ssssss...s [ 81%] ssssssssss.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 84%] ssssssssssssssssssssssssssssssssssss.s.................................. [ 87%] .............s..................................s..........s..s..s.....s [ 90%] s...ss [ 90%] test/with_dummyserver/test_no_ssl.py .. [ 90%] test/with_dummyserver/test_poolmanager.py .............................. [ 92%] ................s [ 93%] test/with_dummyserver/test_proxy_poolmanager.py ....s................... [ 94%] ..s....s..s...... [ 94%] test/with_dummyserver/test_socketlevel.py .............................. [ 96%] ..FFF.......sss......s......................................s.s.s....... [ 99%] .....F.F...... [100%] =================================== FAILURES =================================== ______________ TestSocketSSL.test_ssl_failure_midway_through_conn ______________ self = args = (,), kwargs = {} def recv_into(self, *args: typing.Any, **kwargs: typing.Any) -> int: try: > return self.connection.recv_into(*args, **kwargs) # type: ignore[no-any-return] urllib3/contrib/pyopenssl.py:326: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/OpenSSL/SSL.py:2099: in recv_into self._raise_ssl_error(self._ssl, result) /usr/lib/python3/dist-packages/OpenSSL/SSL.py:1834: in _raise_ssl_error _openssl_assert( /usr/lib/python3/dist-packages/OpenSSL/_util.py:71: in openssl_assert exception_from_error_queue(error) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ exception_type = def exception_from_error_queue(exception_type: Type[Exception]) -> NoReturn: """ Convert an OpenSSL library failure into a Python exception. When a call to the native OpenSSL library fails, this is usually signalled by the return value, and an error code is stored in an error queue associated with the current thread. The err library provides functions to obtain these error codes and textual error messages. """ errors = [] while True: error = lib.ERR_get_error() if error == 0: break errors.append( ( text(lib.ERR_lib_error_string(error)), text(lib.ERR_func_error_string(error)), text(lib.ERR_reason_error_string(error)), ) ) > raise exception_type(errors) E OpenSSL.SSL.Error: [('SSL routines', '', 'packet length too long'), ('SSL routines', '', 'record layer failure')] /usr/lib/python3/dist-packages/OpenSSL/_util.py:57: Error The above exception was the direct cause of the following exception: self = method = 'GET', url = '/', body = None, headers = {} retries = Retry(total=False, connect=None, read=None, redirect=0, status=None) redirect = True, assert_same_host = True, timeout = <_TYPE_DEFAULT.token: -1> pool_timeout = None, release_conn = True, chunked = False, body_pos = None preload_content = True, decode_content = True, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) urllib3/connectionpool.py:791: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/connectionpool.py:537: in _make_request response = conn.getresponse() urllib3/connection.py:461: in getresponse httplib_response = super().getresponse() /usr/lib/python3.11/http/client.py:1395: in getresponse response.begin() /usr/lib/python3.11/http/client.py:325: in begin version, status, reason = self._read_status() /usr/lib/python3.11/http/client.py:286: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") /usr/lib/python3.11/socket.py:706: in readinto return self._sock.recv_into(b) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = (,), kwargs = {} def recv_into(self, *args: typing.Any, **kwargs: typing.Any) -> int: try: return self.connection.recv_into(*args, **kwargs) # type: ignore[no-any-return] except OpenSSL.SSL.SysCallError as e: if self.suppress_ragged_eofs and e.args == (-1, "Unexpected EOF"): return 0 else: raise OSError(e.args[0], str(e)) from e except OpenSSL.SSL.ZeroReturnError: if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN: return 0 else: raise except OpenSSL.SSL.WantReadError as e: if not util.wait_for_read(self.socket, self.socket.gettimeout()): raise timeout("The read operation timed out") from e else: return self.recv_into(*args, **kwargs) # TLS 1.3 post-handshake authentication except OpenSSL.SSL.Error as e: > raise ssl.SSLError(f"read error: {e!r}") from e E ssl.SSLError: ("read error: Error([('SSL routines', '', 'packet length too long'), ('SSL routines', '', 'record layer failure')])",) urllib3/contrib/pyopenssl.py:345: SSLError During handling of the above exception, another exception occurred: self = def test_ssl_failure_midway_through_conn(self) -> None: def socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock2 = sock.dup() ssl_sock = original_ssl_wrap_socket( sock, server_side=True, keyfile=DEFAULT_CERTS["keyfile"], certfile=DEFAULT_CERTS["certfile"], ca_certs=DEFAULT_CA, ) buf = b"" while not buf.endswith(b"\r\n\r\n"): buf += ssl_sock.recv(65536) # Deliberately send from the non-SSL socket. sock2.send( b"HTTP/1.1 200 OK\r\n" b"Content-Type: text/plain\r\n" b"Content-Length: 2\r\n" b"\r\n" b"Hi" ) sock2.close() ssl_sock.close() self._start_server(socket_handler) with HTTPSConnectionPool(self.host, self.port, ca_certs=DEFAULT_CA) as pool: with pytest.raises( SSLError, match=r"(wrong version number|record overflow)" ): > pool.request("GET", "/", retries=False) test/with_dummyserver/test_socketlevel.py:1316: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/_request_methods.py:110: in request return self.request_encode_url( urllib3/_request_methods.py:143: in request_encode_url return self.urlopen(method, url, **extra_kw) urllib3/connectionpool.py:845: in urlopen retries = retries.increment( urllib3/util/retry.py:445: in increment raise reraise(type(error), error, _stacktrace) urllib3/util/util.py:38: in reraise raise value.with_traceback(tb) urllib3/connectionpool.py:791: in urlopen response = self._make_request( urllib3/connectionpool.py:537: in _make_request response = conn.getresponse() urllib3/connection.py:461: in getresponse httplib_response = super().getresponse() /usr/lib/python3.11/http/client.py:1395: in getresponse response.begin() /usr/lib/python3.11/http/client.py:325: in begin version, status, reason = self._read_status() /usr/lib/python3.11/http/client.py:286: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") /usr/lib/python3.11/socket.py:706: in readinto return self._sock.recv_into(b) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = (,), kwargs = {} def recv_into(self, *args: typing.Any, **kwargs: typing.Any) -> int: try: return self.connection.recv_into(*args, **kwargs) # type: ignore[no-any-return] except OpenSSL.SSL.SysCallError as e: if self.suppress_ragged_eofs and e.args == (-1, "Unexpected EOF"): return 0 else: raise OSError(e.args[0], str(e)) from e except OpenSSL.SSL.ZeroReturnError: if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN: return 0 else: raise except OpenSSL.SSL.WantReadError as e: if not util.wait_for_read(self.socket, self.socket.gettimeout()): raise timeout("The read operation timed out") from e else: return self.recv_into(*args, **kwargs) # TLS 1.3 post-handshake authentication except OpenSSL.SSL.Error as e: > raise ssl.SSLError(f"read error: {e!r}") from e E urllib3.exceptions.SSLError: ("read error: Error([('SSL routines', '', 'packet length too long'), ('SSL routines', '', 'record layer failure')])",) urllib3/contrib/pyopenssl.py:345: SSLError During handling of the above exception, another exception occurred: self = def test_ssl_failure_midway_through_conn(self) -> None: def socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock2 = sock.dup() ssl_sock = original_ssl_wrap_socket( sock, server_side=True, keyfile=DEFAULT_CERTS["keyfile"], certfile=DEFAULT_CERTS["certfile"], ca_certs=DEFAULT_CA, ) buf = b"" while not buf.endswith(b"\r\n\r\n"): buf += ssl_sock.recv(65536) # Deliberately send from the non-SSL socket. sock2.send( b"HTTP/1.1 200 OK\r\n" b"Content-Type: text/plain\r\n" b"Content-Length: 2\r\n" b"\r\n" b"Hi" ) sock2.close() ssl_sock.close() self._start_server(socket_handler) with HTTPSConnectionPool(self.host, self.port, ca_certs=DEFAULT_CA) as pool: > with pytest.raises( SSLError, match=r"(wrong version number|record overflow)" ): E AssertionError: Regex pattern did not match. E Regex: '(wrong version number|record overflow)' E Input: '("read error: Error([(\'SSL routines\', \'\', \'packet length too long\'), (\'SSL routines\', \'\', \'record layer failure\')])",)' test/with_dummyserver/test_socketlevel.py:1313: AssertionError ------------------------------ Captured log call ------------------------------- DEBUG urllib3.util.retry:retry.py:282 Converted retries value: False -> Retry(total=False, connect=None, read=None, redirect=0, status=None) DEBUG urllib3.connectionpool:connectionpool.py:1053 Starting new HTTPS connection (1): localhost:33483 _______________________ TestConnection.test_recent_date ________________________ self = def test_recent_date(self) -> None: # This test is to make sure that the RECENT_DATE value # doesn't get too far behind what the current date is. # When this test fails update urllib3.connection.RECENT_DATE # according to the rules defined in that file. two_years = datetime.timedelta(days=365 * 2) > assert RECENT_DATE > (datetime.datetime.today() - two_years).date() E AssertionError: assert datetime.date(2022, 1, 1) > datetime.date(2023, 6, 17) E + where datetime.date(2023, 6, 17) = () E + where = (datetime.datetime(2025, 6, 16, 0, 35, 49, 290547) - datetime.timedelta(days=730)).date E + where datetime.datetime(2025, 6, 16, 0, 35, 49, 290547) = () E + where = .today E + where = datetime.datetime test/test_connection.py:206: AssertionError ____ TestProxyManager.test_https_proxymanager_connected_to_http_proxy[http] ____ self = target_scheme = 'http' @pytest.mark.parametrize("target_scheme", ["http", "https"]) def test_https_proxymanager_connected_to_http_proxy( self, target_scheme: str ) -> None: errored = Event() def http_socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock.send(b"HTTP/1.0 501 Not Implemented\r\nConnection: close\r\n\r\n") errored.wait() sock.close() self._start_server(http_socket_handler) base_url = f"https://{self.host}:{self.port}" with ProxyManager(base_url, cert_reqs="NONE") as proxy: with pytest.raises(MaxRetryError) as e: proxy.request("GET", f"{target_scheme}://example.com", retries=0) errored.set() # Avoid a ConnectionAbortedError on Windows. assert type(e.value.reason) == ProxyError > assert "Your proxy appears to only use HTTP and not HTTPS" in str( e.value.reason ) E assert 'Your proxy appears to only use HTTP and not HTTPS' in "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))" E + where "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))" = str(ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))) E + where ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))) = MaxRetryError("HTTPSConnectionPool(host='localhost', port=45829): Max retries exceeded with url: http://example.com (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))))").reason E + where MaxRetryError("HTTPSConnectionPool(host='localhost', port=45829): Max retries exceeded with url: http://example.com (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))))") = .value test/with_dummyserver/test_socketlevel.py:1278: AssertionError ___ TestProxyManager.test_https_proxymanager_connected_to_http_proxy[https] ____ self = target_scheme = 'https' @pytest.mark.parametrize("target_scheme", ["http", "https"]) def test_https_proxymanager_connected_to_http_proxy( self, target_scheme: str ) -> None: errored = Event() def http_socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock.send(b"HTTP/1.0 501 Not Implemented\r\nConnection: close\r\n\r\n") errored.wait() sock.close() self._start_server(http_socket_handler) base_url = f"https://{self.host}:{self.port}" with ProxyManager(base_url, cert_reqs="NONE") as proxy: with pytest.raises(MaxRetryError) as e: proxy.request("GET", f"{target_scheme}://example.com", retries=0) errored.set() # Avoid a ConnectionAbortedError on Windows. assert type(e.value.reason) == ProxyError > assert "Your proxy appears to only use HTTP and not HTTPS" in str( e.value.reason ) E assert 'Your proxy appears to only use HTTP and not HTTPS' in "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))" E + where "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))" = str(ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))) E + where ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))) = MaxRetryError("HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))))").reason E + where MaxRetryError("HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))))") = .value test/with_dummyserver/test_socketlevel.py:1278: AssertionError _________________ TestSSL.test_ssl_failure_midway_through_conn _________________ self = method = 'GET', url = '/', body = None, headers = {} retries = Retry(total=False, connect=None, read=None, redirect=0, status=None) redirect = True, assert_same_host = True, timeout = <_TYPE_DEFAULT.token: -1> pool_timeout = None, release_conn = True, chunked = False, body_pos = None preload_content = True, decode_content = True, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) urllib3/connectionpool.py:791: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/connectionpool.py:537: in _make_request response = conn.getresponse() urllib3/connection.py:461: in getresponse httplib_response = super().getresponse() /usr/lib/python3.11/http/client.py:1395: in getresponse response.begin() /usr/lib/python3.11/http/client.py:325: in begin version, status, reason = self._read_status() /usr/lib/python3.11/http/client.py:286: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") /usr/lib/python3.11/socket.py:706: in readinto return self._sock.recv_into(b) /usr/lib/python3.11/ssl.py:1314: in recv_into return self.read(nbytes, buffer) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , len = 8192 buffer = def read(self, len=1024, buffer=None): """Read up to LEN bytes and return them. Return zero-length string on EOF.""" self._checkClosed() if self._sslobj is None: raise ValueError("Read on closed or unwrapped SSL socket.") try: if buffer is not None: > return self._sslobj.read(len, buffer) E ssl.SSLError: [SSL] record layer failure (_ssl.c:2580) /usr/lib/python3.11/ssl.py:1166: SSLError During handling of the above exception, another exception occurred: self = def test_ssl_failure_midway_through_conn(self) -> None: def socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock2 = sock.dup() ssl_sock = original_ssl_wrap_socket( sock, server_side=True, keyfile=DEFAULT_CERTS["keyfile"], certfile=DEFAULT_CERTS["certfile"], ca_certs=DEFAULT_CA, ) buf = b"" while not buf.endswith(b"\r\n\r\n"): buf += ssl_sock.recv(65536) # Deliberately send from the non-SSL socket. sock2.send( b"HTTP/1.1 200 OK\r\n" b"Content-Type: text/plain\r\n" b"Content-Length: 2\r\n" b"\r\n" b"Hi" ) sock2.close() ssl_sock.close() self._start_server(socket_handler) with HTTPSConnectionPool(self.host, self.port, ca_certs=DEFAULT_CA) as pool: with pytest.raises( SSLError, match=r"(wrong version number|record overflow)" ): > pool.request("GET", "/", retries=False) test/with_dummyserver/test_socketlevel.py:1316: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/_request_methods.py:110: in request return self.request_encode_url( urllib3/_request_methods.py:143: in request_encode_url return self.urlopen(method, url, **extra_kw) urllib3/connectionpool.py:845: in urlopen retries = retries.increment( urllib3/util/retry.py:445: in increment raise reraise(type(error), error, _stacktrace) urllib3/util/util.py:38: in reraise raise value.with_traceback(tb) urllib3/connectionpool.py:791: in urlopen response = self._make_request( urllib3/connectionpool.py:537: in _make_request response = conn.getresponse() urllib3/connection.py:461: in getresponse httplib_response = super().getresponse() /usr/lib/python3.11/http/client.py:1395: in getresponse response.begin() /usr/lib/python3.11/http/client.py:325: in begin version, status, reason = self._read_status() /usr/lib/python3.11/http/client.py:286: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") /usr/lib/python3.11/socket.py:706: in readinto return self._sock.recv_into(b) /usr/lib/python3.11/ssl.py:1314: in recv_into return self.read(nbytes, buffer) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , len = 8192 buffer = def read(self, len=1024, buffer=None): """Read up to LEN bytes and return them. Return zero-length string on EOF.""" self._checkClosed() if self._sslobj is None: raise ValueError("Read on closed or unwrapped SSL socket.") try: if buffer is not None: > return self._sslobj.read(len, buffer) E urllib3.exceptions.SSLError: [SSL] record layer failure (_ssl.c:2580) /usr/lib/python3.11/ssl.py:1166: SSLError During handling of the above exception, another exception occurred: self = def test_ssl_failure_midway_through_conn(self) -> None: def socket_handler(listener: socket.socket) -> None: sock = listener.accept()[0] sock2 = sock.dup() ssl_sock = original_ssl_wrap_socket( sock, server_side=True, keyfile=DEFAULT_CERTS["keyfile"], certfile=DEFAULT_CERTS["certfile"], ca_certs=DEFAULT_CA, ) buf = b"" while not buf.endswith(b"\r\n\r\n"): buf += ssl_sock.recv(65536) # Deliberately send from the non-SSL socket. sock2.send( b"HTTP/1.1 200 OK\r\n" b"Content-Type: text/plain\r\n" b"Content-Length: 2\r\n" b"\r\n" b"Hi" ) sock2.close() ssl_sock.close() self._start_server(socket_handler) with HTTPSConnectionPool(self.host, self.port, ca_certs=DEFAULT_CA) as pool: > with pytest.raises( SSLError, match=r"(wrong version number|record overflow)" ): E AssertionError: Regex pattern did not match. E Regex: '(wrong version number|record overflow)' E Input: '[SSL] record layer failure (_ssl.c:2580)' test/with_dummyserver/test_socketlevel.py:1313: AssertionError ________ TestContentFraming.test_chunked_not_specified[file_text-POST] _________ self = conn = method = 'POST', url = '/', body = <_io.StringIO object at 0x7fade5bf83a0> headers = HTTPHeaderDict({}) retries = Retry(total=False, connect=None, read=None, redirect=0, status=None) timeout = Timeout(connect=0.5, read=0.5, total=None), chunked = False response_conn = None, preload_content = True, decode_content = True enforce_content_length = True def _make_request( self, conn: BaseHTTPConnection, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | None = None, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, chunked: bool = False, response_conn: BaseHTTPConnection | None = None, preload_content: bool = True, decode_content: bool = True, enforce_content_length: bool = True, ) -> BaseHTTPResponse: """ Perform a request on a given urllib connection object taken from our pool. :param conn: a connection from one of our connection pools :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param response_conn: Set this to ``None`` if you will handle releasing the connection or set the connection to have the response release it. :param preload_content: If True, the response's body will be preloaded during construction. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param enforce_content_length: Enforce content length checking. Body returned by server must match value of Content-Length header, if present. Otherwise, raise error. """ self.num_requests += 1 timeout_obj = self._get_timeout(timeout) timeout_obj.start_connect() conn.timeout = Timeout.resolve_default_timeout(timeout_obj.connect_timeout) try: # Trigger any extra validation we need to do. try: self._validate_conn(conn) except (SocketTimeout, BaseSSLError) as e: self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) raise # _validate_conn() starts the connection to an HTTPS proxy # so we need to wrap errors with 'ProxyError' here too. except ( OSError, NewConnectionError, TimeoutError, BaseSSLError, CertificateError, SSLError, ) as e: new_e: Exception = e if isinstance(e, (BaseSSLError, CertificateError)): new_e = SSLError(e) # If the connection didn't successfully connect to it's proxy # then there if isinstance( new_e, (OSError, NewConnectionError, TimeoutError, SSLError) ) and (conn and conn.proxy and not conn.has_connected_to_proxy): new_e = _wrap_proxy_error(new_e, conn.proxy.scheme) raise new_e # conn.request() calls http.client.*.request, not the method in # urllib3.request. It also calls makefile (recv) on the socket. try: conn.request( method, url, body=body, headers=headers, chunked=chunked, preload_content=preload_content, decode_content=decode_content, enforce_content_length=enforce_content_length, ) # We are swallowing BrokenPipeError (errno.EPIPE) since the server is # legitimately able to close the connection after sending a valid response. # With this behaviour, the received response is still readable. except BrokenPipeError: pass except OSError as e: # MacOS/Linux # EPROTOTYPE is needed on macOS # https://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/ if e.errno != errno.EPROTOTYPE: raise # Reset the timeout for the recv() on the socket read_timeout = timeout_obj.read_timeout if not conn.is_closed: # In Python 3 socket.py will catch EAGAIN and return None when you # try and read into the file pointer created by http.client, which # instead raises a BadStatusLine exception. Instead of catching # the exception and assuming all BadStatusLine exceptions are read # timeouts, check for a zero timeout before making the request. if read_timeout == 0: raise ReadTimeoutError( self, url, f"Read timed out. (read timeout={read_timeout})" ) conn.timeout = read_timeout # Receive the response from the server try: > response = conn.getresponse() urllib3/connectionpool.py:537: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/connection.py:461: in getresponse httplib_response = super().getresponse() /usr/lib/python3.11/http/client.py:1395: in getresponse response.begin() /usr/lib/python3.11/http/client.py:325: in begin version, status, reason = self._read_status() /usr/lib/python3.11/http/client.py:286: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = b = def readinto(self, b): """Read up to len(b) bytes into the writable buffer *b* and return the number of bytes read. If the socket is non-blocking and no bytes are available, None is returned. If *b* is non-empty, a 0 return value indicates that the connection was shutdown at the other end. """ self._checkClosed() self._checkReadable() if self._timeout_occurred: raise OSError("cannot read from timed out object") while True: try: > return self._sock.recv_into(b) E TimeoutError: timed out /usr/lib/python3.11/socket.py:706: TimeoutError The above exception was the direct cause of the following exception: self = method = 'POST', body_type = 'file_text' @pytest.mark.parametrize("method", ["POST", "PUT", "PATCH"]) @pytest.mark.parametrize( "body_type", ["file", "generator", "bytes", "bytearray", "file_text"] ) def test_chunked_not_specified(self, method: str, body_type: str) -> None: buffer = bytearray() def socket_handler(listener: socket.socket) -> None: nonlocal buffer sock = listener.accept()[0] sock.settimeout(0) start = time.time() while time.time() - start < (LONG_TIMEOUT / 2): try: buffer += sock.recv(65536) except OSError: continue sock.sendall( b"HTTP/1.1 200 OK\r\n" b"Server: example.com\r\n" b"Content-Length: 0\r\n\r\n" ) sock.close() self._start_server(socket_handler) body: typing.Any if body_type == "generator": def body_generator() -> typing.Generator[bytes, None, None]: yield b"x" * 10 body = body_generator() should_be_chunked = True elif body_type == "file": body = io.BytesIO(b"x" * 10) body.seek(0, 0) should_be_chunked = True elif body_type == "file_text": body = io.StringIO("x" * 10) body.seek(0, 0) should_be_chunked = True elif body_type == "bytearray": body = bytearray(b"x" * 10) should_be_chunked = False else: body = b"x" * 10 should_be_chunked = False with HTTPConnectionPool( self.host, self.port, timeout=LONG_TIMEOUT, retries=False ) as pool: > resp = pool.request(method, "/", body=body) test/with_dummyserver/test_socketlevel.py:2372: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/_request_methods.py:118: in request return self.request_encode_body( urllib3/_request_methods.py:217: in request_encode_body return self.urlopen(method, url, **extra_kw) urllib3/connectionpool.py:845: in urlopen retries = retries.increment( urllib3/util/retry.py:445: in increment raise reraise(type(error), error, _stacktrace) urllib3/util/util.py:39: in reraise raise value urllib3/connectionpool.py:791: in urlopen response = self._make_request( urllib3/connectionpool.py:539: in _make_request self._raise_timeout(err=e, url=url, timeout_value=read_timeout) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = err = TimeoutError('timed out'), url = '/', timeout_value = 0.5 def _raise_timeout( self, err: BaseSSLError | OSError | SocketTimeout, url: str, timeout_value: _TYPE_TIMEOUT | None, ) -> None: """Is the error actually a timeout? Will raise a ReadTimeout or pass""" if isinstance(err, SocketTimeout): > raise ReadTimeoutError( self, url, f"Read timed out. (read timeout={timeout_value})" ) from err E urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=45909): Read timed out. (read timeout=0.5) urllib3/connectionpool.py:371: ReadTimeoutError ________ TestContentFraming.test_chunked_not_specified[file_text-PATCH] ________ self = conn = method = 'PATCH', url = '/', body = <_io.StringIO object at 0x7fade5bf8280> headers = HTTPHeaderDict({}) retries = Retry(total=False, connect=None, read=None, redirect=0, status=None) timeout = Timeout(connect=0.5, read=0.5, total=None), chunked = False response_conn = None, preload_content = True, decode_content = True enforce_content_length = True def _make_request( self, conn: BaseHTTPConnection, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | None = None, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, chunked: bool = False, response_conn: BaseHTTPConnection | None = None, preload_content: bool = True, decode_content: bool = True, enforce_content_length: bool = True, ) -> BaseHTTPResponse: """ Perform a request on a given urllib connection object taken from our pool. :param conn: a connection from one of our connection pools :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param response_conn: Set this to ``None`` if you will handle releasing the connection or set the connection to have the response release it. :param preload_content: If True, the response's body will be preloaded during construction. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param enforce_content_length: Enforce content length checking. Body returned by server must match value of Content-Length header, if present. Otherwise, raise error. """ self.num_requests += 1 timeout_obj = self._get_timeout(timeout) timeout_obj.start_connect() conn.timeout = Timeout.resolve_default_timeout(timeout_obj.connect_timeout) try: # Trigger any extra validation we need to do. try: self._validate_conn(conn) except (SocketTimeout, BaseSSLError) as e: self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) raise # _validate_conn() starts the connection to an HTTPS proxy # so we need to wrap errors with 'ProxyError' here too. except ( OSError, NewConnectionError, TimeoutError, BaseSSLError, CertificateError, SSLError, ) as e: new_e: Exception = e if isinstance(e, (BaseSSLError, CertificateError)): new_e = SSLError(e) # If the connection didn't successfully connect to it's proxy # then there if isinstance( new_e, (OSError, NewConnectionError, TimeoutError, SSLError) ) and (conn and conn.proxy and not conn.has_connected_to_proxy): new_e = _wrap_proxy_error(new_e, conn.proxy.scheme) raise new_e # conn.request() calls http.client.*.request, not the method in # urllib3.request. It also calls makefile (recv) on the socket. try: conn.request( method, url, body=body, headers=headers, chunked=chunked, preload_content=preload_content, decode_content=decode_content, enforce_content_length=enforce_content_length, ) # We are swallowing BrokenPipeError (errno.EPIPE) since the server is # legitimately able to close the connection after sending a valid response. # With this behaviour, the received response is still readable. except BrokenPipeError: pass except OSError as e: # MacOS/Linux # EPROTOTYPE is needed on macOS # https://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/ if e.errno != errno.EPROTOTYPE: raise # Reset the timeout for the recv() on the socket read_timeout = timeout_obj.read_timeout if not conn.is_closed: # In Python 3 socket.py will catch EAGAIN and return None when you # try and read into the file pointer created by http.client, which # instead raises a BadStatusLine exception. Instead of catching # the exception and assuming all BadStatusLine exceptions are read # timeouts, check for a zero timeout before making the request. if read_timeout == 0: raise ReadTimeoutError( self, url, f"Read timed out. (read timeout={read_timeout})" ) conn.timeout = read_timeout # Receive the response from the server try: > response = conn.getresponse() urllib3/connectionpool.py:537: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/connection.py:461: in getresponse httplib_response = super().getresponse() /usr/lib/python3.11/http/client.py:1395: in getresponse response.begin() /usr/lib/python3.11/http/client.py:325: in begin version, status, reason = self._read_status() /usr/lib/python3.11/http/client.py:286: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = b = def readinto(self, b): """Read up to len(b) bytes into the writable buffer *b* and return the number of bytes read. If the socket is non-blocking and no bytes are available, None is returned. If *b* is non-empty, a 0 return value indicates that the connection was shutdown at the other end. """ self._checkClosed() self._checkReadable() if self._timeout_occurred: raise OSError("cannot read from timed out object") while True: try: > return self._sock.recv_into(b) E TimeoutError: timed out /usr/lib/python3.11/socket.py:706: TimeoutError The above exception was the direct cause of the following exception: self = method = 'PATCH', body_type = 'file_text' @pytest.mark.parametrize("method", ["POST", "PUT", "PATCH"]) @pytest.mark.parametrize( "body_type", ["file", "generator", "bytes", "bytearray", "file_text"] ) def test_chunked_not_specified(self, method: str, body_type: str) -> None: buffer = bytearray() def socket_handler(listener: socket.socket) -> None: nonlocal buffer sock = listener.accept()[0] sock.settimeout(0) start = time.time() while time.time() - start < (LONG_TIMEOUT / 2): try: buffer += sock.recv(65536) except OSError: continue sock.sendall( b"HTTP/1.1 200 OK\r\n" b"Server: example.com\r\n" b"Content-Length: 0\r\n\r\n" ) sock.close() self._start_server(socket_handler) body: typing.Any if body_type == "generator": def body_generator() -> typing.Generator[bytes, None, None]: yield b"x" * 10 body = body_generator() should_be_chunked = True elif body_type == "file": body = io.BytesIO(b"x" * 10) body.seek(0, 0) should_be_chunked = True elif body_type == "file_text": body = io.StringIO("x" * 10) body.seek(0, 0) should_be_chunked = True elif body_type == "bytearray": body = bytearray(b"x" * 10) should_be_chunked = False else: body = b"x" * 10 should_be_chunked = False with HTTPConnectionPool( self.host, self.port, timeout=LONG_TIMEOUT, retries=False ) as pool: > resp = pool.request(method, "/", body=body) test/with_dummyserver/test_socketlevel.py:2372: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ urllib3/_request_methods.py:118: in request return self.request_encode_body( urllib3/_request_methods.py:217: in request_encode_body return self.urlopen(method, url, **extra_kw) urllib3/connectionpool.py:845: in urlopen retries = retries.increment( urllib3/util/retry.py:445: in increment raise reraise(type(error), error, _stacktrace) urllib3/util/util.py:39: in reraise raise value urllib3/connectionpool.py:791: in urlopen response = self._make_request( urllib3/connectionpool.py:539: in _make_request self._raise_timeout(err=e, url=url, timeout_value=read_timeout) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = err = TimeoutError('timed out'), url = '/', timeout_value = 0.5 def _raise_timeout( self, err: BaseSSLError | OSError | SocketTimeout, url: str, timeout_value: _TYPE_TIMEOUT | None, ) -> None: """Is the error actually a timeout? Will raise a ReadTimeout or pass""" if isinstance(err, SocketTimeout): > raise ReadTimeoutError( self, url, f"Read timed out. (read timeout={timeout_value})" ) from err E urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=40221): Read timed out. (read timeout=0.5) urllib3/connectionpool.py:371: ReadTimeoutError =============================== warnings summary =============================== test/contrib/test_pyopenssl.py: 4 warnings test/with_dummyserver/test_https.py: 14 warnings test/with_dummyserver/test_no_ssl.py: 1 warning test/with_dummyserver/test_proxy_poolmanager.py: 13 warnings /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/dummyserver/server.py:173: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated ctx = ssl.SSLContext(ssl_version) test/contrib/test_pyopenssl.py::TestHTTPS::test_alpn_default test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_2::test_alpn_default test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_3::test_alpn_default test/with_dummyserver/test_https.py::TestHTTPS::test_alpn_default test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_2::test_alpn_default test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_3::test_alpn_default test/with_dummyserver/test_socketlevel.py::TestALPN::test_alpn_protocol_in_first_request_packet /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/__init__.py:97: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated ctx = ctx_cls(protocol=ssl_.PROTOCOL_TLS) # type: ignore[misc, attr-defined] test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1::test_simple test/with_dummyserver/test_https.py::TestHTTPS_TLSv1::test_simple /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/dummyserver/server.py:173: DeprecationWarning: ssl.PROTOCOL_TLSv1 is deprecated ctx = ssl.SSLContext(ssl_version) test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_1::test_simple test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_1::test_simple /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/dummyserver/server.py:173: DeprecationWarning: ssl.PROTOCOL_TLSv1_1 is deprecated ctx = ssl.SSLContext(ssl_version) test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_2::test_simple test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_2::test_simple /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/dummyserver/server.py:173: DeprecationWarning: ssl.PROTOCOL_TLSv1_2 is deprecated ctx = ssl.SSLContext(ssl_version) test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_2::test_server_hostname /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_3::test_server_hostname /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/contrib/test_pyopenssl.py: 29 warnings test/contrib/test_socks.py: 17 warnings test/test_ssltransport.py: 12 warnings test/with_dummyserver/test_chunked_transfer.py: 17 warnings test/with_dummyserver/test_connectionpool.py: 5 warnings test/with_dummyserver/test_socketlevel.py: 108 warnings /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/dummyserver/server.py:133: NoIPv6Warning: No IPv6 support. Falling back to IPv4. warnings.warn("No IPv6 support. Falling back to IPv4.", NoIPv6Warning) test/contrib/test_pyopenssl.py: 14 warnings test/with_dummyserver/test_socketlevel.py: 16 warnings /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/with_dummyserver/test_socketlevel.py:160: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated context = ssl.SSLContext(ssl_version) test/contrib/test_socks.py::TestSOCKSWithTLS::test_basic_request /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/contrib/test_socks.py:747: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated context = better_ssl.SSLContext(ssl.PROTOCOL_SSLv23) # type: ignore[misc] test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs0] test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs1] test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs2] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/urllib3/util/ssl_.py:290: DeprecationWarning: ssl.TLSVersion.TLSv1 is deprecated context.minimum_version = ssl_minimum_version test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs0] test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs1] test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs2] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/urllib3/util/ssl_.py:295: DeprecationWarning: ssl.TLSVersion.TLSv1 is deprecated context.maximum_version = ssl_maximum_version test/test_ssltransport.py::SingleTLSLayerTestCase::test_unwrap_existing_socket /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/test_ssltransport.py::SingleTLSLayerTestCase::test_unwrap_existing_socket /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/dummyserver/server.py:146: ResourceWarning: unclosed self.socket_handler(sock) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/test_ssltransport.py::SingleTLSLayerTestCase::test_ssl_object_attributes /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/urllib3/util/ssltransport.py:198: DeprecationWarning: ssl NPN is deprecated, use ALPN instead return self.sslobj.selected_npn_protocol() test/with_dummyserver/test_connection.py::test_returns_urllib3_HTTPResponse /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connection.py::test_does_not_release_conn /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connection.py::test_double_getresponse /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_source_address /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/with_dummyserver/test_connectionpool.py:784: NoIPv6Warning: No IPv6 support: skipping. warnings.warn("No IPv6 support: skipping.", NoIPv6Warning) test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_skip_header[True-User-Agent0-host0-Accept-Encoding1] /usr/lib/python3.11/asyncio/selector_events.py:256: ResourceWarning: unclosed transport = self._transports[fileno] Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[dict-False-True] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/with_dummyserver/test_connectionpool.py:1072: ResourceWarning: unclosed conn = pool._get_conn() Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[dict-False-True] /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[dict-False-False] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/with_dummyserver/test_connectionpool.py:1072: ResourceWarning: unclosed conn = pool._get_conn() Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[dict-False-False] /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[HTTPHeaderDict-False-True] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/with_dummyserver/test_connectionpool.py:1072: ResourceWarning: unclosed conn = pool._get_conn() Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[HTTPHeaderDict-False-True] /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[HTTPHeaderDict-False-False] /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/with_dummyserver/test_connectionpool.py:1072: ResourceWarning: unclosed conn = pool._get_conn() Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_headers_not_modified_by_request[HTTPHeaderDict-False-False] /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_request_chunked_is_deprecated /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_2::test_server_hostname /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_3::test_server_hostname /usr/lib/python3/dist-packages/_pytest/python.py:195: ResourceWarning: unclosed result = testfunction(**testargs) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_client_cert_with_string_password test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_client_cert_with_bytes_password /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/with_dummyserver/test_socketlevel.py:370: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated ssl_context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23) test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_load_keyfile_with_invalid_password /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/with_dummyserver/test_socketlevel.py:390: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23) test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_load_invalid_cert_file /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build/test/with_dummyserver/test_socketlevel.py:403: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23) test/with_dummyserver/test_socketlevel.py::TestSSL::test_ssl_dont_load_default_certs_when_given /usr/lib/python3.11/unittest/mock.py:2133: ResourceWarning: unclosed setattr(_type, entry, MagicProxy(entry, self)) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED test/contrib/test_pyopenssl.py::TestSocketSSL::test_ssl_failure_midway_through_conn - AssertionError: Regex pattern did not match. Regex: '(wrong version number|record overflow)' Input: '("read error: Error([(\'SSL routines\', \'\', \'packet length too long\'), (\'SSL routines\', \'\', \'record layer failure\')])",)' FAILED test/test_connection.py::TestConnection::test_recent_date - AssertionError: assert datetime.date(2022, 1, 1) > datetime.date(2023, 6, 17) + where datetime.date(2023, 6, 17) = () + where = (datetime.datetime(2025, 6, 16, 0, 35, 49, 290547) - datetime.timedelta(days=730)).date + where datetime.datetime(2025, 6, 16, 0, 35, 49, 290547) = () + where = .today + where = datetime.datetime FAILED test/with_dummyserver/test_socketlevel.py::TestProxyManager::test_https_proxymanager_connected_to_http_proxy[http] - assert 'Your proxy appears to only use HTTP and not HTTPS' in "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))" + where "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))" = str(ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))) + where ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))) = MaxRetryError("HTTPSConnectionPool(host='localhost', port=45829): Max retries exceeded with url: http://example.com (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))))").reason + where MaxRetryError("HTTPSConnectionPool(host='localhost', port=45829): Max retries exceeded with url: http://example.com (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))))") = .value FAILED test/with_dummyserver/test_socketlevel.py::TestProxyManager::test_https_proxymanager_connected_to_http_proxy[https] - assert 'Your proxy appears to only use HTTP and not HTTPS' in "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))" + where "('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))" = str(ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)')))) + where ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))) = MaxRetryError("HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))))").reason + where MaxRetryError("HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLError(1, '[SSL] record layer failure (_ssl.c:1006)'))))") = .value FAILED test/with_dummyserver/test_socketlevel.py::TestSSL::test_ssl_failure_midway_through_conn - AssertionError: Regex pattern did not match. Regex: '(wrong version number|record overflow)' Input: '[SSL] record layer failure (_ssl.c:2580)' FAILED test/with_dummyserver/test_socketlevel.py::TestContentFraming::test_chunked_not_specified[file_text-POST] - urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=45909): Read timed out. (read timeout=0.5) FAILED test/with_dummyserver/test_socketlevel.py::TestContentFraming::test_chunked_not_specified[file_text-PATCH] - urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=40221): Read timed out. (read timeout=0.5) = 7 failed, 1681 passed, 575 skipped, 44 deselected, 296 warnings in 129.49s (0:02:09) = E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /build/reproducible-path/python-urllib3-2.0.7/.pybuild/cpython3_3.11_urllib3/build; python3.11 -m pytest -k "not requires_network" dh_auto_test: error: pybuild --test -i python{version} -p "3.12 3.11" returned exit code 13 make: *** [debian/rules:11: binary] Error 25 dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2 I: copying local configuration E: Failed autobuilding of package I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env I: removing directory /srv/workspace/pbuilder/3012803 and its subdirectories Tue May 14 06:14:49 UTC 2024 W: No second build log, what happened?