0s autopkgtest [18:24:45]: starting date and time: 2024-11-09 18:24:45+0000 0s autopkgtest [18:24:45]: git checkout: 0acbae0a WIP show VirtSubproc stderr in real-time 0s autopkgtest [18:24:45]: host juju-7f2275-prod-proposed-migration-environment-2; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.sgl5icmy/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:tiktoken --apt-upgrade tiktoken --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=tiktoken/0.8.0-1 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest-ppc64el --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-2@bos03-ppc64el-10.secgroup --name adt-plucky-ppc64el-tiktoken-20241109-173317-juju-7f2275-prod-proposed-migration-environment-2-2d7e4713-bca7-4cc9-853a-6fc8981dec9a --image adt/ubuntu-plucky-ppc64el-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-2 --net-id=net_prod-proposed-migration-ppc64el -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 76s autopkgtest [18:26:01]: testbed dpkg architecture: ppc64el 76s autopkgtest [18:26:01]: testbed apt version: 2.9.8 76s autopkgtest [18:26:01]: @@@@@@@@@@@@@@@@@@@@ test bed setup 77s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [73.9 kB] 77s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [977 kB] 78s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [102 kB] 78s Get:4 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [15.3 kB] 78s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [7016 B] 78s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/main ppc64el Packages [124 kB] 78s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/universe ppc64el Packages [693 kB] 78s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse ppc64el Packages [19.6 kB] 78s Fetched 2012 kB in 1s (2194 kB/s) 78s Reading package lists... 81s Reading package lists... 81s Building dependency tree... 81s Reading state information... 81s Calculating upgrade... 81s The following NEW packages will be installed: 81s systemd-cryptsetup 81s The following packages will be upgraded: 81s base-passwd bash-completion libattr1 libblockdev-crypto3 libblockdev-fs3 81s libblockdev-loop3 libblockdev-mdraid3 libblockdev-nvme3 libblockdev-part3 81s libblockdev-swap3 libblockdev-utils3 libblockdev3 libbpf1 libbsd0 81s libbytesize-common libbytesize1 libdrm-common libdrm2 libjson-glib-1.0-0 81s libjson-glib-1.0-common libmaxminddb0 libmnl0 libnghttp2-14 libnspr4 81s libnss-systemd libpam-systemd libpython3.12-minimal libpython3.12-stdlib 81s libpython3.12t64 libsystemd-shared libsystemd0 libudev1 libudisks2-0 81s liburcu8t64 libuv1t64 libx11-6 libx11-data linux-firmware openssh-client 81s openssh-server openssh-sftp-server pci.ids python3-gi python3-idna 81s python3-jsonpatch python3-lazr.restfulclient python3-urllib3 python3-wadllib 81s python3.12 python3.12-gdbm python3.12-minimal systemd systemd-resolved 81s systemd-sysv systemd-timesyncd tzdata udev udisks2 usbutils 81s 59 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 81s Need to get 561 MB of archives. 81s After this operation, 27.2 MB of additional disk space will be used. 81s Get:1 http://ftpmaster.internal/ubuntu plucky/main ppc64el base-passwd ppc64el 3.6.5 [55.1 kB] 82s Get:2 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpython3.12t64 ppc64el 3.12.7-2 [2565 kB] 82s Get:3 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3.12 ppc64el 3.12.7-2 [661 kB] 82s Get:4 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpython3.12-stdlib ppc64el 3.12.7-2 [2121 kB] 82s Get:5 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3.12-minimal ppc64el 3.12.7-2 [2467 kB] 82s Get:6 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpython3.12-minimal ppc64el 3.12.7-2 [839 kB] 82s Get:7 http://ftpmaster.internal/ubuntu plucky/main ppc64el tzdata all 2024b-1ubuntu2 [274 kB] 82s Get:8 http://ftpmaster.internal/ubuntu plucky/main ppc64el libnss-systemd ppc64el 256.5-2ubuntu4 [215 kB] 82s Get:9 http://ftpmaster.internal/ubuntu plucky/main ppc64el systemd-timesyncd ppc64el 256.5-2ubuntu4 [42.5 kB] 82s Get:10 http://ftpmaster.internal/ubuntu plucky/main ppc64el systemd-resolved ppc64el 256.5-2ubuntu4 [368 kB] 82s Get:11 http://ftpmaster.internal/ubuntu plucky/main ppc64el libsystemd-shared ppc64el 256.5-2ubuntu4 [2503 kB] 83s Get:12 http://ftpmaster.internal/ubuntu plucky/main ppc64el libsystemd0 ppc64el 256.5-2ubuntu4 [565 kB] 83s Get:13 http://ftpmaster.internal/ubuntu plucky/main ppc64el systemd-sysv ppc64el 256.5-2ubuntu4 [11.9 kB] 83s Get:14 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpam-systemd ppc64el 256.5-2ubuntu4 [326 kB] 83s Get:15 http://ftpmaster.internal/ubuntu plucky/main ppc64el systemd ppc64el 256.5-2ubuntu4 [3746 kB] 83s Get:16 http://ftpmaster.internal/ubuntu plucky/main ppc64el udev ppc64el 256.5-2ubuntu4 [2141 kB] 83s Get:17 http://ftpmaster.internal/ubuntu plucky/main ppc64el libudev1 ppc64el 256.5-2ubuntu4 [224 kB] 83s Get:18 http://ftpmaster.internal/ubuntu plucky/main ppc64el openssh-sftp-server ppc64el 1:9.7p1-7ubuntu5 [43.3 kB] 83s Get:19 http://ftpmaster.internal/ubuntu plucky/main ppc64el openssh-server ppc64el 1:9.7p1-7ubuntu5 [629 kB] 83s Get:20 http://ftpmaster.internal/ubuntu plucky/main ppc64el openssh-client ppc64el 1:9.7p1-7ubuntu5 [1105 kB] 83s Get:21 http://ftpmaster.internal/ubuntu plucky/main ppc64el libattr1 ppc64el 1:2.5.2-2 [12.8 kB] 83s Get:22 http://ftpmaster.internal/ubuntu plucky/main ppc64el libbsd0 ppc64el 0.12.2-2 [57.4 kB] 83s Get:23 http://ftpmaster.internal/ubuntu plucky/main ppc64el libbpf1 ppc64el 1:1.4.6-1 [217 kB] 83s Get:24 http://ftpmaster.internal/ubuntu plucky/main ppc64el libmnl0 ppc64el 1.0.5-3 [13.4 kB] 83s Get:25 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-gi ppc64el 3.50.0-3 [267 kB] 83s Get:26 http://ftpmaster.internal/ubuntu plucky/main ppc64el bash-completion all 1:2.14.0-2 [210 kB] 83s Get:27 http://ftpmaster.internal/ubuntu plucky/main ppc64el libdrm-common all 2.4.123-1 [8436 B] 83s Get:28 http://ftpmaster.internal/ubuntu plucky/main ppc64el libdrm2 ppc64el 2.4.123-1 [49.6 kB] 83s Get:29 http://ftpmaster.internal/ubuntu plucky/main ppc64el libmaxminddb0 ppc64el 1.11.0-1 [21.6 kB] 83s Get:30 http://ftpmaster.internal/ubuntu plucky/main ppc64el libnghttp2-14 ppc64el 1.64.0-1 [89.7 kB] 83s Get:31 http://ftpmaster.internal/ubuntu plucky/main ppc64el liburcu8t64 ppc64el 0.14.1-1 [72.8 kB] 83s Get:32 http://ftpmaster.internal/ubuntu plucky/main ppc64el libuv1t64 ppc64el 1.48.0-7 [115 kB] 83s Get:33 http://ftpmaster.internal/ubuntu plucky/main ppc64el libx11-data all 2:1.8.10-2 [116 kB] 83s Get:34 http://ftpmaster.internal/ubuntu plucky/main ppc64el libx11-6 ppc64el 2:1.8.10-2 [738 kB] 83s Get:35 http://ftpmaster.internal/ubuntu plucky/main ppc64el pci.ids all 0.0~2024.10.24-1 [279 kB] 83s Get:36 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3.12-gdbm ppc64el 3.12.7-2 [30.6 kB] 83s Get:37 http://ftpmaster.internal/ubuntu plucky/main ppc64el usbutils ppc64el 1:018-1 [89.8 kB] 83s Get:38 http://ftpmaster.internal/ubuntu plucky/main ppc64el libblockdev-utils3 ppc64el 3.2.1-1 [20.6 kB] 83s Get:39 http://ftpmaster.internal/ubuntu plucky/main ppc64el libblockdev-crypto3 ppc64el 3.2.1-1 [24.8 kB] 83s Get:40 http://ftpmaster.internal/ubuntu plucky/main ppc64el libblockdev-fs3 ppc64el 3.2.1-1 [40.6 kB] 83s Get:41 http://ftpmaster.internal/ubuntu plucky/main ppc64el libblockdev-loop3 ppc64el 3.2.1-1 [7704 B] 83s Get:42 http://ftpmaster.internal/ubuntu plucky/main ppc64el libbytesize1 ppc64el 2.11-1ubuntu1 [14.8 kB] 83s Get:43 http://ftpmaster.internal/ubuntu plucky/main ppc64el libbytesize-common all 2.11-1ubuntu1 [3584 B] 83s Get:44 http://ftpmaster.internal/ubuntu plucky/main ppc64el libblockdev-mdraid3 ppc64el 3.2.1-1 [14.2 kB] 83s Get:45 http://ftpmaster.internal/ubuntu plucky/main ppc64el libblockdev-nvme3 ppc64el 3.2.1-1 [20.2 kB] 83s Get:46 http://ftpmaster.internal/ubuntu plucky/main ppc64el libblockdev-part3 ppc64el 3.2.1-1 [17.5 kB] 83s Get:47 http://ftpmaster.internal/ubuntu plucky/main ppc64el libblockdev-swap3 ppc64el 3.2.1-1 [8538 B] 83s Get:48 http://ftpmaster.internal/ubuntu plucky/main ppc64el libblockdev3 ppc64el 3.2.1-1 [54.1 kB] 83s Get:49 http://ftpmaster.internal/ubuntu plucky/main ppc64el libjson-glib-1.0-common all 1.10.0+ds-2 [5502 B] 83s Get:50 http://ftpmaster.internal/ubuntu plucky/main ppc64el libjson-glib-1.0-0 ppc64el 1.10.0+ds-2 [75.9 kB] 83s Get:51 http://ftpmaster.internal/ubuntu plucky/main ppc64el libnspr4 ppc64el 2:4.35-1.1ubuntu2 [134 kB] 83s Get:52 http://ftpmaster.internal/ubuntu plucky/main ppc64el udisks2 ppc64el 2.10.1-11ubuntu1 [344 kB] 83s Get:53 http://ftpmaster.internal/ubuntu plucky/main ppc64el libudisks2-0 ppc64el 2.10.1-11ubuntu1 [180 kB] 83s Get:54 http://ftpmaster.internal/ubuntu plucky/main ppc64el linux-firmware ppc64el 20241108.git3bbb13a7-0ubuntu1 [536 MB] 105s Get:55 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-idna all 3.8-2 [47.0 kB] 105s Get:56 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-jsonpatch all 1.32-4 [12.2 kB] 105s Get:57 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-wadllib all 2.0.0-1 [36.7 kB] 105s Get:58 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-lazr.restfulclient all 0.14.6-2 [50.9 kB] 105s Get:59 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-urllib3 all 2.0.7-2ubuntu0.1 [93.1 kB] 105s Get:60 http://ftpmaster.internal/ubuntu plucky/main ppc64el systemd-cryptsetup ppc64el 256.5-2ubuntu4 [127 kB] 105s Preconfiguring packages ... 105s Fetched 561 MB in 24s (23.8 MB/s) 105s (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 ... 73539 files and directories currently installed.) 105s Preparing to unpack .../base-passwd_3.6.5_ppc64el.deb ... 105s Unpacking base-passwd (3.6.5) over (3.6.4) ... 106s Setting up base-passwd (3.6.5) ... 106s (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 ... 73540 files and directories currently installed.) 106s Preparing to unpack .../00-libpython3.12t64_3.12.7-2_ppc64el.deb ... 106s Unpacking libpython3.12t64:ppc64el (3.12.7-2) over (3.12.7-1) ... 106s Preparing to unpack .../01-python3.12_3.12.7-2_ppc64el.deb ... 106s Unpacking python3.12 (3.12.7-2) over (3.12.7-1) ... 106s Preparing to unpack .../02-libpython3.12-stdlib_3.12.7-2_ppc64el.deb ... 106s Unpacking libpython3.12-stdlib:ppc64el (3.12.7-2) over (3.12.7-1) ... 106s Preparing to unpack .../03-python3.12-minimal_3.12.7-2_ppc64el.deb ... 106s Unpacking python3.12-minimal (3.12.7-2) over (3.12.7-1) ... 106s Preparing to unpack .../04-libpython3.12-minimal_3.12.7-2_ppc64el.deb ... 106s Unpacking libpython3.12-minimal:ppc64el (3.12.7-2) over (3.12.7-1) ... 106s Preparing to unpack .../05-tzdata_2024b-1ubuntu2_all.deb ... 106s Unpacking tzdata (2024b-1ubuntu2) over (2024a-4ubuntu1) ... 107s Preparing to unpack .../06-libnss-systemd_256.5-2ubuntu4_ppc64el.deb ... 107s Unpacking libnss-systemd:ppc64el (256.5-2ubuntu4) over (256.5-2ubuntu3) ... 107s Preparing to unpack .../07-systemd-timesyncd_256.5-2ubuntu4_ppc64el.deb ... 107s Unpacking systemd-timesyncd (256.5-2ubuntu4) over (256.5-2ubuntu3) ... 107s Preparing to unpack .../08-systemd-resolved_256.5-2ubuntu4_ppc64el.deb ... 107s Unpacking systemd-resolved (256.5-2ubuntu4) over (256.5-2ubuntu3) ... 107s Preparing to unpack .../09-libsystemd-shared_256.5-2ubuntu4_ppc64el.deb ... 107s Unpacking libsystemd-shared:ppc64el (256.5-2ubuntu4) over (256.5-2ubuntu3) ... 107s Preparing to unpack .../10-libsystemd0_256.5-2ubuntu4_ppc64el.deb ... 107s Unpacking libsystemd0:ppc64el (256.5-2ubuntu4) over (256.5-2ubuntu3) ... 107s Setting up libsystemd0:ppc64el (256.5-2ubuntu4) ... 107s (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 ... 73539 files and directories currently installed.) 107s Preparing to unpack .../systemd-sysv_256.5-2ubuntu4_ppc64el.deb ... 107s Unpacking systemd-sysv (256.5-2ubuntu4) over (256.5-2ubuntu3) ... 107s Preparing to unpack .../libpam-systemd_256.5-2ubuntu4_ppc64el.deb ... 107s Unpacking libpam-systemd:ppc64el (256.5-2ubuntu4) over (256.5-2ubuntu3) ... 107s Preparing to unpack .../systemd_256.5-2ubuntu4_ppc64el.deb ... 107s Unpacking systemd (256.5-2ubuntu4) over (256.5-2ubuntu3) ... 107s Preparing to unpack .../udev_256.5-2ubuntu4_ppc64el.deb ... 107s Unpacking udev (256.5-2ubuntu4) over (256.5-2ubuntu3) ... 107s Preparing to unpack .../libudev1_256.5-2ubuntu4_ppc64el.deb ... 107s Unpacking libudev1:ppc64el (256.5-2ubuntu4) over (256.5-2ubuntu3) ... 108s Setting up libudev1:ppc64el (256.5-2ubuntu4) ... 108s (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 ... 73539 files and directories currently installed.) 108s Preparing to unpack .../openssh-sftp-server_1%3a9.7p1-7ubuntu5_ppc64el.deb ... 108s Unpacking openssh-sftp-server (1:9.7p1-7ubuntu5) over (1:9.7p1-7ubuntu4) ... 108s Preparing to unpack .../openssh-server_1%3a9.7p1-7ubuntu5_ppc64el.deb ... 108s Unpacking openssh-server (1:9.7p1-7ubuntu5) over (1:9.7p1-7ubuntu4) ... 108s Preparing to unpack .../openssh-client_1%3a9.7p1-7ubuntu5_ppc64el.deb ... 108s Unpacking openssh-client (1:9.7p1-7ubuntu5) over (1:9.7p1-7ubuntu4) ... 108s Preparing to unpack .../libattr1_1%3a2.5.2-2_ppc64el.deb ... 108s Unpacking libattr1:ppc64el (1:2.5.2-2) over (1:2.5.2-1build2) ... 108s Setting up libattr1:ppc64el (1:2.5.2-2) ... 108s (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 ... 73539 files and directories currently installed.) 108s Preparing to unpack .../libbsd0_0.12.2-2_ppc64el.deb ... 108s Unpacking libbsd0:ppc64el (0.12.2-2) over (0.12.2-1) ... 108s Setting up libbsd0:ppc64el (0.12.2-2) ... 108s (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 ... 73539 files and directories currently installed.) 108s Preparing to unpack .../00-libbpf1_1%3a1.4.6-1_ppc64el.deb ... 108s Unpacking libbpf1:ppc64el (1:1.4.6-1) over (1:1.4.5-1) ... 108s Preparing to unpack .../01-libmnl0_1.0.5-3_ppc64el.deb ... 108s Unpacking libmnl0:ppc64el (1.0.5-3) over (1.0.5-2build1) ... 108s Preparing to unpack .../02-python3-gi_3.50.0-3_ppc64el.deb ... 108s Unpacking python3-gi (3.50.0-3) over (3.48.2-1) ... 108s Preparing to unpack .../03-bash-completion_1%3a2.14.0-2_all.deb ... 108s Unpacking bash-completion (1:2.14.0-2) over (1:2.14.0-1) ... 109s Preparing to unpack .../04-libdrm-common_2.4.123-1_all.deb ... 109s Unpacking libdrm-common (2.4.123-1) over (2.4.122-1) ... 109s Preparing to unpack .../05-libdrm2_2.4.123-1_ppc64el.deb ... 109s Unpacking libdrm2:ppc64el (2.4.123-1) over (2.4.122-1) ... 109s Preparing to unpack .../06-libmaxminddb0_1.11.0-1_ppc64el.deb ... 109s Unpacking libmaxminddb0:ppc64el (1.11.0-1) over (1.10.0-1) ... 109s Preparing to unpack .../07-libnghttp2-14_1.64.0-1_ppc64el.deb ... 109s Unpacking libnghttp2-14:ppc64el (1.64.0-1) over (1.62.1-2) ... 109s Preparing to unpack .../08-liburcu8t64_0.14.1-1_ppc64el.deb ... 109s Unpacking liburcu8t64:ppc64el (0.14.1-1) over (0.14.0-4) ... 109s Preparing to unpack .../09-libuv1t64_1.48.0-7_ppc64el.deb ... 109s Unpacking libuv1t64:ppc64el (1.48.0-7) over (1.48.0-5) ... 109s Preparing to unpack .../10-libx11-data_2%3a1.8.10-2_all.deb ... 109s Unpacking libx11-data (2:1.8.10-2) over (2:1.8.7-1build1) ... 109s Preparing to unpack .../11-libx11-6_2%3a1.8.10-2_ppc64el.deb ... 109s Unpacking libx11-6:ppc64el (2:1.8.10-2) over (2:1.8.7-1build1) ... 109s Preparing to unpack .../12-pci.ids_0.0~2024.10.24-1_all.deb ... 109s Unpacking pci.ids (0.0~2024.10.24-1) over (0.0~2024.09.12-1) ... 109s Preparing to unpack .../13-python3.12-gdbm_3.12.7-2_ppc64el.deb ... 109s Unpacking python3.12-gdbm (3.12.7-2) over (3.12.7-1) ... 109s Preparing to unpack .../14-usbutils_1%3a018-1_ppc64el.deb ... 109s Unpacking usbutils (1:018-1) over (1:017-3build1) ... 109s Preparing to unpack .../15-libblockdev-utils3_3.2.1-1_ppc64el.deb ... 109s Unpacking libblockdev-utils3:ppc64el (3.2.1-1) over (3.2.0-2) ... 109s Preparing to unpack .../16-libblockdev-crypto3_3.2.1-1_ppc64el.deb ... 109s Unpacking libblockdev-crypto3:ppc64el (3.2.1-1) over (3.2.0-2) ... 109s Preparing to unpack .../17-libblockdev-fs3_3.2.1-1_ppc64el.deb ... 109s Unpacking libblockdev-fs3:ppc64el (3.2.1-1) over (3.2.0-2) ... 109s Preparing to unpack .../18-libblockdev-loop3_3.2.1-1_ppc64el.deb ... 109s Unpacking libblockdev-loop3:ppc64el (3.2.1-1) over (3.2.0-2) ... 109s Preparing to unpack .../19-libbytesize1_2.11-1ubuntu1_ppc64el.deb ... 109s Unpacking libbytesize1:ppc64el (2.11-1ubuntu1) over (2.10-1ubuntu2) ... 109s Preparing to unpack .../20-libbytesize-common_2.11-1ubuntu1_all.deb ... 109s Unpacking libbytesize-common (2.11-1ubuntu1) over (2.10-1ubuntu2) ... 109s Preparing to unpack .../21-libblockdev-mdraid3_3.2.1-1_ppc64el.deb ... 109s Unpacking libblockdev-mdraid3:ppc64el (3.2.1-1) over (3.2.0-2) ... 109s Preparing to unpack .../22-libblockdev-nvme3_3.2.1-1_ppc64el.deb ... 109s Unpacking libblockdev-nvme3:ppc64el (3.2.1-1) over (3.2.0-2) ... 109s Preparing to unpack .../23-libblockdev-part3_3.2.1-1_ppc64el.deb ... 109s Unpacking libblockdev-part3:ppc64el (3.2.1-1) over (3.2.0-2) ... 109s Preparing to unpack .../24-libblockdev-swap3_3.2.1-1_ppc64el.deb ... 109s Unpacking libblockdev-swap3:ppc64el (3.2.1-1) over (3.2.0-2) ... 109s Preparing to unpack .../25-libblockdev3_3.2.1-1_ppc64el.deb ... 109s Unpacking libblockdev3:ppc64el (3.2.1-1) over (3.2.0-2) ... 109s Preparing to unpack .../26-libjson-glib-1.0-common_1.10.0+ds-2_all.deb ... 109s Unpacking libjson-glib-1.0-common (1.10.0+ds-2) over (1.8.0-2build2) ... 109s Preparing to unpack .../27-libjson-glib-1.0-0_1.10.0+ds-2_ppc64el.deb ... 109s Unpacking libjson-glib-1.0-0:ppc64el (1.10.0+ds-2) over (1.8.0-2build2) ... 109s Preparing to unpack .../28-libnspr4_2%3a4.35-1.1ubuntu2_ppc64el.deb ... 109s Unpacking libnspr4:ppc64el (2:4.35-1.1ubuntu2) over (2:4.35-1.1ubuntu1) ... 109s Preparing to unpack .../29-udisks2_2.10.1-11ubuntu1_ppc64el.deb ... 110s Unpacking udisks2 (2.10.1-11ubuntu1) over (2.10.1-9ubuntu2) ... 110s Preparing to unpack .../30-libudisks2-0_2.10.1-11ubuntu1_ppc64el.deb ... 110s Unpacking libudisks2-0:ppc64el (2.10.1-11ubuntu1) over (2.10.1-9ubuntu2) ... 110s Preparing to unpack .../31-linux-firmware_20241108.git3bbb13a7-0ubuntu1_ppc64el.deb ... 110s Unpacking linux-firmware (20241108.git3bbb13a7-0ubuntu1) over (20240913.gita34e7a5f-0ubuntu2) ... 113s Preparing to unpack .../32-python3-idna_3.8-2_all.deb ... 113s Unpacking python3-idna (3.8-2) over (3.6-2.1) ... 113s Preparing to unpack .../33-python3-jsonpatch_1.32-4_all.deb ... 113s Unpacking python3-jsonpatch (1.32-4) over (1.32-3) ... 113s Preparing to unpack .../34-python3-wadllib_2.0.0-1_all.deb ... 113s Unpacking python3-wadllib (2.0.0-1) over (1.3.6-5) ... 113s Preparing to unpack .../35-python3-lazr.restfulclient_0.14.6-2_all.deb ... 114s Unpacking python3-lazr.restfulclient (0.14.6-2) over (0.14.6-1) ... 114s Preparing to unpack .../36-python3-urllib3_2.0.7-2ubuntu0.1_all.deb ... 114s Unpacking python3-urllib3 (2.0.7-2ubuntu0.1) over (2.0.7-2) ... 114s Selecting previously unselected package systemd-cryptsetup. 114s Preparing to unpack .../37-systemd-cryptsetup_256.5-2ubuntu4_ppc64el.deb ... 114s Unpacking systemd-cryptsetup (256.5-2ubuntu4) ... 114s Setting up liburcu8t64:ppc64el (0.14.1-1) ... 114s Setting up pci.ids (0.0~2024.10.24-1) ... 114s Setting up linux-firmware (20241108.git3bbb13a7-0ubuntu1) ... 114s Setting up openssh-client (1:9.7p1-7ubuntu5) ... 114s Setting up libmaxminddb0:ppc64el (1.11.0-1) ... 114s Setting up python3.12-gdbm (3.12.7-2) ... 114s Setting up python3-jsonpatch (1.32-4) ... 114s Setting up libuv1t64:ppc64el (1.48.0-7) ... 114s Setting up libpython3.12-minimal:ppc64el (3.12.7-2) ... 114s Setting up libnghttp2-14:ppc64el (1.64.0-1) ... 114s Setting up usbutils (1:018-1) ... 114s Setting up tzdata (2024b-1ubuntu2) ... 114s 114s Current default time zone: 'Etc/UTC' 114s Local time is now: Sat Nov 9 18:26:39 UTC 2024. 114s Universal Time is now: Sat Nov 9 18:26:39 UTC 2024. 114s Run 'dpkg-reconfigure tzdata' if you wish to change it. 114s 114s Setting up libx11-data (2:1.8.10-2) ... 114s Setting up libnspr4:ppc64el (2:4.35-1.1ubuntu2) ... 114s Setting up bash-completion (1:2.14.0-2) ... 114s Setting up python3-wadllib (2.0.0-1) ... 114s Setting up python3-gi (3.50.0-3) ... 115s Setting up libbytesize-common (2.11-1ubuntu1) ... 115s Setting up libblockdev-utils3:ppc64el (3.2.1-1) ... 115s Setting up libmnl0:ppc64el (1.0.5-3) ... 115s Setting up python3-idna (3.8-2) ... 115s Setting up libsystemd-shared:ppc64el (256.5-2ubuntu4) ... 115s Setting up python3-urllib3 (2.0.7-2ubuntu0.1) ... 115s Setting up libblockdev-nvme3:ppc64el (3.2.1-1) ... 115s Setting up libblockdev-fs3:ppc64el (3.2.1-1) ... 115s Setting up libx11-6:ppc64el (2:1.8.10-2) ... 115s Setting up libjson-glib-1.0-common (1.10.0+ds-2) ... 115s Setting up libbytesize1:ppc64el (2.11-1ubuntu1) ... 115s Setting up python3-lazr.restfulclient (0.14.6-2) ... 115s Setting up libdrm-common (2.4.123-1) ... 115s Setting up libbpf1:ppc64el (1:1.4.6-1) ... 115s Setting up libudisks2-0:ppc64el (2.10.1-11ubuntu1) ... 115s Setting up python3.12-minimal (3.12.7-2) ... 116s Setting up openssh-sftp-server (1:9.7p1-7ubuntu5) ... 116s Setting up libpython3.12-stdlib:ppc64el (3.12.7-2) ... 116s Setting up libblockdev-mdraid3:ppc64el (3.2.1-1) ... 116s Setting up openssh-server (1:9.7p1-7ubuntu5) ... 118s Setting up libblockdev-crypto3:ppc64el (3.2.1-1) ... 118s Setting up libblockdev-swap3:ppc64el (3.2.1-1) ... 118s Setting up python3.12 (3.12.7-2) ... 119s Setting up libblockdev-loop3:ppc64el (3.2.1-1) ... 119s Setting up systemd (256.5-2ubuntu4) ... 119s /usr/lib/tmpfiles.d/legacy.conf:13: Duplicate line for path "/run/lock", ignoring. 119s Created symlink '/run/systemd/system/tmp.mount' → '/dev/null'. 119s /usr/lib/tmpfiles.d/legacy.conf:13: Duplicate line for path "/run/lock", ignoring. 120s Setting up libblockdev3:ppc64el (3.2.1-1) ... 120s Setting up libjson-glib-1.0-0:ppc64el (1.10.0+ds-2) ... 120s Setting up libblockdev-part3:ppc64el (3.2.1-1) ... 120s Setting up libpython3.12t64:ppc64el (3.12.7-2) ... 120s Setting up systemd-cryptsetup (256.5-2ubuntu4) ... 120s Setting up systemd-timesyncd (256.5-2ubuntu4) ... 121s systemd-time-wait-sync.service is a disabled or a static unit not running, not starting it. 121s Setting up udev (256.5-2ubuntu4) ... 122s Setting up libdrm2:ppc64el (2.4.123-1) ... 122s Setting up systemd-resolved (256.5-2ubuntu4) ... 122s Setting up udisks2 (2.10.1-11ubuntu1) ... 123s Setting up systemd-sysv (256.5-2ubuntu4) ... 123s Setting up libnss-systemd:ppc64el (256.5-2ubuntu4) ... 123s Setting up libpam-systemd:ppc64el (256.5-2ubuntu4) ... 123s Processing triggers for libc-bin (2.40-1ubuntu3) ... 123s Processing triggers for ufw (0.36.2-8) ... 123s Processing triggers for man-db (2.12.1-3) ... 125s Processing triggers for dbus (1.14.10-4ubuntu5) ... 125s Processing triggers for shared-mime-info (2.4-5) ... 126s Processing triggers for initramfs-tools (0.142ubuntu34) ... 126s update-initramfs: Generating /boot/initrd.img-6.11.0-8-generic 126s W: No lz4 in /usr/bin:/sbin:/bin, using gzip 136s Reading package lists... 136s Building dependency tree... 136s Reading state information... 136s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 137s Hit:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease 137s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 137s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 137s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 138s Reading package lists... 138s Reading package lists... 139s Building dependency tree... 139s Reading state information... 139s Calculating upgrade... 139s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 139s Reading package lists... 139s Building dependency tree... 139s Reading state information... 140s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 140s autopkgtest [18:27:05]: rebooting testbed after setup commands that affected boot 144s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 176s autopkgtest [18:27:41]: testbed running kernel: Linux 6.11.0-8-generic #8-Ubuntu SMP Mon Sep 16 13:49:23 UTC 2024 179s autopkgtest [18:27:44]: @@@@@@@@@@@@@@@@@@@@ apt-source tiktoken 181s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed/universe tiktoken 0.8.0-1 (dsc) [2252 B] 181s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/universe tiktoken 0.8.0-1 (tar) [31.6 kB] 181s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/universe tiktoken 0.8.0-1 (diff) [3840 B] 181s gpgv: Signature made Wed Oct 30 06:26:55 2024 UTC 181s gpgv: using RSA key 638BC75EC1E5C589067E35DE62645EB35F686A8A 181s gpgv: issuer "cdluminate@gmail.com" 181s gpgv: Can't check signature: No public key 181s dpkg-source: warning: cannot verify inline signature for ./tiktoken_0.8.0-1.dsc: no acceptable signature found 182s autopkgtest [18:27:47]: testing package tiktoken version 0.8.0-1 182s autopkgtest [18:27:47]: build not needed 182s autopkgtest [18:27:47]: test pybuild-autopkgtest: preparing testbed 183s Reading package lists... 183s Building dependency tree... 183s Reading state information... 184s Starting pkgProblemResolver with broken count: 0 184s Starting 2 pkgProblemResolver with broken count: 0 184s Done 184s The following additional packages will be installed: 184s autoconf automake autopoint autotools-dev binutils-mingw-w64-i686 184s binutils-mingw-w64-x86-64 build-essential cargo cargo-1.80 cmake cmake-data 184s cpp cpp-14 cpp-14-powerpc64le-linux-gnu cpp-powerpc64le-linux-gnu debhelper 184s debugedit dh-autoreconf dh-python dh-strip-nondeterminism dwz 184s fontconfig-config fonts-dejavu-core fonts-dejavu-mono g++ g++-14 184s g++-14-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu gcc gcc-14 184s gcc-14-powerpc64le-linux-gnu gcc-powerpc64le-linux-gnu gettext 184s intltool-debian libarchive-zip-perl libasan8 libbrotli-dev libbz2-dev 184s libcc1-0 libdebhelper-perl libexpat1-dev libfile-stripnondeterminism-perl 184s libfontconfig-dev libfontconfig1 libfreetype-dev libgcc-14-dev libgit2-1.7 184s libgomp1 libhttp-parser2.9 libisl23 libitm1 libjsoncpp25 liblsan0 libmpc3 184s libpfm4 libpkgconf3 libpng-dev libpython3-all-dev libpython3-dev 184s libpython3.12-dev libquadmath0 librhash0 librust-ab-glyph-dev 184s librust-ab-glyph-rasterizer+libm-dev librust-ab-glyph-rasterizer-dev 184s librust-addr2line-dev librust-adler-dev librust-ahash-dev 184s librust-aho-corasick-dev librust-allocator-api2-dev librust-anes-dev 184s librust-anstream-dev librust-anstyle-dev librust-anstyle-parse-dev 184s librust-anstyle-query-dev librust-anyhow-dev librust-approx-dev 184s librust-arbitrary-dev librust-array-init-dev librust-arrayvec-dev 184s librust-async-attributes-dev librust-async-channel-dev 184s librust-async-executor-dev librust-async-fs-dev 184s librust-async-global-executor-dev librust-async-io-dev 184s librust-async-lock-dev librust-async-net-dev librust-async-process-dev 184s librust-async-signal-dev librust-async-std-dev librust-async-task-dev 184s librust-atomic-dev librust-atomic-waker-dev librust-autocfg-dev 184s librust-backtrace-dev librust-base64-dev librust-bit-set+std-dev 184s librust-bit-set-dev librust-bit-vec-dev librust-bitflags-1-dev 184s librust-bitflags-dev librust-bitvec-dev librust-blobby-dev 184s librust-block-buffer-dev librust-blocking-dev librust-bstr-dev 184s librust-bumpalo-dev librust-bytecheck-derive-dev librust-bytecheck-dev 184s librust-bytemuck-derive-dev librust-bytemuck-dev librust-byteorder-dev 184s librust-bytes-dev librust-cast-dev librust-cc-dev librust-cfg-if-0.1-dev 184s librust-cfg-if-dev librust-chrono-dev librust-chrono-tz-build-dev 184s librust-chrono-tz-dev librust-ciborium-dev librust-ciborium-io-dev 184s librust-ciborium-ll-dev librust-clap-builder-dev librust-clap-derive-dev 184s librust-clap-dev librust-clap-lex-dev librust-cmake-dev 184s librust-color-quant-dev librust-colorchoice-dev 184s librust-compiler-builtins+core-dev 184s librust-compiler-builtins+rustc-dep-of-std-dev librust-compiler-builtins-dev 184s librust-concurrent-queue-dev librust-const-cstr-dev librust-const-oid-dev 184s librust-const-random-dev librust-const-random-macro-dev 184s librust-convert-case-dev librust-core-maths-dev librust-cpp-demangle-dev 184s librust-cpufeatures-dev librust-crc32fast-dev librust-criterion-dev 184s librust-critical-section-dev librust-crossbeam-deque-dev 184s librust-crossbeam-epoch+std-dev librust-crossbeam-epoch-dev 184s librust-crossbeam-utils-dev librust-crunchy-dev librust-crypto-common-dev 184s librust-csv-core-dev librust-csv-dev librust-ctor-dev librust-deranged-dev 184s librust-derive-arbitrary-dev librust-derive-more-0.99-dev librust-digest-dev 184s librust-dirs-next-dev librust-dirs-sys-next-dev librust-dlib-dev 184s librust-either-dev librust-env-logger-dev librust-equivalent-dev 184s librust-erased-serde-dev librust-errno-dev librust-eui48-dev 184s librust-event-listener-dev librust-event-listener-strategy-dev 184s librust-eyre+default-dev librust-eyre-dev librust-fallible-iterator-dev 184s librust-fancy-regex-dev librust-fastrand-dev librust-flate2-dev 184s librust-float-ord-dev librust-fnv-dev librust-font-kit-dev 184s librust-freetype-dev librust-freetype-sys-dev librust-funty-dev 184s librust-futures-channel-dev librust-futures-core-dev librust-futures-dev 184s librust-futures-executor-dev librust-futures-io-dev librust-futures-lite-dev 184s librust-futures-macro-dev librust-futures-sink-dev librust-futures-task-dev 184s librust-futures-util-dev librust-generic-array-dev librust-geo-types-dev 184s librust-getrandom-dev librust-ghost-dev librust-gif-dev librust-gimli-dev 184s librust-half-dev librust-hashbrown-dev librust-heck-dev librust-hmac-dev 184s librust-humantime-dev librust-iana-time-zone-dev librust-image-dev 184s librust-indenter-dev librust-indexmap-dev librust-indoc-dev 184s librust-inventory-dev librust-is-terminal-dev librust-itertools-dev 184s librust-itoa-dev librust-jobserver-dev librust-jpeg-decoder-dev 184s librust-js-sys-dev librust-kv-log-macro-dev librust-lazy-static-dev 184s librust-libc-dev librust-libloading-dev librust-libm-dev 184s librust-libwebp-sys-dev librust-libz-sys-dev librust-linux-raw-sys-dev 184s librust-lock-api-dev librust-log-dev librust-md-5-dev librust-md5-asm-dev 184s librust-memchr-dev librust-memmap2-dev librust-memoffset-dev 184s librust-miniz-oxide-dev librust-mio-dev librust-no-panic-dev 184s librust-num-bigint-dev librust-num-complex-dev librust-num-cpus-dev 184s librust-num-integer-dev librust-num-rational-dev librust-num-threads-dev 184s librust-num-traits-dev librust-object-dev librust-once-cell-dev 184s librust-oorandom-dev librust-owned-ttf-parser-dev librust-owning-ref-dev 184s librust-parking-dev librust-parking-lot-core-dev librust-parking-lot-dev 184s librust-parse-zoneinfo-dev librust-pathfinder-geometry-dev 184s librust-pathfinder-simd-dev librust-phf+uncased-dev librust-phf-codegen-dev 184s librust-phf-dev librust-phf-generator-dev librust-phf-shared+uncased-dev 184s librust-phf-shared-dev librust-pin-project-lite-dev librust-pin-utils-dev 184s librust-pkg-config-dev librust-plotters-backend-dev 184s librust-plotters-bitmap-dev librust-plotters-dev librust-plotters-svg-dev 184s librust-png-dev librust-polling-dev librust-portable-atomic-dev 184s librust-postgres-derive-dev librust-postgres-protocol-dev 184s librust-postgres-types-dev librust-powerfmt-dev librust-powerfmt-macros-dev 184s librust-ppv-lite86-dev librust-proc-macro2-dev librust-proptest-dev 184s librust-ptr-meta-derive-dev librust-ptr-meta-dev 184s librust-pure-rust-locales-dev librust-pyo3-build-config-dev librust-pyo3-dev 184s librust-pyo3-ffi-dev librust-pyo3-macros-backend-dev librust-pyo3-macros-dev 184s librust-python3-dll-a-dev librust-qoi-dev librust-quick-error-dev 184s librust-quickcheck-dev librust-quote-dev librust-radium-dev 184s librust-rand-chacha-dev librust-rand-core+getrandom-dev 184s librust-rand-core+serde-dev librust-rand-core+std-dev librust-rand-core-dev 184s librust-rand-dev librust-rand-xorshift-dev librust-rayon-core-dev 184s librust-rayon-dev librust-regex-automata-dev librust-regex-dev 184s librust-regex-syntax-dev librust-rend-dev librust-rkyv-derive-dev 184s librust-rkyv-dev librust-rust-decimal-dev librust-rustc-demangle-dev 184s librust-rustc-hash-dev librust-rustc-std-workspace-core-dev 184s librust-rustc-version-dev librust-rustix-dev 184s librust-rusty-fork+wait-timeout-dev librust-rusty-fork-dev 184s librust-ruzstd-dev librust-ryu-dev librust-same-file-dev 184s librust-scopeguard-dev librust-seahash-dev librust-semver-dev 184s librust-serde-derive-dev librust-serde-dev librust-serde-fmt-dev 184s librust-serde-json-dev librust-serde-test-dev librust-sha1-asm-dev 184s librust-sha1-dev librust-sha2-asm-dev librust-sha2-dev librust-shlex-dev 184s librust-signal-hook-registry-dev librust-simdutf8-dev librust-siphasher-dev 184s librust-slab-dev librust-slog-dev librust-smallvec-dev librust-smol-dev 184s librust-smol-str-dev librust-socket2-dev librust-spin-dev 184s librust-stable-deref-trait-dev librust-static-assertions-dev 184s librust-stringprep-dev librust-strsim-dev librust-subtle-dev 184s librust-sval-buffer-dev librust-sval-derive-dev librust-sval-dev 184s librust-sval-dynamic-dev librust-sval-fmt-dev librust-sval-ref-dev 184s librust-sval-serde-dev librust-syn-1-dev librust-syn-dev librust-tap-dev 184s librust-target-lexicon-dev librust-tempfile-dev librust-termcolor-dev 184s librust-terminal-size-dev librust-tiff-dev librust-time-core-dev 184s librust-time-dev librust-time-macros-dev librust-tiny-keccak-dev 184s librust-tinytemplate-dev librust-tinyvec+tinyvec-macros-dev 184s librust-tinyvec-dev librust-tinyvec-macros-dev librust-tokio-dev 184s librust-tokio-macros-dev librust-tracing-attributes-dev 184s librust-tracing-core-dev librust-tracing-dev librust-traitobject-dev 184s librust-ttf-parser-dev librust-twox-hash-dev librust-typemap-dev 184s librust-typenum-dev librust-unarray-dev librust-uncased-dev 184s librust-unicase-dev librust-unicode-bidi-dev librust-unicode-ident-dev 184s librust-unicode-normalization-dev librust-unicode-segmentation-dev 184s librust-unicode-width-dev librust-unindent-dev librust-unsafe-any-dev 184s librust-utf8parse-dev librust-uuid-dev librust-valuable-derive-dev 184s librust-valuable-dev librust-value-bag-dev librust-value-bag-serde1-dev 184s librust-value-bag-sval2-dev librust-version-check-dev 184s librust-wait-timeout-dev librust-walkdir-dev 184s librust-wasm-bindgen+default-dev librust-wasm-bindgen+spans-dev 184s librust-wasm-bindgen-backend-dev librust-wasm-bindgen-dev 184s librust-wasm-bindgen-macro+spans-dev librust-wasm-bindgen-macro-dev 184s librust-wasm-bindgen-macro-support+spans-dev 184s librust-wasm-bindgen-macro-support-dev librust-wasm-bindgen-shared-dev 184s librust-web-sys-dev librust-webp-dev librust-weezl-dev librust-winapi-dev 184s librust-winapi-i686-pc-windows-gnu-dev librust-winapi-util-dev 184s librust-winapi-x86-64-pc-windows-gnu-dev librust-wyz-dev 184s librust-yeslogic-fontconfig-sys-dev librust-zerocopy-derive-dev 184s librust-zerocopy-dev librust-zeroize-derive-dev librust-zeroize-dev 184s libsharpyuv-dev libsharpyuv0 libstd-rust-1.80 libstd-rust-1.80-dev 184s libstdc++-14-dev libtool libtsan2 libubsan1 libwebp-dev libwebp7 184s libwebpdecoder3 libwebpdemux2 libwebpmux3 llvm llvm-19 llvm-19-linker-tools 184s llvm-19-runtime llvm-runtime m4 pkg-config pkgconf pkgconf-bin po-debconf 184s pybuild-plugin-autopkgtest pybuild-plugin-pyproject python3-all 184s python3-build python3-dateutil python3-hypothesis python3-iniconfig 184s python3-installer python3-packaging python3-pluggy python3-pyproject-hooks 184s python3-pytest python3-regex python3-semantic-version 184s python3-setuptools-rust python3-six python3-sortedcontainers 184s python3-tiktoken python3-toml python3-wheel python3.12-dev rustc rustc-1.80 184s uuid-dev zlib1g-dev 184s Suggested packages: 184s autoconf-archive gnu-standards autoconf-doc cargo-1.80-doc cmake-doc 184s cmake-format elpa-cmake-mode ninja-build cpp-doc gcc-14-locales cpp-14-doc 184s dh-make flit gcc-14-doc gcc-multilib manpages-dev flex bison gdb gcc-doc 184s gdb-powerpc64le-linux-gnu gettext-doc libasprintf-dev libgettextpo-dev 184s freetype2-doc librust-adler+compiler-builtins-dev librust-adler+core-dev 184s librust-adler+rustc-dep-of-std-dev librust-backtrace+cpp-demangle-dev 184s librust-backtrace+rustc-serialize-dev librust-backtrace+serde-dev 184s librust-backtrace+verify-winapi-dev librust-backtrace+winapi-dev 184s librust-bytes+serde-dev librust-cfg-if-0.1+core-dev librust-cfg-if+core-dev 184s librust-compiler-builtins+c-dev gnuplot-nox librust-csv-core+libc-dev 184s librust-either+serde-dev librust-getrandom+compiler-builtins-dev 184s librust-getrandom+core-dev librust-getrandom+rustc-dep-of-std-dev 184s librust-libc+rustc-dep-of-std-dev librust-libc+rustc-std-workspace-core-dev 184s librust-phf+phf-macros-dev librust-phf+serde-dev librust-phf+unicase-dev 184s librust-phf-shared+unicase-dev librust-rand-xorshift+serde-dev 184s librust-rustc-demangle+compiler-builtins-dev librust-rustc-demangle+core-dev 184s librust-rustc-demangle+rustc-dep-of-std-dev librust-ryu+no-panic-dev 184s librust-slog+erased-serde-dev librust-tinyvec+arbitrary-dev 184s librust-tinyvec+serde-dev librust-uncased+serde-dev 184s librust-uncased+with-serde-alloc-dev 184s librust-wasm-bindgen-backend+extra-traits-dev librust-wasm-bindgen+serde-dev 184s librust-wasm-bindgen+serde-serialize-dev librust-wasm-bindgen+serde-json-dev 184s librust-wasm-bindgen+strict-macro-dev 184s librust-wasm-bindgen+xxx-debug-only-print-generated-code-dev 184s librust-wasm-bindgen-macro+strict-macro-dev 184s librust-wasm-bindgen-macro-support+extra-traits-dev librust-weezl+async-dev 184s librust-weezl+futures-dev libstdc++-14-doc libtool-doc gfortran 184s | fortran95-compiler gcj-jdk llvm-19-doc m4-doc libmail-box-perl python3-pip 184s python3-venv python-build-doc python-hypothesis-doc python-installer-doc 184s python-semantic-version-doc python-sortedcontainers-doc llvm-18 lld-18 184s clang-18 184s Recommended packages: 184s bzip2-doc libarchive-cpio-perl libpng-tools librust-phf+std-dev 184s librust-subtle+default-dev libltdl-dev llvm-19-dev libmail-sendmail-perl 184s python3-click 184s The following NEW packages will be installed: 184s autoconf automake autopkgtest-satdep autopoint autotools-dev 184s binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 build-essential cargo 184s cargo-1.80 cmake cmake-data cpp cpp-14 cpp-14-powerpc64le-linux-gnu 184s cpp-powerpc64le-linux-gnu debhelper debugedit dh-autoreconf dh-python 184s dh-strip-nondeterminism dwz fontconfig-config fonts-dejavu-core 184s fonts-dejavu-mono g++ g++-14 g++-14-powerpc64le-linux-gnu 184s g++-powerpc64le-linux-gnu gcc gcc-14 gcc-14-powerpc64le-linux-gnu 184s gcc-powerpc64le-linux-gnu gettext intltool-debian libarchive-zip-perl 184s libasan8 libbrotli-dev libbz2-dev libcc1-0 libdebhelper-perl libexpat1-dev 184s libfile-stripnondeterminism-perl libfontconfig-dev libfontconfig1 184s libfreetype-dev libgcc-14-dev libgit2-1.7 libgomp1 libhttp-parser2.9 184s libisl23 libitm1 libjsoncpp25 liblsan0 libmpc3 libpfm4 libpkgconf3 184s libpng-dev libpython3-all-dev libpython3-dev libpython3.12-dev libquadmath0 184s librhash0 librust-ab-glyph-dev librust-ab-glyph-rasterizer+libm-dev 184s librust-ab-glyph-rasterizer-dev librust-addr2line-dev librust-adler-dev 184s librust-ahash-dev librust-aho-corasick-dev librust-allocator-api2-dev 184s librust-anes-dev librust-anstream-dev librust-anstyle-dev 184s librust-anstyle-parse-dev librust-anstyle-query-dev librust-anyhow-dev 184s librust-approx-dev librust-arbitrary-dev librust-array-init-dev 184s librust-arrayvec-dev librust-async-attributes-dev librust-async-channel-dev 184s librust-async-executor-dev librust-async-fs-dev 184s librust-async-global-executor-dev librust-async-io-dev 184s librust-async-lock-dev librust-async-net-dev librust-async-process-dev 184s librust-async-signal-dev librust-async-std-dev librust-async-task-dev 184s librust-atomic-dev librust-atomic-waker-dev librust-autocfg-dev 184s librust-backtrace-dev librust-base64-dev librust-bit-set+std-dev 184s librust-bit-set-dev librust-bit-vec-dev librust-bitflags-1-dev 184s librust-bitflags-dev librust-bitvec-dev librust-blobby-dev 184s librust-block-buffer-dev librust-blocking-dev librust-bstr-dev 184s librust-bumpalo-dev librust-bytecheck-derive-dev librust-bytecheck-dev 184s librust-bytemuck-derive-dev librust-bytemuck-dev librust-byteorder-dev 184s librust-bytes-dev librust-cast-dev librust-cc-dev librust-cfg-if-0.1-dev 184s librust-cfg-if-dev librust-chrono-dev librust-chrono-tz-build-dev 184s librust-chrono-tz-dev librust-ciborium-dev librust-ciborium-io-dev 184s librust-ciborium-ll-dev librust-clap-builder-dev librust-clap-derive-dev 184s librust-clap-dev librust-clap-lex-dev librust-cmake-dev 184s librust-color-quant-dev librust-colorchoice-dev 184s librust-compiler-builtins+core-dev 184s librust-compiler-builtins+rustc-dep-of-std-dev librust-compiler-builtins-dev 184s librust-concurrent-queue-dev librust-const-cstr-dev librust-const-oid-dev 184s librust-const-random-dev librust-const-random-macro-dev 184s librust-convert-case-dev librust-core-maths-dev librust-cpp-demangle-dev 184s librust-cpufeatures-dev librust-crc32fast-dev librust-criterion-dev 184s librust-critical-section-dev librust-crossbeam-deque-dev 184s librust-crossbeam-epoch+std-dev librust-crossbeam-epoch-dev 184s librust-crossbeam-utils-dev librust-crunchy-dev librust-crypto-common-dev 184s librust-csv-core-dev librust-csv-dev librust-ctor-dev librust-deranged-dev 184s librust-derive-arbitrary-dev librust-derive-more-0.99-dev librust-digest-dev 184s librust-dirs-next-dev librust-dirs-sys-next-dev librust-dlib-dev 184s librust-either-dev librust-env-logger-dev librust-equivalent-dev 184s librust-erased-serde-dev librust-errno-dev librust-eui48-dev 184s librust-event-listener-dev librust-event-listener-strategy-dev 184s librust-eyre+default-dev librust-eyre-dev librust-fallible-iterator-dev 184s librust-fancy-regex-dev librust-fastrand-dev librust-flate2-dev 184s librust-float-ord-dev librust-fnv-dev librust-font-kit-dev 184s librust-freetype-dev librust-freetype-sys-dev librust-funty-dev 184s librust-futures-channel-dev librust-futures-core-dev librust-futures-dev 184s librust-futures-executor-dev librust-futures-io-dev librust-futures-lite-dev 184s librust-futures-macro-dev librust-futures-sink-dev librust-futures-task-dev 184s librust-futures-util-dev librust-generic-array-dev librust-geo-types-dev 184s librust-getrandom-dev librust-ghost-dev librust-gif-dev librust-gimli-dev 184s librust-half-dev librust-hashbrown-dev librust-heck-dev librust-hmac-dev 184s librust-humantime-dev librust-iana-time-zone-dev librust-image-dev 184s librust-indenter-dev librust-indexmap-dev librust-indoc-dev 184s librust-inventory-dev librust-is-terminal-dev librust-itertools-dev 184s librust-itoa-dev librust-jobserver-dev librust-jpeg-decoder-dev 184s librust-js-sys-dev librust-kv-log-macro-dev librust-lazy-static-dev 184s librust-libc-dev librust-libloading-dev librust-libm-dev 184s librust-libwebp-sys-dev librust-libz-sys-dev librust-linux-raw-sys-dev 184s librust-lock-api-dev librust-log-dev librust-md-5-dev librust-md5-asm-dev 184s librust-memchr-dev librust-memmap2-dev librust-memoffset-dev 184s librust-miniz-oxide-dev librust-mio-dev librust-no-panic-dev 184s librust-num-bigint-dev librust-num-complex-dev librust-num-cpus-dev 184s librust-num-integer-dev librust-num-rational-dev librust-num-threads-dev 184s librust-num-traits-dev librust-object-dev librust-once-cell-dev 184s librust-oorandom-dev librust-owned-ttf-parser-dev librust-owning-ref-dev 184s librust-parking-dev librust-parking-lot-core-dev librust-parking-lot-dev 184s librust-parse-zoneinfo-dev librust-pathfinder-geometry-dev 184s librust-pathfinder-simd-dev librust-phf+uncased-dev librust-phf-codegen-dev 184s librust-phf-dev librust-phf-generator-dev librust-phf-shared+uncased-dev 184s librust-phf-shared-dev librust-pin-project-lite-dev librust-pin-utils-dev 184s librust-pkg-config-dev librust-plotters-backend-dev 184s librust-plotters-bitmap-dev librust-plotters-dev librust-plotters-svg-dev 184s librust-png-dev librust-polling-dev librust-portable-atomic-dev 184s librust-postgres-derive-dev librust-postgres-protocol-dev 184s librust-postgres-types-dev librust-powerfmt-dev librust-powerfmt-macros-dev 184s librust-ppv-lite86-dev librust-proc-macro2-dev librust-proptest-dev 184s librust-ptr-meta-derive-dev librust-ptr-meta-dev 184s librust-pure-rust-locales-dev librust-pyo3-build-config-dev librust-pyo3-dev 184s librust-pyo3-ffi-dev librust-pyo3-macros-backend-dev librust-pyo3-macros-dev 184s librust-python3-dll-a-dev librust-qoi-dev librust-quick-error-dev 184s librust-quickcheck-dev librust-quote-dev librust-radium-dev 184s librust-rand-chacha-dev librust-rand-core+getrandom-dev 184s librust-rand-core+serde-dev librust-rand-core+std-dev librust-rand-core-dev 184s librust-rand-dev librust-rand-xorshift-dev librust-rayon-core-dev 184s librust-rayon-dev librust-regex-automata-dev librust-regex-dev 184s librust-regex-syntax-dev librust-rend-dev librust-rkyv-derive-dev 184s librust-rkyv-dev librust-rust-decimal-dev librust-rustc-demangle-dev 184s librust-rustc-hash-dev librust-rustc-std-workspace-core-dev 184s librust-rustc-version-dev librust-rustix-dev 184s librust-rusty-fork+wait-timeout-dev librust-rusty-fork-dev 184s librust-ruzstd-dev librust-ryu-dev librust-same-file-dev 184s librust-scopeguard-dev librust-seahash-dev librust-semver-dev 184s librust-serde-derive-dev librust-serde-dev librust-serde-fmt-dev 184s librust-serde-json-dev librust-serde-test-dev librust-sha1-asm-dev 184s librust-sha1-dev librust-sha2-asm-dev librust-sha2-dev librust-shlex-dev 184s librust-signal-hook-registry-dev librust-simdutf8-dev librust-siphasher-dev 184s librust-slab-dev librust-slog-dev librust-smallvec-dev librust-smol-dev 184s librust-smol-str-dev librust-socket2-dev librust-spin-dev 184s librust-stable-deref-trait-dev librust-static-assertions-dev 184s librust-stringprep-dev librust-strsim-dev librust-subtle-dev 184s librust-sval-buffer-dev librust-sval-derive-dev librust-sval-dev 184s librust-sval-dynamic-dev librust-sval-fmt-dev librust-sval-ref-dev 184s librust-sval-serde-dev librust-syn-1-dev librust-syn-dev librust-tap-dev 184s librust-target-lexicon-dev librust-tempfile-dev librust-termcolor-dev 184s librust-terminal-size-dev librust-tiff-dev librust-time-core-dev 184s librust-time-dev librust-time-macros-dev librust-tiny-keccak-dev 184s librust-tinytemplate-dev librust-tinyvec+tinyvec-macros-dev 184s librust-tinyvec-dev librust-tinyvec-macros-dev librust-tokio-dev 184s librust-tokio-macros-dev librust-tracing-attributes-dev 184s librust-tracing-core-dev librust-tracing-dev librust-traitobject-dev 184s librust-ttf-parser-dev librust-twox-hash-dev librust-typemap-dev 184s librust-typenum-dev librust-unarray-dev librust-uncased-dev 184s librust-unicase-dev librust-unicode-bidi-dev librust-unicode-ident-dev 184s librust-unicode-normalization-dev librust-unicode-segmentation-dev 184s librust-unicode-width-dev librust-unindent-dev librust-unsafe-any-dev 184s librust-utf8parse-dev librust-uuid-dev librust-valuable-derive-dev 184s librust-valuable-dev librust-value-bag-dev librust-value-bag-serde1-dev 184s librust-value-bag-sval2-dev librust-version-check-dev 184s librust-wait-timeout-dev librust-walkdir-dev 184s librust-wasm-bindgen+default-dev librust-wasm-bindgen+spans-dev 184s librust-wasm-bindgen-backend-dev librust-wasm-bindgen-dev 184s librust-wasm-bindgen-macro+spans-dev librust-wasm-bindgen-macro-dev 184s librust-wasm-bindgen-macro-support+spans-dev 184s librust-wasm-bindgen-macro-support-dev librust-wasm-bindgen-shared-dev 184s librust-web-sys-dev librust-webp-dev librust-weezl-dev librust-winapi-dev 184s librust-winapi-i686-pc-windows-gnu-dev librust-winapi-util-dev 184s librust-winapi-x86-64-pc-windows-gnu-dev librust-wyz-dev 184s librust-yeslogic-fontconfig-sys-dev librust-zerocopy-derive-dev 184s librust-zerocopy-dev librust-zeroize-derive-dev librust-zeroize-dev 184s libsharpyuv-dev libsharpyuv0 libstd-rust-1.80 libstd-rust-1.80-dev 184s libstdc++-14-dev libtool libtsan2 libubsan1 libwebp-dev libwebp7 184s libwebpdecoder3 libwebpdemux2 libwebpmux3 llvm llvm-19 llvm-19-linker-tools 184s llvm-19-runtime llvm-runtime m4 pkg-config pkgconf pkgconf-bin po-debconf 184s pybuild-plugin-autopkgtest pybuild-plugin-pyproject python3-all 184s python3-build python3-dateutil python3-hypothesis python3-iniconfig 184s python3-installer python3-packaging python3-pluggy python3-pyproject-hooks 184s python3-pytest python3-regex python3-semantic-version 184s python3-setuptools-rust python3-six python3-sortedcontainers 184s python3-tiktoken python3-toml python3-wheel python3.12-dev rustc rustc-1.80 184s uuid-dev zlib1g-dev 184s 0 upgraded, 467 newly installed, 0 to remove and 0 not upgraded. 184s Need to get 215 MB/215 MB of archives. 184s After this operation, 951 MB of additional disk space will be used. 184s Get:1 /tmp/autopkgtest.ycJWu9/1-autopkgtest-satdep.deb autopkgtest-satdep ppc64el 0 [864 B] 185s Get:2 http://ftpmaster.internal/ubuntu plucky/main ppc64el m4 ppc64el 1.4.19-4build1 [278 kB] 185s Get:3 http://ftpmaster.internal/ubuntu plucky/main ppc64el autoconf all 2.72-3 [382 kB] 185s Get:4 http://ftpmaster.internal/ubuntu plucky/main ppc64el autotools-dev all 20220109.1 [44.9 kB] 185s Get:5 http://ftpmaster.internal/ubuntu plucky/main ppc64el automake all 1:1.16.5-1.3ubuntu1 [558 kB] 185s Get:6 http://ftpmaster.internal/ubuntu plucky/main ppc64el autopoint all 0.22.5-2 [616 kB] 185s Get:7 http://ftpmaster.internal/ubuntu plucky/main ppc64el libisl23 ppc64el 0.27-1 [882 kB] 185s Get:8 http://ftpmaster.internal/ubuntu plucky/main ppc64el libmpc3 ppc64el 1.3.1-1build2 [62.1 kB] 185s Get:9 http://ftpmaster.internal/ubuntu plucky/main ppc64el cpp-14-powerpc64le-linux-gnu ppc64el 14.2.0-7ubuntu1 [10.5 MB] 186s Get:10 http://ftpmaster.internal/ubuntu plucky/main ppc64el cpp-14 ppc64el 14.2.0-7ubuntu1 [1030 B] 186s Get:11 http://ftpmaster.internal/ubuntu plucky/main ppc64el cpp-powerpc64le-linux-gnu ppc64el 4:14.1.0-2ubuntu1 [5456 B] 186s Get:12 http://ftpmaster.internal/ubuntu plucky/main ppc64el cpp ppc64el 4:14.1.0-2ubuntu1 [22.5 kB] 186s Get:13 http://ftpmaster.internal/ubuntu plucky/main ppc64el libcc1-0 ppc64el 14.2.0-7ubuntu1 [48.1 kB] 186s Get:14 http://ftpmaster.internal/ubuntu plucky/main ppc64el libgomp1 ppc64el 14.2.0-7ubuntu1 [161 kB] 186s Get:15 http://ftpmaster.internal/ubuntu plucky/main ppc64el libitm1 ppc64el 14.2.0-7ubuntu1 [31.9 kB] 186s Get:16 http://ftpmaster.internal/ubuntu plucky/main ppc64el libasan8 ppc64el 14.2.0-7ubuntu1 [2945 kB] 186s Get:17 http://ftpmaster.internal/ubuntu plucky/main ppc64el liblsan0 ppc64el 14.2.0-7ubuntu1 [1322 kB] 186s Get:18 http://ftpmaster.internal/ubuntu plucky/main ppc64el libtsan2 ppc64el 14.2.0-7ubuntu1 [2694 kB] 186s Get:19 http://ftpmaster.internal/ubuntu plucky/main ppc64el libubsan1 ppc64el 14.2.0-7ubuntu1 [1191 kB] 186s Get:20 http://ftpmaster.internal/ubuntu plucky/main ppc64el libquadmath0 ppc64el 14.2.0-7ubuntu1 [158 kB] 186s Get:21 http://ftpmaster.internal/ubuntu plucky/main ppc64el libgcc-14-dev ppc64el 14.2.0-7ubuntu1 [1620 kB] 186s Get:22 http://ftpmaster.internal/ubuntu plucky/main ppc64el gcc-14-powerpc64le-linux-gnu ppc64el 14.2.0-7ubuntu1 [20.6 MB] 186s Get:23 http://ftpmaster.internal/ubuntu plucky/main ppc64el gcc-14 ppc64el 14.2.0-7ubuntu1 [526 kB] 186s Get:24 http://ftpmaster.internal/ubuntu plucky/main ppc64el gcc-powerpc64le-linux-gnu ppc64el 4:14.1.0-2ubuntu1 [1222 B] 186s Get:25 http://ftpmaster.internal/ubuntu plucky/main ppc64el gcc ppc64el 4:14.1.0-2ubuntu1 [5006 B] 186s Get:26 http://ftpmaster.internal/ubuntu plucky/main ppc64el libstdc++-14-dev ppc64el 14.2.0-7ubuntu1 [2672 kB] 187s Get:27 http://ftpmaster.internal/ubuntu plucky/main ppc64el g++-14-powerpc64le-linux-gnu ppc64el 14.2.0-7ubuntu1 [12.0 MB] 187s Get:28 http://ftpmaster.internal/ubuntu plucky/main ppc64el g++-14 ppc64el 14.2.0-7ubuntu1 [19.8 kB] 187s Get:29 http://ftpmaster.internal/ubuntu plucky/main ppc64el g++-powerpc64le-linux-gnu ppc64el 4:14.1.0-2ubuntu1 [968 B] 187s Get:30 http://ftpmaster.internal/ubuntu plucky/main ppc64el g++ ppc64el 4:14.1.0-2ubuntu1 [1090 B] 187s Get:31 http://ftpmaster.internal/ubuntu plucky/main ppc64el build-essential ppc64el 12.10ubuntu1 [4936 B] 187s Get:32 http://ftpmaster.internal/ubuntu plucky/main ppc64el libhttp-parser2.9 ppc64el 2.9.4-6build1 [24.4 kB] 187s Get:33 http://ftpmaster.internal/ubuntu plucky/main ppc64el libgit2-1.7 ppc64el 1.7.2+ds-1ubuntu3 [611 kB] 187s Get:34 http://ftpmaster.internal/ubuntu plucky/main ppc64el libstd-rust-1.80 ppc64el 1.80.1+dfsg0ubuntu1-0ubuntu1 [22.0 MB] 187s Get:35 http://ftpmaster.internal/ubuntu plucky/main ppc64el libstd-rust-1.80-dev ppc64el 1.80.1+dfsg0ubuntu1-0ubuntu1 [39.8 MB] 188s Get:36 http://ftpmaster.internal/ubuntu plucky/main ppc64el rustc-1.80 ppc64el 1.80.1+dfsg0ubuntu1-0ubuntu1 [3375 kB] 189s Get:37 http://ftpmaster.internal/ubuntu plucky/main ppc64el cargo-1.80 ppc64el 1.80.1+dfsg0ubuntu1-0ubuntu1 [6239 kB] 189s Get:38 http://ftpmaster.internal/ubuntu plucky/main ppc64el libjsoncpp25 ppc64el 1.9.5-6build1 [89.0 kB] 189s Get:39 http://ftpmaster.internal/ubuntu plucky/main ppc64el librhash0 ppc64el 1.4.3-3build1 [147 kB] 189s Get:40 http://ftpmaster.internal/ubuntu plucky/main ppc64el cmake-data all 3.30.3-1 [2246 kB] 189s Get:41 http://ftpmaster.internal/ubuntu plucky/main ppc64el cmake ppc64el 3.30.3-1 [12.1 MB] 189s Get:42 http://ftpmaster.internal/ubuntu plucky/main ppc64el libdebhelper-perl all 13.20ubuntu1 [94.2 kB] 189s Get:43 http://ftpmaster.internal/ubuntu plucky/main ppc64el libtool all 2.4.7-7build1 [166 kB] 189s Get:44 http://ftpmaster.internal/ubuntu plucky/main ppc64el dh-autoreconf all 20 [16.1 kB] 189s Get:45 http://ftpmaster.internal/ubuntu plucky/main ppc64el libarchive-zip-perl all 1.68-1 [90.2 kB] 189s Get:46 http://ftpmaster.internal/ubuntu plucky/main ppc64el libfile-stripnondeterminism-perl all 1.14.0-1 [20.1 kB] 189s Get:47 http://ftpmaster.internal/ubuntu plucky/main ppc64el dh-strip-nondeterminism all 1.14.0-1 [5058 B] 189s Get:48 http://ftpmaster.internal/ubuntu plucky/main ppc64el debugedit ppc64el 1:5.1-1 [52.1 kB] 189s Get:49 http://ftpmaster.internal/ubuntu plucky/main ppc64el dwz ppc64el 0.15-1build6 [142 kB] 189s Get:50 http://ftpmaster.internal/ubuntu plucky/main ppc64el gettext ppc64el 0.22.5-2 [1082 kB] 189s Get:51 http://ftpmaster.internal/ubuntu plucky/main ppc64el intltool-debian all 0.35.0+20060710.6 [23.2 kB] 189s Get:52 http://ftpmaster.internal/ubuntu plucky/main ppc64el po-debconf all 1.0.21+nmu1 [233 kB] 189s Get:53 http://ftpmaster.internal/ubuntu plucky/main ppc64el debhelper all 13.20ubuntu1 [893 kB] 189s Get:54 http://ftpmaster.internal/ubuntu plucky/universe ppc64el dh-python all 6.20241024 [112 kB] 189s Get:55 http://ftpmaster.internal/ubuntu plucky/main ppc64el fonts-dejavu-mono all 2.37-8 [502 kB] 189s Get:56 http://ftpmaster.internal/ubuntu plucky/main ppc64el fonts-dejavu-core all 2.37-8 [835 kB] 189s Get:57 http://ftpmaster.internal/ubuntu plucky/main ppc64el fontconfig-config ppc64el 2.15.0-1.1ubuntu2 [37.4 kB] 189s Get:58 http://ftpmaster.internal/ubuntu plucky/main ppc64el libbrotli-dev ppc64el 1.1.0-2build2 [423 kB] 189s Get:59 http://ftpmaster.internal/ubuntu plucky/main ppc64el libbz2-dev ppc64el 1.0.8-6 [50.2 kB] 189s Get:60 http://ftpmaster.internal/ubuntu plucky/main ppc64el libexpat1-dev ppc64el 2.6.2-2 [149 kB] 189s Get:61 http://ftpmaster.internal/ubuntu plucky/main ppc64el libfontconfig1 ppc64el 2.15.0-1.1ubuntu2 [190 kB] 189s Get:62 http://ftpmaster.internal/ubuntu plucky/main ppc64el zlib1g-dev ppc64el 1:1.3.dfsg+really1.3.1-1ubuntu1 [902 kB] 189s Get:63 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpng-dev ppc64el 1.6.44-1 [323 kB] 189s Get:64 http://ftpmaster.internal/ubuntu plucky/main ppc64el libfreetype-dev ppc64el 2.13.3+dfsg-1 [719 kB] 189s Get:65 http://ftpmaster.internal/ubuntu plucky/main ppc64el uuid-dev ppc64el 2.40.2-1ubuntu1 [55.1 kB] 189s Get:66 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpkgconf3 ppc64el 1.8.1-4 [37.1 kB] 189s Get:67 http://ftpmaster.internal/ubuntu plucky/main ppc64el pkgconf-bin ppc64el 1.8.1-4 [22.5 kB] 189s Get:68 http://ftpmaster.internal/ubuntu plucky/main ppc64el pkgconf ppc64el 1.8.1-4 [16.7 kB] 189s Get:69 http://ftpmaster.internal/ubuntu plucky/main ppc64el libfontconfig-dev ppc64el 2.15.0-1.1ubuntu2 [212 kB] 189s Get:70 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpython3.12-dev ppc64el 3.12.7-2 [6139 kB] 190s Get:71 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpython3-dev ppc64el 3.12.6-0ubuntu1 [10.2 kB] 190s Get:72 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpython3-all-dev ppc64el 3.12.6-0ubuntu1 [916 B] 190s Get:73 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ab-glyph-rasterizer-dev ppc64el 0.1.7-1 [12.2 kB] 190s Get:74 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-libm-dev ppc64el 0.2.8-1 [101 kB] 190s Get:75 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ab-glyph-rasterizer+libm-dev ppc64el 0.1.7-1 [1066 B] 190s Get:76 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-core-maths-dev ppc64el 0.1.0-2 [7954 B] 190s Get:77 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ttf-parser-dev ppc64el 0.24.1-1 [148 kB] 190s Get:78 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-owned-ttf-parser-dev ppc64el 0.24.0-1 [129 kB] 190s Get:79 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ab-glyph-dev ppc64el 0.2.28-1 [20.7 kB] 190s Get:80 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-cfg-if-dev ppc64el 1.0.0-1 [10.5 kB] 190s Get:81 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-cpp-demangle-dev ppc64el 0.4.0-1 [66.1 kB] 190s Get:82 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-fallible-iterator-dev ppc64el 0.3.0-2 [20.3 kB] 190s Get:83 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-unicode-ident-dev ppc64el 1.0.13-1 [38.5 kB] 190s Get:84 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-proc-macro2-dev ppc64el 1.0.86-1 [44.8 kB] 190s Get:85 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-quote-dev ppc64el 1.0.37-1 [29.5 kB] 190s Get:86 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-syn-dev ppc64el 2.0.77-1 [214 kB] 190s Get:87 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-derive-arbitrary-dev ppc64el 1.3.2-1 [12.3 kB] 190s Get:88 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-arbitrary-dev ppc64el 1.3.2-1 [31.4 kB] 190s Get:89 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-equivalent-dev ppc64el 1.0.1-1 [8240 B] 190s Get:90 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-critical-section-dev ppc64el 1.1.3-1 [20.5 kB] 190s Get:91 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-serde-derive-dev ppc64el 1.0.210-1 [50.1 kB] 190s Get:92 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-serde-dev ppc64el 1.0.210-2 [66.4 kB] 190s Get:93 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-portable-atomic-dev ppc64el 1.4.3-2 [99.7 kB] 190s Get:94 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-libc-dev ppc64el 0.2.155-1 [367 kB] 190s Get:95 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-getrandom-dev ppc64el 0.2.12-1 [36.4 kB] 190s Get:96 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-smallvec-dev ppc64el 1.13.2-1 [35.5 kB] 190s Get:97 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-parking-lot-core-dev ppc64el 0.9.10-1 [32.6 kB] 190s Get:98 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-once-cell-dev ppc64el 1.19.0-1 [31.7 kB] 190s Get:99 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-crunchy-dev ppc64el 0.2.2-1 [5340 B] 190s Get:100 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tiny-keccak-dev ppc64el 2.0.2-1 [20.9 kB] 190s Get:101 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-const-random-macro-dev ppc64el 0.1.16-2 [10.5 kB] 190s Get:102 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-const-random-dev ppc64el 0.1.17-2 [8590 B] 190s Get:103 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-version-check-dev ppc64el 0.9.5-1 [16.9 kB] 190s Get:104 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-byteorder-dev ppc64el 1.5.0-1 [22.4 kB] 190s Get:105 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-zerocopy-derive-dev ppc64el 0.7.32-2 [29.7 kB] 190s Get:106 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-zerocopy-dev ppc64el 0.7.32-1 [116 kB] 190s Get:107 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ahash-dev all 0.8.11-8 [37.9 kB] 190s Get:108 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-allocator-api2-dev ppc64el 0.2.16-1 [54.8 kB] 190s Get:109 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-compiler-builtins-dev ppc64el 0.1.101-1 [156 kB] 190s Get:110 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-either-dev ppc64el 1.13.0-1 [20.2 kB] 190s Get:111 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-crossbeam-utils-dev ppc64el 0.8.19-1 [41.1 kB] 190s Get:112 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-crossbeam-epoch-dev ppc64el 0.9.18-1 [42.3 kB] 190s Get:113 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-crossbeam-epoch+std-dev ppc64el 0.9.18-1 [1128 B] 190s Get:114 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-crossbeam-deque-dev ppc64el 0.8.5-1 [22.4 kB] 190s Get:115 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rayon-core-dev ppc64el 1.12.1-1 [63.7 kB] 190s Get:116 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rayon-dev ppc64el 1.10.0-1 [149 kB] 190s Get:117 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rustc-std-workspace-core-dev ppc64el 1.0.0-1 [3020 B] 190s Get:118 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-hashbrown-dev ppc64el 0.14.5-5 [110 kB] 190s Get:119 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-indexmap-dev ppc64el 2.2.6-1 [66.7 kB] 190s Get:120 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-stable-deref-trait-dev ppc64el 1.2.0-1 [9794 B] 190s Get:121 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-gimli-dev ppc64el 0.28.1-2 [209 kB] 190s Get:122 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-memmap2-dev ppc64el 0.9.3-1 [30.8 kB] 190s Get:123 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-crc32fast-dev ppc64el 1.4.2-1 [39.8 kB] 190s Get:124 http://ftpmaster.internal/ubuntu plucky/main ppc64el pkg-config ppc64el 1.8.1-4 [7362 B] 190s Get:125 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pkg-config-dev ppc64el 0.3.27-1 [21.5 kB] 190s Get:126 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-libz-sys-dev ppc64el 1.1.20-1 [19.8 kB] 190s Get:127 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-adler-dev ppc64el 1.0.2-2 [15.3 kB] 190s Get:128 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-miniz-oxide-dev ppc64el 0.7.1-1 [51.5 kB] 190s Get:129 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-flate2-dev ppc64el 1.0.27-2 [64.9 kB] 190s Get:130 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sval-derive-dev ppc64el 2.6.1-2 [11.0 kB] 190s Get:131 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sval-dev ppc64el 2.6.1-2 [28.0 kB] 190s Get:132 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sval-ref-dev ppc64el 2.6.1-1 [8944 B] 190s Get:133 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-erased-serde-dev ppc64el 0.3.31-1 [22.7 kB] 190s Get:134 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-serde-fmt-dev all 1.0.3-3 [6956 B] 190s Get:135 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-syn-1-dev ppc64el 1.0.109-2 [188 kB] 190s Get:136 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-no-panic-dev ppc64el 0.1.13-1 [11.3 kB] 190s Get:137 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-itoa-dev ppc64el 1.0.9-1 [13.1 kB] 191s Get:138 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ryu-dev ppc64el 1.0.15-1 [41.7 kB] 191s Get:139 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-serde-json-dev ppc64el 1.0.128-1 [128 kB] 191s Get:140 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-serde-test-dev ppc64el 1.0.171-1 [20.6 kB] 191s Get:141 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-value-bag-serde1-dev ppc64el 1.9.0-1 [7822 B] 191s Get:142 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sval-buffer-dev ppc64el 2.6.1-1 [16.8 kB] 191s Get:143 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sval-dynamic-dev ppc64el 2.6.1-1 [9544 B] 191s Get:144 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sval-fmt-dev ppc64el 2.6.1-1 [12.0 kB] 191s Get:145 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sval-serde-dev ppc64el 2.6.1-1 [13.2 kB] 191s Get:146 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-value-bag-sval2-dev ppc64el 1.9.0-1 [7862 B] 191s Get:147 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-value-bag-dev ppc64el 1.9.0-1 [37.6 kB] 191s Get:148 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-log-dev ppc64el 0.4.22-1 [43.0 kB] 191s Get:149 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-memchr-dev ppc64el 2.7.1-1 [71.6 kB] 191s Get:150 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ppv-lite86-dev ppc64el 0.2.16-1 [21.9 kB] 191s Get:151 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rand-core-dev ppc64el 0.6.4-2 [23.8 kB] 191s Get:152 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rand-chacha-dev ppc64el 0.3.1-2 [16.9 kB] 191s Get:153 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rand-core+getrandom-dev ppc64el 0.6.4-2 [1054 B] 191s Get:154 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rand-core+serde-dev ppc64el 0.6.4-2 [1108 B] 191s Get:155 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rand-core+std-dev ppc64el 0.6.4-2 [1054 B] 191s Get:156 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rand-dev ppc64el 0.8.5-1 [77.5 kB] 191s Get:157 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-unicode-segmentation-dev ppc64el 1.11.0-1 [74.2 kB] 191s Get:158 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-convert-case-dev ppc64el 0.6.0-2 [19.5 kB] 191s Get:159 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-semver-dev ppc64el 1.0.23-1 [30.6 kB] 191s Get:160 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rustc-version-dev ppc64el 0.4.0-1 [13.8 kB] 191s Get:161 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-derive-more-0.99-dev ppc64el 0.99.18-1 [49.9 kB] 191s Get:162 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-cfg-if-0.1-dev ppc64el 0.1.10-2 [10.2 kB] 191s Get:163 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-blobby-dev ppc64el 0.3.1-1 [11.3 kB] 191s Get:164 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-typenum-dev ppc64el 1.17.0-2 [41.2 kB] 191s Get:165 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-zeroize-derive-dev ppc64el 1.4.2-1 [12.7 kB] 191s Get:166 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-zeroize-dev ppc64el 1.8.1-1 [21.6 kB] 191s Get:167 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-generic-array-dev ppc64el 0.14.7-1 [16.9 kB] 191s Get:168 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-block-buffer-dev ppc64el 0.10.2-2 [12.2 kB] 191s Get:169 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-const-oid-dev ppc64el 0.9.3-1 [40.9 kB] 191s Get:170 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-crypto-common-dev ppc64el 0.1.6-1 [10.5 kB] 191s Get:171 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-subtle-dev ppc64el 2.6.1-1 [16.1 kB] 191s Get:172 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-digest-dev ppc64el 0.10.7-2 [20.9 kB] 191s Get:173 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-static-assertions-dev ppc64el 1.1.0-1 [19.0 kB] 191s Get:174 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-twox-hash-dev ppc64el 1.6.3-1 [21.6 kB] 191s Get:175 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ruzstd-dev ppc64el 0.5.0-1 [44.6 kB] 191s Get:176 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-object-dev ppc64el 0.32.2-1 [228 kB] 191s Get:177 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rustc-demangle-dev ppc64el 0.1.21-1 [27.7 kB] 191s Get:178 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-addr2line-dev ppc64el 0.21.0-2 [36.4 kB] 191s Get:179 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-aho-corasick-dev ppc64el 1.1.3-1 [146 kB] 191s Get:180 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bitflags-1-dev ppc64el 1.3.2-5 [25.3 kB] 191s Get:181 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-anes-dev ppc64el 0.1.6-1 [21.1 kB] 191s Get:182 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-anstyle-dev ppc64el 1.0.8-1 [16.7 kB] 191s Get:183 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-arrayvec-dev ppc64el 0.7.4-2 [29.9 kB] 191s Get:184 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-utf8parse-dev ppc64el 0.2.1-1 [15.0 kB] 191s Get:185 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-anstyle-parse-dev ppc64el 0.2.1-1 [17.1 kB] 191s Get:186 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-anstyle-query-dev ppc64el 1.0.0-1 [9774 B] 191s Get:187 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-colorchoice-dev ppc64el 1.0.0-1 [8338 B] 191s Get:188 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-anstream-dev ppc64el 0.6.15-1 [25.7 kB] 191s Get:189 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-jobserver-dev ppc64el 0.1.32-1 [29.1 kB] 191s Get:190 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-shlex-dev ppc64el 1.3.0-1 [20.1 kB] 191s Get:191 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-cc-dev ppc64el 1.1.14-1 [73.6 kB] 191s Get:192 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-backtrace-dev ppc64el 0.3.69-2 [69.9 kB] 191s Get:193 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-anyhow-dev ppc64el 1.0.86-1 [44.3 kB] 191s Get:194 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bytecheck-derive-dev ppc64el 0.6.12-1 [7090 B] 191s Get:195 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ptr-meta-derive-dev ppc64el 0.1.4-1 [3966 B] 191s Get:196 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ptr-meta-dev ppc64el 0.1.4-1 [7340 B] 191s Get:197 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-simdutf8-dev ppc64el 0.1.4-4 [27.2 kB] 191s Get:198 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bytemuck-derive-dev ppc64el 1.5.0-2 [18.7 kB] 191s Get:199 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bytemuck-dev ppc64el 1.14.0-1 [42.7 kB] 191s Get:200 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-atomic-dev ppc64el 0.6.0-1 [15.5 kB] 191s Get:201 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-md5-asm-dev ppc64el 0.5.0-2 [7514 B] 191s Get:202 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-md-5-dev ppc64el 0.10.6-1 [17.5 kB] 192s Get:203 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-cpufeatures-dev ppc64el 0.2.11-1 [14.9 kB] 192s Get:204 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sha1-asm-dev ppc64el 0.5.1-2 [8058 B] 192s Get:205 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sha1-dev ppc64el 0.10.6-1 [16.0 kB] 192s Get:206 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-slog-dev ppc64el 2.7.0-1 [44.0 kB] 192s Get:207 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-uuid-dev ppc64el 1.10.0-1 [44.2 kB] 192s Get:208 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bytecheck-dev ppc64el 0.6.12-1 [10.2 kB] 192s Get:209 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-autocfg-dev ppc64el 1.1.0-1 [15.1 kB] 192s Get:210 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-num-traits-dev ppc64el 0.2.19-2 [46.2 kB] 192s Get:211 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-funty-dev ppc64el 2.0.0-1 [13.8 kB] 192s Get:212 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-radium-dev ppc64el 1.1.0-1 [14.9 kB] 192s Get:213 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tap-dev ppc64el 1.0.1-1 [12.7 kB] 192s Get:214 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-traitobject-dev ppc64el 0.1.0-1 [4542 B] 192s Get:215 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-unsafe-any-dev ppc64el 0.4.2-2 [4626 B] 192s Get:216 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-typemap-dev ppc64el 0.3.3-2 [6726 B] 192s Get:217 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wyz-dev ppc64el 0.5.1-1 [19.7 kB] 192s Get:218 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bitvec-dev ppc64el 1.0.1-1 [179 kB] 192s Get:219 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bytes-dev ppc64el 1.5.0-1 [51.5 kB] 192s Get:220 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rend-dev ppc64el 0.4.0-1 [10.3 kB] 192s Get:221 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rkyv-derive-dev ppc64el 0.7.44-1 [17.5 kB] 192s Get:222 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-seahash-dev ppc64el 4.1.0-1 [25.1 kB] 192s Get:223 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-smol-str-dev ppc64el 0.2.0-1 [15.2 kB] 192s Get:224 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tinyvec-dev ppc64el 1.6.0-2 [37.7 kB] 192s Get:225 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tinyvec-macros-dev ppc64el 0.1.0-1 [3856 B] 192s Get:226 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tinyvec+tinyvec-macros-dev ppc64el 1.6.0-2 [1128 B] 192s Get:227 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rkyv-dev ppc64el 0.7.44-1 [94.4 kB] 192s Get:228 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-num-complex-dev ppc64el 0.4.6-2 [30.8 kB] 192s Get:229 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-approx-dev ppc64el 0.5.1-1 [16.0 kB] 192s Get:230 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-array-init-dev ppc64el 2.0.1-1 [12.3 kB] 192s Get:231 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-attributes-dev all 1.1.2-6 [6756 B] 192s Get:232 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-concurrent-queue-dev ppc64el 2.5.0-4 [23.9 kB] 192s Get:233 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-parking-dev ppc64el 2.2.0-1 [11.6 kB] 192s Get:234 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pin-project-lite-dev ppc64el 0.2.13-1 [30.2 kB] 192s Get:235 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-event-listener-dev all 5.3.1-8 [29.6 kB] 192s Get:236 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-event-listener-strategy-dev ppc64el 0.5.2-3 [12.7 kB] 192s Get:237 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-futures-core-dev ppc64el 0.3.30-1 [16.7 kB] 192s Get:238 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-channel-dev all 2.3.1-8 [13.1 kB] 192s Get:239 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-task-dev all 4.7.1-3 [29.4 kB] 192s Get:240 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-fastrand-dev ppc64el 2.1.1-1 [17.8 kB] 192s Get:241 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-futures-io-dev ppc64el 0.3.30-2 [11.0 kB] 192s Get:242 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-futures-lite-dev ppc64el 2.3.0-2 [38.6 kB] 192s Get:243 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-slab-dev ppc64el 0.4.9-1 [21.2 kB] 192s Get:244 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-executor-dev all 1.13.1-1 [18.7 kB] 192s Get:245 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-lock-dev all 3.4.0-4 [29.3 kB] 192s Get:246 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-atomic-waker-dev ppc64el 1.1.2-1 [14.3 kB] 192s Get:247 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tracing-attributes-dev ppc64el 0.1.27-1 [33.3 kB] 192s Get:248 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-valuable-derive-dev ppc64el 0.1.0-1 [5946 B] 192s Get:249 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-valuable-dev ppc64el 0.1.0-4 [23.5 kB] 192s Get:250 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tracing-core-dev ppc64el 0.1.32-1 [53.8 kB] 192s Get:251 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tracing-dev ppc64el 0.1.40-1 [69.5 kB] 192s Get:252 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-blocking-dev all 1.6.1-5 [17.5 kB] 192s Get:253 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-fs-dev all 2.1.2-4 [15.3 kB] 192s Get:254 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bitflags-dev ppc64el 2.6.0-1 [41.1 kB] 192s Get:255 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-compiler-builtins+core-dev ppc64el 0.1.101-1 [1092 B] 192s Get:256 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-compiler-builtins+rustc-dep-of-std-dev ppc64el 0.1.101-1 [1104 B] 192s Get:257 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-errno-dev ppc64el 0.3.8-1 [13.0 kB] 192s Get:258 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-linux-raw-sys-dev ppc64el 0.4.14-1 [138 kB] 192s Get:259 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rustix-dev ppc64el 0.38.32-1 [274 kB] 192s Get:260 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-polling-dev ppc64el 3.4.0-1 [47.8 kB] 192s Get:261 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-io-dev ppc64el 2.3.3-4 [41.0 kB] 192s Get:262 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-mio-dev ppc64el 1.0.2-2 [87.6 kB] 192s Get:263 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-owning-ref-dev ppc64el 0.4.1-1 [13.7 kB] 192s Get:264 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-scopeguard-dev ppc64el 1.2.0-1 [13.3 kB] 192s Get:265 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-lock-api-dev ppc64el 0.4.12-1 [22.9 kB] 192s Get:266 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-parking-lot-dev ppc64el 0.12.1-2build1 [37.8 kB] 192s Get:267 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-signal-hook-registry-dev ppc64el 1.4.0-1 [19.2 kB] 192s Get:268 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-socket2-dev ppc64el 0.5.7-1 [48.3 kB] 192s Get:269 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tokio-macros-dev ppc64el 2.4.0-2 [14.0 kB] 193s Get:270 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tokio-dev ppc64el 1.39.3-3 [561 kB] 193s Get:271 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-global-executor-dev ppc64el 2.4.1-5 [14.6 kB] 193s Get:272 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-net-dev all 2.0.0-4 [14.6 kB] 193s Get:273 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-signal-dev ppc64el 0.2.10-1 [16.0 kB] 193s Get:274 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-process-dev all 2.3.0-1 [21.2 kB] 193s Get:275 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-kv-log-macro-dev all 1.0.8-4 [7290 B] 193s Get:276 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pin-utils-dev ppc64el 0.1.0-1 [9340 B] 193s Get:277 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-async-std-dev all 1.12.0-22 [168 kB] 193s Get:278 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-base64-dev ppc64el 0.21.7-1 [65.1 kB] 193s Get:279 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bit-vec-dev ppc64el 0.6.3-1 [21.1 kB] 193s Get:280 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bit-set-dev ppc64el 0.5.2-1 [15.7 kB] 193s Get:281 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bit-set+std-dev ppc64el 0.5.2-1 [1088 B] 193s Get:282 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-regex-syntax-dev ppc64el 0.8.2-1 [200 kB] 193s Get:283 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-regex-automata-dev ppc64el 0.4.7-1 [424 kB] 193s Get:284 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bstr-dev ppc64el 1.7.0-2build1 [271 kB] 193s Get:285 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-bumpalo-dev ppc64el 3.16.0-1 [75.7 kB] 193s Get:286 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-cast-dev ppc64el 0.3.0-1 [13.1 kB] 193s Get:287 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-iana-time-zone-dev ppc64el 0.1.60-1 [25.1 kB] 193s Get:288 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wasm-bindgen-shared-dev ppc64el 0.2.87-1 [9094 B] 193s Get:289 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wasm-bindgen-backend-dev ppc64el 0.2.87-1 [27.0 kB] 193s Get:290 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wasm-bindgen-macro-support-dev ppc64el 0.2.87-1 [21.2 kB] 193s Get:291 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wasm-bindgen-macro-dev ppc64el 0.2.87-1 [16.6 kB] 193s Get:292 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wasm-bindgen-dev ppc64el 0.2.87-1 [157 kB] 193s Get:293 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wasm-bindgen-macro-support+spans-dev ppc64el 0.2.87-1 [1078 B] 193s Get:294 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wasm-bindgen-macro+spans-dev ppc64el 0.2.87-1 [1060 B] 193s Get:295 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wasm-bindgen+spans-dev ppc64el 0.2.87-1 [1040 B] 193s Get:296 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wasm-bindgen+default-dev ppc64el 0.2.87-1 [1048 B] 193s Get:297 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-js-sys-dev ppc64el 0.3.64-1 [71.9 kB] 193s Get:298 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pure-rust-locales-dev ppc64el 0.8.1-1 [112 kB] 193s Get:299 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-chrono-dev ppc64el 0.4.38-2 [172 kB] 193s Get:300 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-regex-dev ppc64el 1.10.6-1 [199 kB] 193s Get:301 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-parse-zoneinfo-dev ppc64el 0.3.0-1 [71.0 kB] 193s Get:302 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-siphasher-dev ppc64el 0.3.10-1 [12.0 kB] 193s Get:303 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-phf-shared-dev ppc64el 0.11.2-1 [15.6 kB] 193s Get:304 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-phf-dev ppc64el 0.11.2-1 [21.6 kB] 193s Get:305 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-uncased-dev ppc64el 0.9.6-2 [12.2 kB] 193s Get:306 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-phf-shared+uncased-dev ppc64el 0.11.2-1 [1030 B] 193s Get:307 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-phf+uncased-dev ppc64el 0.11.2-1 [1030 B] 193s Get:308 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ciborium-io-dev ppc64el 0.2.2-1 [8184 B] 193s Get:309 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-half-dev ppc64el 1.8.2-4 [34.8 kB] 193s Get:310 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ciborium-ll-dev ppc64el 0.2.2-1 [15.8 kB] 193s Get:311 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ciborium-dev ppc64el 0.2.2-2 [32.6 kB] 193s Get:312 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-clap-lex-dev ppc64el 0.7.2-2 [14.3 kB] 193s Get:313 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-strsim-dev ppc64el 0.11.1-1 [15.9 kB] 193s Get:314 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-terminal-size-dev ppc64el 0.3.0-2 [12.6 kB] 193s Get:315 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-unicase-dev ppc64el 2.7.0-1 [19.4 kB] 193s Get:316 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-unicode-width-dev ppc64el 0.1.13-3 [325 kB] 193s Get:317 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-clap-builder-dev ppc64el 4.5.15-2 [135 kB] 193s Get:318 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-heck-dev ppc64el 0.4.1-1 [13.3 kB] 193s Get:319 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-clap-derive-dev ppc64el 4.5.13-2 [29.3 kB] 193s Get:320 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-clap-dev ppc64el 4.5.16-1 [52.3 kB] 193s Get:321 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-csv-core-dev ppc64el 0.1.11-1 [25.9 kB] 193s Get:322 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-csv-dev ppc64el 1.3.0-1 [729 kB] 194s Get:323 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-futures-sink-dev ppc64el 0.3.31-1 [10.1 kB] 194s Get:324 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-futures-channel-dev ppc64el 0.3.30-1 [31.8 kB] 194s Get:325 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-futures-task-dev ppc64el 0.3.30-1 [13.5 kB] 194s Get:326 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-futures-macro-dev ppc64el 0.3.30-1 [13.3 kB] 194s Get:327 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-futures-util-dev ppc64el 0.3.30-2 [127 kB] 194s Get:328 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-num-cpus-dev ppc64el 1.16.0-1 [18.1 kB] 194s Get:329 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-futures-executor-dev ppc64el 0.3.30-1 [19.8 kB] 194s Get:330 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-futures-dev ppc64el 0.3.30-2 [53.2 kB] 194s Get:331 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-is-terminal-dev ppc64el 0.4.13-1 [8268 B] 194s Get:332 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-itertools-dev ppc64el 0.10.5-1 [101 kB] 194s Get:333 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-oorandom-dev ppc64el 11.1.3-1 [11.3 kB] 194s Get:334 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-winapi-i686-pc-windows-gnu-dev ppc64el 0.4.0-1 [3648 B] 194s Get:335 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-winapi-x86-64-pc-windows-gnu-dev ppc64el 0.4.0-1 [3660 B] 194s Get:336 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-winapi-dev ppc64el 0.3.9-1 [953 kB] 194s Get:337 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-dirs-sys-next-dev ppc64el 0.1.1-1 [12.1 kB] 194s Get:338 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-dirs-next-dev ppc64el 2.0.0-1 [13.1 kB] 194s Get:339 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-float-ord-dev ppc64el 0.3.2-1 [9402 B] 194s Get:340 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-cmake-dev ppc64el 0.1.45-1 [16.0 kB] 194s Get:341 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-freetype-sys-dev ppc64el 0.13.1-1 [11.8 kB] 194s Get:342 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-freetype-dev ppc64el 0.7.0-4 [20.4 kB] 194s Get:343 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-spin-dev ppc64el 0.9.8-4 [33.4 kB] 194s Get:344 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-lazy-static-dev ppc64el 1.4.0-2 [12.5 kB] 194s Get:345 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pathfinder-simd-dev ppc64el 0.5.2-1 [20.1 kB] 194s Get:346 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pathfinder-geometry-dev ppc64el 0.5.1-1 [13.2 kB] 194s Get:347 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-winapi-util-dev ppc64el 0.1.6-1 [14.0 kB] 194s Get:348 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-same-file-dev ppc64el 1.0.6-1 [11.5 kB] 194s Get:349 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-walkdir-dev ppc64el 2.5.0-1 [24.5 kB] 194s Get:350 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-const-cstr-dev ppc64el 0.3.0-1 [9070 B] 194s Get:351 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-libloading-dev ppc64el 0.8.5-1 [29.2 kB] 194s Get:352 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-dlib-dev ppc64el 0.5.2-2 [7972 B] 194s Get:353 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-yeslogic-fontconfig-sys-dev ppc64el 3.0.1-1 [8106 B] 194s Get:354 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-font-kit-dev ppc64el 0.11.0-2 [56.2 kB] 194s Get:355 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-color-quant-dev ppc64el 1.1.0-1 [8468 B] 194s Get:356 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-weezl-dev ppc64el 0.1.5-1 [30.3 kB] 194s Get:357 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-gif-dev ppc64el 0.11.3-1 [31.9 kB] 194s Get:358 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-jpeg-decoder-dev ppc64el 0.3.0-1 [717 kB] 194s Get:359 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-num-integer-dev ppc64el 0.1.46-1 [22.6 kB] 194s Get:360 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-humantime-dev ppc64el 2.1.0-1 [18.2 kB] 194s Get:361 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-termcolor-dev ppc64el 1.4.1-1 [19.7 kB] 194s Get:362 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-env-logger-dev ppc64el 0.10.2-2 [34.4 kB] 194s Get:363 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-quickcheck-dev ppc64el 1.0.3-3 [27.9 kB] 194s Get:364 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-num-bigint-dev ppc64el 0.4.6-1 [84.9 kB] 194s Get:365 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-num-rational-dev ppc64el 0.4.2-1 [28.7 kB] 194s Get:366 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-png-dev ppc64el 0.17.7-3 [63.4 kB] 194s Get:367 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-qoi-dev ppc64el 0.4.1-2 [56.7 kB] 194s Get:368 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tiff-dev ppc64el 0.9.0-1 [1413 kB] 194s Get:369 http://ftpmaster.internal/ubuntu plucky/main ppc64el libsharpyuv0 ppc64el 1.4.0-0.1 [22.0 kB] 194s Get:370 http://ftpmaster.internal/ubuntu plucky/main ppc64el libwebp7 ppc64el 1.4.0-0.1 [309 kB] 194s Get:371 http://ftpmaster.internal/ubuntu plucky/main ppc64el libwebpdemux2 ppc64el 1.4.0-0.1 [14.1 kB] 194s Get:372 http://ftpmaster.internal/ubuntu plucky/main ppc64el libwebpmux3 ppc64el 1.4.0-0.1 [31.4 kB] 194s Get:373 http://ftpmaster.internal/ubuntu plucky/main ppc64el libwebpdecoder3 ppc64el 1.4.0-0.1 [144 kB] 194s Get:374 http://ftpmaster.internal/ubuntu plucky/main ppc64el libsharpyuv-dev ppc64el 1.4.0-0.1 [24.4 kB] 194s Get:375 http://ftpmaster.internal/ubuntu plucky/main ppc64el libwebp-dev ppc64el 1.4.0-0.1 [451 kB] 194s Get:376 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-libwebp-sys-dev ppc64el 0.9.5-1build1 [1357 kB] 194s Get:377 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-webp-dev ppc64el 0.2.6-1 [1846 kB] 194s Get:378 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-image-dev ppc64el 0.24.7-2 [229 kB] 194s Get:379 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-plotters-backend-dev ppc64el 0.3.5-1 [15.3 kB] 194s Get:380 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-plotters-bitmap-dev ppc64el 0.3.3-3 [17.1 kB] 194s Get:381 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-plotters-svg-dev ppc64el 0.3.5-1 [9258 B] 194s Get:382 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-web-sys-dev ppc64el 0.3.64-2 [581 kB] 194s Get:383 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-plotters-dev ppc64el 0.3.5-4 [118 kB] 194s Get:384 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-smol-dev all 2.0.2-1 [205 kB] 194s Get:385 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tinytemplate-dev ppc64el 1.2.1-1 [26.8 kB] 194s Get:386 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-criterion-dev all 0.5.1-6 [104 kB] 194s Get:387 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-phf-generator-dev ppc64el 0.11.2-2 [12.3 kB] 194s Get:388 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-phf-codegen-dev ppc64el 0.11.2-1 [14.3 kB] 194s Get:389 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-chrono-tz-build-dev ppc64el 0.2.1-1 [12.1 kB] 194s Get:390 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-chrono-tz-dev ppc64el 0.8.6-2 [513 kB] 194s Get:391 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ctor-dev ppc64el 0.1.26-1 [12.0 kB] 194s Get:392 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-powerfmt-macros-dev ppc64el 0.1.0-1 [10.5 kB] 194s Get:393 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-powerfmt-dev ppc64el 0.2.0-1 [16.5 kB] 194s Get:394 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-deranged-dev ppc64el 0.3.11-1 [18.4 kB] 194s Get:395 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-eui48-dev ppc64el 1.1.0-2 [16.1 kB] 194s Get:396 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-indenter-dev ppc64el 0.3.3-1 [8648 B] 194s Get:397 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-eyre-dev ppc64el 0.6.12-1 [38.0 kB] 194s Get:398 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-eyre+default-dev ppc64el 0.6.12-1 [1050 B] 194s Get:399 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-fancy-regex-dev ppc64el 0.11.0-2 [54.7 kB] 194s Get:400 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-fnv-dev ppc64el 1.0.7-1 [12.8 kB] 194s Get:401 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-geo-types-dev ppc64el 0.7.11-2 [32.8 kB] 194s Get:402 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-ghost-dev ppc64el 0.1.5-1 [16.1 kB] 195s Get:403 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-hmac-dev ppc64el 0.12.1-1 [43.9 kB] 195s Get:404 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-indoc-dev ppc64el 2.0.5-1 [16.7 kB] 195s Get:405 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-inventory-dev ppc64el 0.3.2-1 [13.5 kB] 195s Get:406 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-memoffset-dev ppc64el 0.8.0-1 [10.9 kB] 195s Get:407 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-num-threads-dev ppc64el 0.1.7-1 [9156 B] 195s Get:408 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-postgres-derive-dev ppc64el 0.4.5-1 [13.4 kB] 195s Get:409 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sha2-asm-dev ppc64el 0.6.2-2 [14.4 kB] 195s Get:410 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-sha2-dev ppc64el 0.10.8-1 [25.6 kB] 195s Get:411 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-unicode-bidi-dev ppc64el 0.3.13-1 [39.9 kB] 195s Get:412 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-unicode-normalization-dev ppc64el 0.1.22-1 [104 kB] 195s Get:413 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-stringprep-dev ppc64el 0.1.2-1 [16.5 kB] 195s Get:414 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-postgres-protocol-dev ppc64el 0.6.6-2 [25.9 kB] 195s Get:415 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-time-core-dev ppc64el 0.1.2-1 [9138 B] 195s Get:416 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-time-macros-dev ppc64el 0.2.16-1 [25.1 kB] 195s Get:417 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-time-dev ppc64el 0.3.31-2 [101 kB] 195s Get:418 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-postgres-types-dev ppc64el 0.2.6-2 [30.1 kB] 195s Get:419 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rand-xorshift-dev ppc64el 0.3.0-2 [10.9 kB] 195s Get:420 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-quick-error-dev ppc64el 2.0.1-1 [15.6 kB] 195s Get:421 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-tempfile-dev ppc64el 3.10.1-1 [33.7 kB] 195s Get:422 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rusty-fork-dev ppc64el 0.3.0-1 [20.4 kB] 195s Get:423 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-wait-timeout-dev ppc64el 0.2.0-1 [14.2 kB] 195s Get:424 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rusty-fork+wait-timeout-dev ppc64el 0.3.0-1 [1134 B] 195s Get:425 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-unarray-dev ppc64el 0.1.4-1 [14.6 kB] 195s Get:426 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-proptest-dev ppc64el 1.5.0-2 [171 kB] 195s Get:427 http://ftpmaster.internal/ubuntu plucky/universe ppc64el llvm-19-runtime ppc64el 1:19.1.2-1ubuntu1 [589 kB] 195s Get:428 http://ftpmaster.internal/ubuntu plucky/universe ppc64el llvm-runtime ppc64el 1:19.0-60~exp1 [5610 B] 195s Get:429 http://ftpmaster.internal/ubuntu plucky/universe ppc64el llvm-19-linker-tools ppc64el 1:19.1.2-1ubuntu1 [1373 kB] 195s Get:430 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libpfm4 ppc64el 4.13.0+git83-g91970fe-1 [181 kB] 195s Get:431 http://ftpmaster.internal/ubuntu plucky/universe ppc64el llvm-19 ppc64el 1:19.1.2-1ubuntu1 [19.5 MB] 196s Get:432 http://ftpmaster.internal/ubuntu plucky/universe ppc64el llvm ppc64el 1:19.0-60~exp1 [4146 B] 196s Get:433 http://ftpmaster.internal/ubuntu plucky/universe ppc64el binutils-mingw-w64-x86-64 ppc64el 2.43.1-4ubuntu1+12 [3877 kB] 196s Get:434 http://ftpmaster.internal/ubuntu plucky/universe ppc64el binutils-mingw-w64-i686 ppc64el 2.43.1-4ubuntu1+12 [3595 kB] 196s Get:435 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-python3-dll-a-dev ppc64el 0.2.10-1 [31.6 kB] 196s Get:436 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-target-lexicon-dev ppc64el 0.12.14-1 [25.1 kB] 196s Get:437 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pyo3-build-config-dev ppc64el 0.22.5-1 [30.7 kB] 196s Get:438 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3.12-dev ppc64el 3.12.7-2 [505 kB] 196s Get:439 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pyo3-ffi-dev ppc64el 0.22.5-1 [62.5 kB] 196s Get:440 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pyo3-macros-backend-dev ppc64el 0.22.5-1 [58.5 kB] 196s Get:441 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pyo3-macros-dev ppc64el 0.22.5-1 [10.3 kB] 196s Get:442 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rust-decimal-dev ppc64el 1.36.0-1 [114 kB] 196s Get:443 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-unindent-dev ppc64el 0.2.3-1 [9190 B] 197s Get:444 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-pyo3-dev ppc64el 0.22.5-1 [415 kB] 197s Get:445 http://ftpmaster.internal/ubuntu plucky/universe ppc64el librust-rustc-hash-dev ppc64el 1.1.0-1 [10.8 kB] 197s Get:446 http://ftpmaster.internal/ubuntu plucky/universe ppc64el pybuild-plugin-autopkgtest all 6.20241024 [1746 B] 197s Get:447 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-packaging all 24.1-1 [41.4 kB] 197s Get:448 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pyproject-hooks all 1.2.0-1 [10.2 kB] 197s Get:449 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-toml all 0.10.2-1 [16.5 kB] 197s Get:450 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-wheel all 0.44.0-1 [54.2 kB] 197s Get:451 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-build all 1.2.2-1 [31.0 kB] 197s Get:452 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-installer all 0.7.0+dfsg1-3 [17.4 kB] 197s Get:453 http://ftpmaster.internal/ubuntu plucky/universe ppc64el pybuild-plugin-pyproject all 6.20241024 [1728 B] 197s Get:454 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-all ppc64el 3.12.6-0ubuntu1 [888 B] 197s Get:455 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-six all 1.16.0-7 [13.1 kB] 197s Get:456 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-dateutil all 2.9.0-2 [80.3 kB] 197s Get:457 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-sortedcontainers all 2.4.0-2 [27.6 kB] 197s Get:458 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-hypothesis all 6.105.1-1 [321 kB] 197s Get:459 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-iniconfig all 1.1.1-2 [6024 B] 197s Get:460 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pluggy all 1.5.0-1 [21.0 kB] 197s Get:461 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pytest all 8.3.2-1 [251 kB] 197s Get:462 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-regex ppc64el 0.1.20240724-1 [320 kB] 197s Get:463 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-semantic-version all 2.10.0-2 [15.1 kB] 197s Get:464 http://ftpmaster.internal/ubuntu plucky/main ppc64el rustc ppc64el 1.80.1ubuntu2 [2760 B] 197s Get:465 http://ftpmaster.internal/ubuntu plucky/main ppc64el cargo ppc64el 1.80.1ubuntu2 [2244 B] 197s Get:466 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-setuptools-rust all 1.9.0+dfsg-2 [23.1 kB] 197s Get:467 http://ftpmaster.internal/ubuntu plucky-proposed/universe ppc64el python3-tiktoken ppc64el 0.8.0-1 [728 kB] 198s Fetched 215 MB in 12s (17.5 MB/s) 198s Selecting previously unselected package m4. 198s (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 ... 73777 files and directories currently installed.) 198s Preparing to unpack .../000-m4_1.4.19-4build1_ppc64el.deb ... 198s Unpacking m4 (1.4.19-4build1) ... 198s Selecting previously unselected package autoconf. 198s Preparing to unpack .../001-autoconf_2.72-3_all.deb ... 198s Unpacking autoconf (2.72-3) ... 198s Selecting previously unselected package autotools-dev. 198s Preparing to unpack .../002-autotools-dev_20220109.1_all.deb ... 198s Unpacking autotools-dev (20220109.1) ... 198s Selecting previously unselected package automake. 198s Preparing to unpack .../003-automake_1%3a1.16.5-1.3ubuntu1_all.deb ... 198s Unpacking automake (1:1.16.5-1.3ubuntu1) ... 198s Selecting previously unselected package autopoint. 198s Preparing to unpack .../004-autopoint_0.22.5-2_all.deb ... 198s Unpacking autopoint (0.22.5-2) ... 198s Selecting previously unselected package libisl23:ppc64el. 198s Preparing to unpack .../005-libisl23_0.27-1_ppc64el.deb ... 198s Unpacking libisl23:ppc64el (0.27-1) ... 198s Selecting previously unselected package libmpc3:ppc64el. 198s Preparing to unpack .../006-libmpc3_1.3.1-1build2_ppc64el.deb ... 198s Unpacking libmpc3:ppc64el (1.3.1-1build2) ... 198s Selecting previously unselected package cpp-14-powerpc64le-linux-gnu. 198s Preparing to unpack .../007-cpp-14-powerpc64le-linux-gnu_14.2.0-7ubuntu1_ppc64el.deb ... 198s Unpacking cpp-14-powerpc64le-linux-gnu (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package cpp-14. 199s Preparing to unpack .../008-cpp-14_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking cpp-14 (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package cpp-powerpc64le-linux-gnu. 199s Preparing to unpack .../009-cpp-powerpc64le-linux-gnu_4%3a14.1.0-2ubuntu1_ppc64el.deb ... 199s Unpacking cpp-powerpc64le-linux-gnu (4:14.1.0-2ubuntu1) ... 199s Selecting previously unselected package cpp. 199s Preparing to unpack .../010-cpp_4%3a14.1.0-2ubuntu1_ppc64el.deb ... 199s Unpacking cpp (4:14.1.0-2ubuntu1) ... 199s Selecting previously unselected package libcc1-0:ppc64el. 199s Preparing to unpack .../011-libcc1-0_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking libcc1-0:ppc64el (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package libgomp1:ppc64el. 199s Preparing to unpack .../012-libgomp1_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking libgomp1:ppc64el (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package libitm1:ppc64el. 199s Preparing to unpack .../013-libitm1_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking libitm1:ppc64el (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package libasan8:ppc64el. 199s Preparing to unpack .../014-libasan8_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking libasan8:ppc64el (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package liblsan0:ppc64el. 199s Preparing to unpack .../015-liblsan0_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking liblsan0:ppc64el (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package libtsan2:ppc64el. 199s Preparing to unpack .../016-libtsan2_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking libtsan2:ppc64el (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package libubsan1:ppc64el. 199s Preparing to unpack .../017-libubsan1_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking libubsan1:ppc64el (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package libquadmath0:ppc64el. 199s Preparing to unpack .../018-libquadmath0_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking libquadmath0:ppc64el (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package libgcc-14-dev:ppc64el. 199s Preparing to unpack .../019-libgcc-14-dev_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking libgcc-14-dev:ppc64el (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package gcc-14-powerpc64le-linux-gnu. 199s Preparing to unpack .../020-gcc-14-powerpc64le-linux-gnu_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking gcc-14-powerpc64le-linux-gnu (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package gcc-14. 199s Preparing to unpack .../021-gcc-14_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking gcc-14 (14.2.0-7ubuntu1) ... 199s Selecting previously unselected package gcc-powerpc64le-linux-gnu. 199s Preparing to unpack .../022-gcc-powerpc64le-linux-gnu_4%3a14.1.0-2ubuntu1_ppc64el.deb ... 199s Unpacking gcc-powerpc64le-linux-gnu (4:14.1.0-2ubuntu1) ... 199s Selecting previously unselected package gcc. 199s Preparing to unpack .../023-gcc_4%3a14.1.0-2ubuntu1_ppc64el.deb ... 199s Unpacking gcc (4:14.1.0-2ubuntu1) ... 199s Selecting previously unselected package libstdc++-14-dev:ppc64el. 199s Preparing to unpack .../024-libstdc++-14-dev_14.2.0-7ubuntu1_ppc64el.deb ... 199s Unpacking libstdc++-14-dev:ppc64el (14.2.0-7ubuntu1) ... 200s Selecting previously unselected package g++-14-powerpc64le-linux-gnu. 200s Preparing to unpack .../025-g++-14-powerpc64le-linux-gnu_14.2.0-7ubuntu1_ppc64el.deb ... 200s Unpacking g++-14-powerpc64le-linux-gnu (14.2.0-7ubuntu1) ... 200s Selecting previously unselected package g++-14. 200s Preparing to unpack .../026-g++-14_14.2.0-7ubuntu1_ppc64el.deb ... 200s Unpacking g++-14 (14.2.0-7ubuntu1) ... 200s Selecting previously unselected package g++-powerpc64le-linux-gnu. 200s Preparing to unpack .../027-g++-powerpc64le-linux-gnu_4%3a14.1.0-2ubuntu1_ppc64el.deb ... 200s Unpacking g++-powerpc64le-linux-gnu (4:14.1.0-2ubuntu1) ... 200s Selecting previously unselected package g++. 200s Preparing to unpack .../028-g++_4%3a14.1.0-2ubuntu1_ppc64el.deb ... 200s Unpacking g++ (4:14.1.0-2ubuntu1) ... 200s Selecting previously unselected package build-essential. 200s Preparing to unpack .../029-build-essential_12.10ubuntu1_ppc64el.deb ... 200s Unpacking build-essential (12.10ubuntu1) ... 200s Selecting previously unselected package libhttp-parser2.9:ppc64el. 200s Preparing to unpack .../030-libhttp-parser2.9_2.9.4-6build1_ppc64el.deb ... 200s Unpacking libhttp-parser2.9:ppc64el (2.9.4-6build1) ... 200s Selecting previously unselected package libgit2-1.7:ppc64el. 200s Preparing to unpack .../031-libgit2-1.7_1.7.2+ds-1ubuntu3_ppc64el.deb ... 200s Unpacking libgit2-1.7:ppc64el (1.7.2+ds-1ubuntu3) ... 200s Selecting previously unselected package libstd-rust-1.80:ppc64el. 200s Preparing to unpack .../032-libstd-rust-1.80_1.80.1+dfsg0ubuntu1-0ubuntu1_ppc64el.deb ... 200s Unpacking libstd-rust-1.80:ppc64el (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 200s Selecting previously unselected package libstd-rust-1.80-dev:ppc64el. 200s Preparing to unpack .../033-libstd-rust-1.80-dev_1.80.1+dfsg0ubuntu1-0ubuntu1_ppc64el.deb ... 200s Unpacking libstd-rust-1.80-dev:ppc64el (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 201s Selecting previously unselected package rustc-1.80. 201s Preparing to unpack .../034-rustc-1.80_1.80.1+dfsg0ubuntu1-0ubuntu1_ppc64el.deb ... 201s Unpacking rustc-1.80 (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 201s Selecting previously unselected package cargo-1.80. 201s Preparing to unpack .../035-cargo-1.80_1.80.1+dfsg0ubuntu1-0ubuntu1_ppc64el.deb ... 201s Unpacking cargo-1.80 (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 201s Selecting previously unselected package libjsoncpp25:ppc64el. 201s Preparing to unpack .../036-libjsoncpp25_1.9.5-6build1_ppc64el.deb ... 201s Unpacking libjsoncpp25:ppc64el (1.9.5-6build1) ... 201s Selecting previously unselected package librhash0:ppc64el. 201s Preparing to unpack .../037-librhash0_1.4.3-3build1_ppc64el.deb ... 201s Unpacking librhash0:ppc64el (1.4.3-3build1) ... 201s Selecting previously unselected package cmake-data. 201s Preparing to unpack .../038-cmake-data_3.30.3-1_all.deb ... 201s Unpacking cmake-data (3.30.3-1) ... 202s Selecting previously unselected package cmake. 202s Preparing to unpack .../039-cmake_3.30.3-1_ppc64el.deb ... 202s Unpacking cmake (3.30.3-1) ... 202s Selecting previously unselected package libdebhelper-perl. 202s Preparing to unpack .../040-libdebhelper-perl_13.20ubuntu1_all.deb ... 202s Unpacking libdebhelper-perl (13.20ubuntu1) ... 202s Selecting previously unselected package libtool. 202s Preparing to unpack .../041-libtool_2.4.7-7build1_all.deb ... 202s Unpacking libtool (2.4.7-7build1) ... 202s Selecting previously unselected package dh-autoreconf. 202s Preparing to unpack .../042-dh-autoreconf_20_all.deb ... 202s Unpacking dh-autoreconf (20) ... 202s Selecting previously unselected package libarchive-zip-perl. 202s Preparing to unpack .../043-libarchive-zip-perl_1.68-1_all.deb ... 202s Unpacking libarchive-zip-perl (1.68-1) ... 202s Selecting previously unselected package libfile-stripnondeterminism-perl. 202s Preparing to unpack .../044-libfile-stripnondeterminism-perl_1.14.0-1_all.deb ... 202s Unpacking libfile-stripnondeterminism-perl (1.14.0-1) ... 202s Selecting previously unselected package dh-strip-nondeterminism. 202s Preparing to unpack .../045-dh-strip-nondeterminism_1.14.0-1_all.deb ... 202s Unpacking dh-strip-nondeterminism (1.14.0-1) ... 202s Selecting previously unselected package debugedit. 202s Preparing to unpack .../046-debugedit_1%3a5.1-1_ppc64el.deb ... 202s Unpacking debugedit (1:5.1-1) ... 202s Selecting previously unselected package dwz. 202s Preparing to unpack .../047-dwz_0.15-1build6_ppc64el.deb ... 202s Unpacking dwz (0.15-1build6) ... 202s Selecting previously unselected package gettext. 202s Preparing to unpack .../048-gettext_0.22.5-2_ppc64el.deb ... 202s Unpacking gettext (0.22.5-2) ... 202s Selecting previously unselected package intltool-debian. 202s Preparing to unpack .../049-intltool-debian_0.35.0+20060710.6_all.deb ... 202s Unpacking intltool-debian (0.35.0+20060710.6) ... 202s Selecting previously unselected package po-debconf. 202s Preparing to unpack .../050-po-debconf_1.0.21+nmu1_all.deb ... 202s Unpacking po-debconf (1.0.21+nmu1) ... 203s Selecting previously unselected package debhelper. 203s Preparing to unpack .../051-debhelper_13.20ubuntu1_all.deb ... 203s Unpacking debhelper (13.20ubuntu1) ... 203s Selecting previously unselected package dh-python. 203s Preparing to unpack .../052-dh-python_6.20241024_all.deb ... 203s Unpacking dh-python (6.20241024) ... 203s Selecting previously unselected package fonts-dejavu-mono. 203s Preparing to unpack .../053-fonts-dejavu-mono_2.37-8_all.deb ... 203s Unpacking fonts-dejavu-mono (2.37-8) ... 203s Selecting previously unselected package fonts-dejavu-core. 203s Preparing to unpack .../054-fonts-dejavu-core_2.37-8_all.deb ... 203s Unpacking fonts-dejavu-core (2.37-8) ... 203s Selecting previously unselected package fontconfig-config. 203s Preparing to unpack .../055-fontconfig-config_2.15.0-1.1ubuntu2_ppc64el.deb ... 203s Unpacking fontconfig-config (2.15.0-1.1ubuntu2) ... 203s Selecting previously unselected package libbrotli-dev:ppc64el. 203s Preparing to unpack .../056-libbrotli-dev_1.1.0-2build2_ppc64el.deb ... 203s Unpacking libbrotli-dev:ppc64el (1.1.0-2build2) ... 203s Selecting previously unselected package libbz2-dev:ppc64el. 203s Preparing to unpack .../057-libbz2-dev_1.0.8-6_ppc64el.deb ... 203s Unpacking libbz2-dev:ppc64el (1.0.8-6) ... 203s Selecting previously unselected package libexpat1-dev:ppc64el. 203s Preparing to unpack .../058-libexpat1-dev_2.6.2-2_ppc64el.deb ... 203s Unpacking libexpat1-dev:ppc64el (2.6.2-2) ... 203s Selecting previously unselected package libfontconfig1:ppc64el. 203s Preparing to unpack .../059-libfontconfig1_2.15.0-1.1ubuntu2_ppc64el.deb ... 203s Unpacking libfontconfig1:ppc64el (2.15.0-1.1ubuntu2) ... 203s Selecting previously unselected package zlib1g-dev:ppc64el. 203s Preparing to unpack .../060-zlib1g-dev_1%3a1.3.dfsg+really1.3.1-1ubuntu1_ppc64el.deb ... 203s Unpacking zlib1g-dev:ppc64el (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 203s Selecting previously unselected package libpng-dev:ppc64el. 203s Preparing to unpack .../061-libpng-dev_1.6.44-1_ppc64el.deb ... 203s Unpacking libpng-dev:ppc64el (1.6.44-1) ... 203s Selecting previously unselected package libfreetype-dev:ppc64el. 203s Preparing to unpack .../062-libfreetype-dev_2.13.3+dfsg-1_ppc64el.deb ... 203s Unpacking libfreetype-dev:ppc64el (2.13.3+dfsg-1) ... 203s Selecting previously unselected package uuid-dev:ppc64el. 203s Preparing to unpack .../063-uuid-dev_2.40.2-1ubuntu1_ppc64el.deb ... 203s Unpacking uuid-dev:ppc64el (2.40.2-1ubuntu1) ... 203s Selecting previously unselected package libpkgconf3:ppc64el. 203s Preparing to unpack .../064-libpkgconf3_1.8.1-4_ppc64el.deb ... 203s Unpacking libpkgconf3:ppc64el (1.8.1-4) ... 203s Selecting previously unselected package pkgconf-bin. 203s Preparing to unpack .../065-pkgconf-bin_1.8.1-4_ppc64el.deb ... 203s Unpacking pkgconf-bin (1.8.1-4) ... 203s Selecting previously unselected package pkgconf:ppc64el. 203s Preparing to unpack .../066-pkgconf_1.8.1-4_ppc64el.deb ... 203s Unpacking pkgconf:ppc64el (1.8.1-4) ... 203s Selecting previously unselected package libfontconfig-dev:ppc64el. 203s Preparing to unpack .../067-libfontconfig-dev_2.15.0-1.1ubuntu2_ppc64el.deb ... 203s Unpacking libfontconfig-dev:ppc64el (2.15.0-1.1ubuntu2) ... 203s Selecting previously unselected package libpython3.12-dev:ppc64el. 203s Preparing to unpack .../068-libpython3.12-dev_3.12.7-2_ppc64el.deb ... 203s Unpacking libpython3.12-dev:ppc64el (3.12.7-2) ... 203s Selecting previously unselected package libpython3-dev:ppc64el. 204s Preparing to unpack .../069-libpython3-dev_3.12.6-0ubuntu1_ppc64el.deb ... 204s Unpacking libpython3-dev:ppc64el (3.12.6-0ubuntu1) ... 204s Selecting previously unselected package libpython3-all-dev:ppc64el. 204s Preparing to unpack .../070-libpython3-all-dev_3.12.6-0ubuntu1_ppc64el.deb ... 204s Unpacking libpython3-all-dev:ppc64el (3.12.6-0ubuntu1) ... 204s Selecting previously unselected package librust-ab-glyph-rasterizer-dev:ppc64el. 204s Preparing to unpack .../071-librust-ab-glyph-rasterizer-dev_0.1.7-1_ppc64el.deb ... 204s Unpacking librust-ab-glyph-rasterizer-dev:ppc64el (0.1.7-1) ... 204s Selecting previously unselected package librust-libm-dev:ppc64el. 204s Preparing to unpack .../072-librust-libm-dev_0.2.8-1_ppc64el.deb ... 204s Unpacking librust-libm-dev:ppc64el (0.2.8-1) ... 204s Selecting previously unselected package librust-ab-glyph-rasterizer+libm-dev:ppc64el. 204s Preparing to unpack .../073-librust-ab-glyph-rasterizer+libm-dev_0.1.7-1_ppc64el.deb ... 204s Unpacking librust-ab-glyph-rasterizer+libm-dev:ppc64el (0.1.7-1) ... 204s Selecting previously unselected package librust-core-maths-dev:ppc64el. 204s Preparing to unpack .../074-librust-core-maths-dev_0.1.0-2_ppc64el.deb ... 204s Unpacking librust-core-maths-dev:ppc64el (0.1.0-2) ... 204s Selecting previously unselected package librust-ttf-parser-dev:ppc64el. 204s Preparing to unpack .../075-librust-ttf-parser-dev_0.24.1-1_ppc64el.deb ... 204s Unpacking librust-ttf-parser-dev:ppc64el (0.24.1-1) ... 204s Selecting previously unselected package librust-owned-ttf-parser-dev:ppc64el. 204s Preparing to unpack .../076-librust-owned-ttf-parser-dev_0.24.0-1_ppc64el.deb ... 204s Unpacking librust-owned-ttf-parser-dev:ppc64el (0.24.0-1) ... 204s Selecting previously unselected package librust-ab-glyph-dev:ppc64el. 204s Preparing to unpack .../077-librust-ab-glyph-dev_0.2.28-1_ppc64el.deb ... 204s Unpacking librust-ab-glyph-dev:ppc64el (0.2.28-1) ... 204s Selecting previously unselected package librust-cfg-if-dev:ppc64el. 204s Preparing to unpack .../078-librust-cfg-if-dev_1.0.0-1_ppc64el.deb ... 204s Unpacking librust-cfg-if-dev:ppc64el (1.0.0-1) ... 204s Selecting previously unselected package librust-cpp-demangle-dev:ppc64el. 204s Preparing to unpack .../079-librust-cpp-demangle-dev_0.4.0-1_ppc64el.deb ... 204s Unpacking librust-cpp-demangle-dev:ppc64el (0.4.0-1) ... 204s Selecting previously unselected package librust-fallible-iterator-dev:ppc64el. 204s Preparing to unpack .../080-librust-fallible-iterator-dev_0.3.0-2_ppc64el.deb ... 204s Unpacking librust-fallible-iterator-dev:ppc64el (0.3.0-2) ... 204s Selecting previously unselected package librust-unicode-ident-dev:ppc64el. 204s Preparing to unpack .../081-librust-unicode-ident-dev_1.0.13-1_ppc64el.deb ... 204s Unpacking librust-unicode-ident-dev:ppc64el (1.0.13-1) ... 204s Selecting previously unselected package librust-proc-macro2-dev:ppc64el. 204s Preparing to unpack .../082-librust-proc-macro2-dev_1.0.86-1_ppc64el.deb ... 204s Unpacking librust-proc-macro2-dev:ppc64el (1.0.86-1) ... 204s Selecting previously unselected package librust-quote-dev:ppc64el. 204s Preparing to unpack .../083-librust-quote-dev_1.0.37-1_ppc64el.deb ... 204s Unpacking librust-quote-dev:ppc64el (1.0.37-1) ... 204s Selecting previously unselected package librust-syn-dev:ppc64el. 204s Preparing to unpack .../084-librust-syn-dev_2.0.77-1_ppc64el.deb ... 204s Unpacking librust-syn-dev:ppc64el (2.0.77-1) ... 204s Selecting previously unselected package librust-derive-arbitrary-dev:ppc64el. 204s Preparing to unpack .../085-librust-derive-arbitrary-dev_1.3.2-1_ppc64el.deb ... 204s Unpacking librust-derive-arbitrary-dev:ppc64el (1.3.2-1) ... 204s Selecting previously unselected package librust-arbitrary-dev:ppc64el. 204s Preparing to unpack .../086-librust-arbitrary-dev_1.3.2-1_ppc64el.deb ... 204s Unpacking librust-arbitrary-dev:ppc64el (1.3.2-1) ... 204s Selecting previously unselected package librust-equivalent-dev:ppc64el. 204s Preparing to unpack .../087-librust-equivalent-dev_1.0.1-1_ppc64el.deb ... 204s Unpacking librust-equivalent-dev:ppc64el (1.0.1-1) ... 204s Selecting previously unselected package librust-critical-section-dev:ppc64el. 204s Preparing to unpack .../088-librust-critical-section-dev_1.1.3-1_ppc64el.deb ... 204s Unpacking librust-critical-section-dev:ppc64el (1.1.3-1) ... 204s Selecting previously unselected package librust-serde-derive-dev:ppc64el. 204s Preparing to unpack .../089-librust-serde-derive-dev_1.0.210-1_ppc64el.deb ... 204s Unpacking librust-serde-derive-dev:ppc64el (1.0.210-1) ... 204s Selecting previously unselected package librust-serde-dev:ppc64el. 204s Preparing to unpack .../090-librust-serde-dev_1.0.210-2_ppc64el.deb ... 204s Unpacking librust-serde-dev:ppc64el (1.0.210-2) ... 204s Selecting previously unselected package librust-portable-atomic-dev:ppc64el. 204s Preparing to unpack .../091-librust-portable-atomic-dev_1.4.3-2_ppc64el.deb ... 204s Unpacking librust-portable-atomic-dev:ppc64el (1.4.3-2) ... 204s Selecting previously unselected package librust-libc-dev:ppc64el. 204s Preparing to unpack .../092-librust-libc-dev_0.2.155-1_ppc64el.deb ... 204s Unpacking librust-libc-dev:ppc64el (0.2.155-1) ... 204s Selecting previously unselected package librust-getrandom-dev:ppc64el. 204s Preparing to unpack .../093-librust-getrandom-dev_0.2.12-1_ppc64el.deb ... 204s Unpacking librust-getrandom-dev:ppc64el (0.2.12-1) ... 204s Selecting previously unselected package librust-smallvec-dev:ppc64el. 204s Preparing to unpack .../094-librust-smallvec-dev_1.13.2-1_ppc64el.deb ... 204s Unpacking librust-smallvec-dev:ppc64el (1.13.2-1) ... 204s Selecting previously unselected package librust-parking-lot-core-dev:ppc64el. 204s Preparing to unpack .../095-librust-parking-lot-core-dev_0.9.10-1_ppc64el.deb ... 204s Unpacking librust-parking-lot-core-dev:ppc64el (0.9.10-1) ... 204s Selecting previously unselected package librust-once-cell-dev:ppc64el. 204s Preparing to unpack .../096-librust-once-cell-dev_1.19.0-1_ppc64el.deb ... 204s Unpacking librust-once-cell-dev:ppc64el (1.19.0-1) ... 204s Selecting previously unselected package librust-crunchy-dev:ppc64el. 204s Preparing to unpack .../097-librust-crunchy-dev_0.2.2-1_ppc64el.deb ... 204s Unpacking librust-crunchy-dev:ppc64el (0.2.2-1) ... 204s Selecting previously unselected package librust-tiny-keccak-dev:ppc64el. 204s Preparing to unpack .../098-librust-tiny-keccak-dev_2.0.2-1_ppc64el.deb ... 204s Unpacking librust-tiny-keccak-dev:ppc64el (2.0.2-1) ... 204s Selecting previously unselected package librust-const-random-macro-dev:ppc64el. 204s Preparing to unpack .../099-librust-const-random-macro-dev_0.1.16-2_ppc64el.deb ... 204s Unpacking librust-const-random-macro-dev:ppc64el (0.1.16-2) ... 204s Selecting previously unselected package librust-const-random-dev:ppc64el. 204s Preparing to unpack .../100-librust-const-random-dev_0.1.17-2_ppc64el.deb ... 204s Unpacking librust-const-random-dev:ppc64el (0.1.17-2) ... 204s Selecting previously unselected package librust-version-check-dev:ppc64el. 204s Preparing to unpack .../101-librust-version-check-dev_0.9.5-1_ppc64el.deb ... 204s Unpacking librust-version-check-dev:ppc64el (0.9.5-1) ... 204s Selecting previously unselected package librust-byteorder-dev:ppc64el. 204s Preparing to unpack .../102-librust-byteorder-dev_1.5.0-1_ppc64el.deb ... 204s Unpacking librust-byteorder-dev:ppc64el (1.5.0-1) ... 205s Selecting previously unselected package librust-zerocopy-derive-dev:ppc64el. 205s Preparing to unpack .../103-librust-zerocopy-derive-dev_0.7.32-2_ppc64el.deb ... 205s Unpacking librust-zerocopy-derive-dev:ppc64el (0.7.32-2) ... 205s Selecting previously unselected package librust-zerocopy-dev:ppc64el. 205s Preparing to unpack .../104-librust-zerocopy-dev_0.7.32-1_ppc64el.deb ... 205s Unpacking librust-zerocopy-dev:ppc64el (0.7.32-1) ... 205s Selecting previously unselected package librust-ahash-dev. 205s Preparing to unpack .../105-librust-ahash-dev_0.8.11-8_all.deb ... 205s Unpacking librust-ahash-dev (0.8.11-8) ... 205s Selecting previously unselected package librust-allocator-api2-dev:ppc64el. 205s Preparing to unpack .../106-librust-allocator-api2-dev_0.2.16-1_ppc64el.deb ... 205s Unpacking librust-allocator-api2-dev:ppc64el (0.2.16-1) ... 205s Selecting previously unselected package librust-compiler-builtins-dev:ppc64el. 205s Preparing to unpack .../107-librust-compiler-builtins-dev_0.1.101-1_ppc64el.deb ... 205s Unpacking librust-compiler-builtins-dev:ppc64el (0.1.101-1) ... 205s Selecting previously unselected package librust-either-dev:ppc64el. 205s Preparing to unpack .../108-librust-either-dev_1.13.0-1_ppc64el.deb ... 205s Unpacking librust-either-dev:ppc64el (1.13.0-1) ... 205s Selecting previously unselected package librust-crossbeam-utils-dev:ppc64el. 205s Preparing to unpack .../109-librust-crossbeam-utils-dev_0.8.19-1_ppc64el.deb ... 205s Unpacking librust-crossbeam-utils-dev:ppc64el (0.8.19-1) ... 205s Selecting previously unselected package librust-crossbeam-epoch-dev:ppc64el. 205s Preparing to unpack .../110-librust-crossbeam-epoch-dev_0.9.18-1_ppc64el.deb ... 205s Unpacking librust-crossbeam-epoch-dev:ppc64el (0.9.18-1) ... 205s Selecting previously unselected package librust-crossbeam-epoch+std-dev:ppc64el. 205s Preparing to unpack .../111-librust-crossbeam-epoch+std-dev_0.9.18-1_ppc64el.deb ... 205s Unpacking librust-crossbeam-epoch+std-dev:ppc64el (0.9.18-1) ... 205s Selecting previously unselected package librust-crossbeam-deque-dev:ppc64el. 205s Preparing to unpack .../112-librust-crossbeam-deque-dev_0.8.5-1_ppc64el.deb ... 205s Unpacking librust-crossbeam-deque-dev:ppc64el (0.8.5-1) ... 205s Selecting previously unselected package librust-rayon-core-dev:ppc64el. 205s Preparing to unpack .../113-librust-rayon-core-dev_1.12.1-1_ppc64el.deb ... 205s Unpacking librust-rayon-core-dev:ppc64el (1.12.1-1) ... 205s Selecting previously unselected package librust-rayon-dev:ppc64el. 205s Preparing to unpack .../114-librust-rayon-dev_1.10.0-1_ppc64el.deb ... 205s Unpacking librust-rayon-dev:ppc64el (1.10.0-1) ... 205s Selecting previously unselected package librust-rustc-std-workspace-core-dev:ppc64el. 205s Preparing to unpack .../115-librust-rustc-std-workspace-core-dev_1.0.0-1_ppc64el.deb ... 205s Unpacking librust-rustc-std-workspace-core-dev:ppc64el (1.0.0-1) ... 205s Selecting previously unselected package librust-hashbrown-dev:ppc64el. 205s Preparing to unpack .../116-librust-hashbrown-dev_0.14.5-5_ppc64el.deb ... 205s Unpacking librust-hashbrown-dev:ppc64el (0.14.5-5) ... 205s Selecting previously unselected package librust-indexmap-dev:ppc64el. 205s Preparing to unpack .../117-librust-indexmap-dev_2.2.6-1_ppc64el.deb ... 205s Unpacking librust-indexmap-dev:ppc64el (2.2.6-1) ... 205s Selecting previously unselected package librust-stable-deref-trait-dev:ppc64el. 205s Preparing to unpack .../118-librust-stable-deref-trait-dev_1.2.0-1_ppc64el.deb ... 205s Unpacking librust-stable-deref-trait-dev:ppc64el (1.2.0-1) ... 205s Selecting previously unselected package librust-gimli-dev:ppc64el. 205s Preparing to unpack .../119-librust-gimli-dev_0.28.1-2_ppc64el.deb ... 205s Unpacking librust-gimli-dev:ppc64el (0.28.1-2) ... 205s Selecting previously unselected package librust-memmap2-dev:ppc64el. 205s Preparing to unpack .../120-librust-memmap2-dev_0.9.3-1_ppc64el.deb ... 205s Unpacking librust-memmap2-dev:ppc64el (0.9.3-1) ... 205s Selecting previously unselected package librust-crc32fast-dev:ppc64el. 205s Preparing to unpack .../121-librust-crc32fast-dev_1.4.2-1_ppc64el.deb ... 205s Unpacking librust-crc32fast-dev:ppc64el (1.4.2-1) ... 205s Selecting previously unselected package pkg-config:ppc64el. 205s Preparing to unpack .../122-pkg-config_1.8.1-4_ppc64el.deb ... 205s Unpacking pkg-config:ppc64el (1.8.1-4) ... 205s Selecting previously unselected package librust-pkg-config-dev:ppc64el. 205s Preparing to unpack .../123-librust-pkg-config-dev_0.3.27-1_ppc64el.deb ... 205s Unpacking librust-pkg-config-dev:ppc64el (0.3.27-1) ... 205s Selecting previously unselected package librust-libz-sys-dev:ppc64el. 205s Preparing to unpack .../124-librust-libz-sys-dev_1.1.20-1_ppc64el.deb ... 205s Unpacking librust-libz-sys-dev:ppc64el (1.1.20-1) ... 205s Selecting previously unselected package librust-adler-dev:ppc64el. 205s Preparing to unpack .../125-librust-adler-dev_1.0.2-2_ppc64el.deb ... 205s Unpacking librust-adler-dev:ppc64el (1.0.2-2) ... 205s Selecting previously unselected package librust-miniz-oxide-dev:ppc64el. 205s Preparing to unpack .../126-librust-miniz-oxide-dev_0.7.1-1_ppc64el.deb ... 205s Unpacking librust-miniz-oxide-dev:ppc64el (0.7.1-1) ... 205s Selecting previously unselected package librust-flate2-dev:ppc64el. 205s Preparing to unpack .../127-librust-flate2-dev_1.0.27-2_ppc64el.deb ... 205s Unpacking librust-flate2-dev:ppc64el (1.0.27-2) ... 205s Selecting previously unselected package librust-sval-derive-dev:ppc64el. 205s Preparing to unpack .../128-librust-sval-derive-dev_2.6.1-2_ppc64el.deb ... 205s Unpacking librust-sval-derive-dev:ppc64el (2.6.1-2) ... 205s Selecting previously unselected package librust-sval-dev:ppc64el. 205s Preparing to unpack .../129-librust-sval-dev_2.6.1-2_ppc64el.deb ... 205s Unpacking librust-sval-dev:ppc64el (2.6.1-2) ... 205s Selecting previously unselected package librust-sval-ref-dev:ppc64el. 205s Preparing to unpack .../130-librust-sval-ref-dev_2.6.1-1_ppc64el.deb ... 205s Unpacking librust-sval-ref-dev:ppc64el (2.6.1-1) ... 205s Selecting previously unselected package librust-erased-serde-dev:ppc64el. 205s Preparing to unpack .../131-librust-erased-serde-dev_0.3.31-1_ppc64el.deb ... 205s Unpacking librust-erased-serde-dev:ppc64el (0.3.31-1) ... 205s Selecting previously unselected package librust-serde-fmt-dev. 205s Preparing to unpack .../132-librust-serde-fmt-dev_1.0.3-3_all.deb ... 205s Unpacking librust-serde-fmt-dev (1.0.3-3) ... 205s Selecting previously unselected package librust-syn-1-dev:ppc64el. 205s Preparing to unpack .../133-librust-syn-1-dev_1.0.109-2_ppc64el.deb ... 205s Unpacking librust-syn-1-dev:ppc64el (1.0.109-2) ... 206s Selecting previously unselected package librust-no-panic-dev:ppc64el. 206s Preparing to unpack .../134-librust-no-panic-dev_0.1.13-1_ppc64el.deb ... 206s Unpacking librust-no-panic-dev:ppc64el (0.1.13-1) ... 206s Selecting previously unselected package librust-itoa-dev:ppc64el. 206s Preparing to unpack .../135-librust-itoa-dev_1.0.9-1_ppc64el.deb ... 206s Unpacking librust-itoa-dev:ppc64el (1.0.9-1) ... 206s Selecting previously unselected package librust-ryu-dev:ppc64el. 206s Preparing to unpack .../136-librust-ryu-dev_1.0.15-1_ppc64el.deb ... 206s Unpacking librust-ryu-dev:ppc64el (1.0.15-1) ... 206s Selecting previously unselected package librust-serde-json-dev:ppc64el. 206s Preparing to unpack .../137-librust-serde-json-dev_1.0.128-1_ppc64el.deb ... 206s Unpacking librust-serde-json-dev:ppc64el (1.0.128-1) ... 206s Selecting previously unselected package librust-serde-test-dev:ppc64el. 206s Preparing to unpack .../138-librust-serde-test-dev_1.0.171-1_ppc64el.deb ... 206s Unpacking librust-serde-test-dev:ppc64el (1.0.171-1) ... 206s Selecting previously unselected package librust-value-bag-serde1-dev:ppc64el. 206s Preparing to unpack .../139-librust-value-bag-serde1-dev_1.9.0-1_ppc64el.deb ... 206s Unpacking librust-value-bag-serde1-dev:ppc64el (1.9.0-1) ... 206s Selecting previously unselected package librust-sval-buffer-dev:ppc64el. 206s Preparing to unpack .../140-librust-sval-buffer-dev_2.6.1-1_ppc64el.deb ... 206s Unpacking librust-sval-buffer-dev:ppc64el (2.6.1-1) ... 206s Selecting previously unselected package librust-sval-dynamic-dev:ppc64el. 206s Preparing to unpack .../141-librust-sval-dynamic-dev_2.6.1-1_ppc64el.deb ... 206s Unpacking librust-sval-dynamic-dev:ppc64el (2.6.1-1) ... 206s Selecting previously unselected package librust-sval-fmt-dev:ppc64el. 206s Preparing to unpack .../142-librust-sval-fmt-dev_2.6.1-1_ppc64el.deb ... 206s Unpacking librust-sval-fmt-dev:ppc64el (2.6.1-1) ... 206s Selecting previously unselected package librust-sval-serde-dev:ppc64el. 206s Preparing to unpack .../143-librust-sval-serde-dev_2.6.1-1_ppc64el.deb ... 206s Unpacking librust-sval-serde-dev:ppc64el (2.6.1-1) ... 206s Selecting previously unselected package librust-value-bag-sval2-dev:ppc64el. 206s Preparing to unpack .../144-librust-value-bag-sval2-dev_1.9.0-1_ppc64el.deb ... 206s Unpacking librust-value-bag-sval2-dev:ppc64el (1.9.0-1) ... 206s Selecting previously unselected package librust-value-bag-dev:ppc64el. 206s Preparing to unpack .../145-librust-value-bag-dev_1.9.0-1_ppc64el.deb ... 206s Unpacking librust-value-bag-dev:ppc64el (1.9.0-1) ... 206s Selecting previously unselected package librust-log-dev:ppc64el. 206s Preparing to unpack .../146-librust-log-dev_0.4.22-1_ppc64el.deb ... 206s Unpacking librust-log-dev:ppc64el (0.4.22-1) ... 206s Selecting previously unselected package librust-memchr-dev:ppc64el. 206s Preparing to unpack .../147-librust-memchr-dev_2.7.1-1_ppc64el.deb ... 206s Unpacking librust-memchr-dev:ppc64el (2.7.1-1) ... 206s Selecting previously unselected package librust-ppv-lite86-dev:ppc64el. 206s Preparing to unpack .../148-librust-ppv-lite86-dev_0.2.16-1_ppc64el.deb ... 206s Unpacking librust-ppv-lite86-dev:ppc64el (0.2.16-1) ... 206s Selecting previously unselected package librust-rand-core-dev:ppc64el. 206s Preparing to unpack .../149-librust-rand-core-dev_0.6.4-2_ppc64el.deb ... 206s Unpacking librust-rand-core-dev:ppc64el (0.6.4-2) ... 206s Selecting previously unselected package librust-rand-chacha-dev:ppc64el. 206s Preparing to unpack .../150-librust-rand-chacha-dev_0.3.1-2_ppc64el.deb ... 206s Unpacking librust-rand-chacha-dev:ppc64el (0.3.1-2) ... 206s Selecting previously unselected package librust-rand-core+getrandom-dev:ppc64el. 206s Preparing to unpack .../151-librust-rand-core+getrandom-dev_0.6.4-2_ppc64el.deb ... 206s Unpacking librust-rand-core+getrandom-dev:ppc64el (0.6.4-2) ... 206s Selecting previously unselected package librust-rand-core+serde-dev:ppc64el. 206s Preparing to unpack .../152-librust-rand-core+serde-dev_0.6.4-2_ppc64el.deb ... 206s Unpacking librust-rand-core+serde-dev:ppc64el (0.6.4-2) ... 206s Selecting previously unselected package librust-rand-core+std-dev:ppc64el. 206s Preparing to unpack .../153-librust-rand-core+std-dev_0.6.4-2_ppc64el.deb ... 206s Unpacking librust-rand-core+std-dev:ppc64el (0.6.4-2) ... 206s Selecting previously unselected package librust-rand-dev:ppc64el. 206s Preparing to unpack .../154-librust-rand-dev_0.8.5-1_ppc64el.deb ... 206s Unpacking librust-rand-dev:ppc64el (0.8.5-1) ... 206s Selecting previously unselected package librust-unicode-segmentation-dev:ppc64el. 206s Preparing to unpack .../155-librust-unicode-segmentation-dev_1.11.0-1_ppc64el.deb ... 206s Unpacking librust-unicode-segmentation-dev:ppc64el (1.11.0-1) ... 206s Selecting previously unselected package librust-convert-case-dev:ppc64el. 206s Preparing to unpack .../156-librust-convert-case-dev_0.6.0-2_ppc64el.deb ... 206s Unpacking librust-convert-case-dev:ppc64el (0.6.0-2) ... 206s Selecting previously unselected package librust-semver-dev:ppc64el. 206s Preparing to unpack .../157-librust-semver-dev_1.0.23-1_ppc64el.deb ... 206s Unpacking librust-semver-dev:ppc64el (1.0.23-1) ... 206s Selecting previously unselected package librust-rustc-version-dev:ppc64el. 206s Preparing to unpack .../158-librust-rustc-version-dev_0.4.0-1_ppc64el.deb ... 206s Unpacking librust-rustc-version-dev:ppc64el (0.4.0-1) ... 206s Selecting previously unselected package librust-derive-more-0.99-dev:ppc64el. 206s Preparing to unpack .../159-librust-derive-more-0.99-dev_0.99.18-1_ppc64el.deb ... 206s Unpacking librust-derive-more-0.99-dev:ppc64el (0.99.18-1) ... 206s Selecting previously unselected package librust-cfg-if-0.1-dev:ppc64el. 206s Preparing to unpack .../160-librust-cfg-if-0.1-dev_0.1.10-2_ppc64el.deb ... 206s Unpacking librust-cfg-if-0.1-dev:ppc64el (0.1.10-2) ... 206s Selecting previously unselected package librust-blobby-dev:ppc64el. 206s Preparing to unpack .../161-librust-blobby-dev_0.3.1-1_ppc64el.deb ... 206s Unpacking librust-blobby-dev:ppc64el (0.3.1-1) ... 206s Selecting previously unselected package librust-typenum-dev:ppc64el. 206s Preparing to unpack .../162-librust-typenum-dev_1.17.0-2_ppc64el.deb ... 206s Unpacking librust-typenum-dev:ppc64el (1.17.0-2) ... 206s Selecting previously unselected package librust-zeroize-derive-dev:ppc64el. 206s Preparing to unpack .../163-librust-zeroize-derive-dev_1.4.2-1_ppc64el.deb ... 206s Unpacking librust-zeroize-derive-dev:ppc64el (1.4.2-1) ... 206s Selecting previously unselected package librust-zeroize-dev:ppc64el. 206s Preparing to unpack .../164-librust-zeroize-dev_1.8.1-1_ppc64el.deb ... 206s Unpacking librust-zeroize-dev:ppc64el (1.8.1-1) ... 206s Selecting previously unselected package librust-generic-array-dev:ppc64el. 206s Preparing to unpack .../165-librust-generic-array-dev_0.14.7-1_ppc64el.deb ... 206s Unpacking librust-generic-array-dev:ppc64el (0.14.7-1) ... 206s Selecting previously unselected package librust-block-buffer-dev:ppc64el. 206s Preparing to unpack .../166-librust-block-buffer-dev_0.10.2-2_ppc64el.deb ... 206s Unpacking librust-block-buffer-dev:ppc64el (0.10.2-2) ... 207s Selecting previously unselected package librust-const-oid-dev:ppc64el. 207s Preparing to unpack .../167-librust-const-oid-dev_0.9.3-1_ppc64el.deb ... 207s Unpacking librust-const-oid-dev:ppc64el (0.9.3-1) ... 207s Selecting previously unselected package librust-crypto-common-dev:ppc64el. 207s Preparing to unpack .../168-librust-crypto-common-dev_0.1.6-1_ppc64el.deb ... 207s Unpacking librust-crypto-common-dev:ppc64el (0.1.6-1) ... 207s Selecting previously unselected package librust-subtle-dev:ppc64el. 207s Preparing to unpack .../169-librust-subtle-dev_2.6.1-1_ppc64el.deb ... 207s Unpacking librust-subtle-dev:ppc64el (2.6.1-1) ... 207s Selecting previously unselected package librust-digest-dev:ppc64el. 207s Preparing to unpack .../170-librust-digest-dev_0.10.7-2_ppc64el.deb ... 207s Unpacking librust-digest-dev:ppc64el (0.10.7-2) ... 207s Selecting previously unselected package librust-static-assertions-dev:ppc64el. 207s Preparing to unpack .../171-librust-static-assertions-dev_1.1.0-1_ppc64el.deb ... 207s Unpacking librust-static-assertions-dev:ppc64el (1.1.0-1) ... 207s Selecting previously unselected package librust-twox-hash-dev:ppc64el. 207s Preparing to unpack .../172-librust-twox-hash-dev_1.6.3-1_ppc64el.deb ... 207s Unpacking librust-twox-hash-dev:ppc64el (1.6.3-1) ... 207s Selecting previously unselected package librust-ruzstd-dev:ppc64el. 207s Preparing to unpack .../173-librust-ruzstd-dev_0.5.0-1_ppc64el.deb ... 207s Unpacking librust-ruzstd-dev:ppc64el (0.5.0-1) ... 207s Selecting previously unselected package librust-object-dev:ppc64el. 207s Preparing to unpack .../174-librust-object-dev_0.32.2-1_ppc64el.deb ... 207s Unpacking librust-object-dev:ppc64el (0.32.2-1) ... 207s Selecting previously unselected package librust-rustc-demangle-dev:ppc64el. 207s Preparing to unpack .../175-librust-rustc-demangle-dev_0.1.21-1_ppc64el.deb ... 207s Unpacking librust-rustc-demangle-dev:ppc64el (0.1.21-1) ... 207s Selecting previously unselected package librust-addr2line-dev:ppc64el. 207s Preparing to unpack .../176-librust-addr2line-dev_0.21.0-2_ppc64el.deb ... 207s Unpacking librust-addr2line-dev:ppc64el (0.21.0-2) ... 207s Selecting previously unselected package librust-aho-corasick-dev:ppc64el. 207s Preparing to unpack .../177-librust-aho-corasick-dev_1.1.3-1_ppc64el.deb ... 207s Unpacking librust-aho-corasick-dev:ppc64el (1.1.3-1) ... 207s Selecting previously unselected package librust-bitflags-1-dev:ppc64el. 207s Preparing to unpack .../178-librust-bitflags-1-dev_1.3.2-5_ppc64el.deb ... 207s Unpacking librust-bitflags-1-dev:ppc64el (1.3.2-5) ... 207s Selecting previously unselected package librust-anes-dev:ppc64el. 207s Preparing to unpack .../179-librust-anes-dev_0.1.6-1_ppc64el.deb ... 207s Unpacking librust-anes-dev:ppc64el (0.1.6-1) ... 207s Selecting previously unselected package librust-anstyle-dev:ppc64el. 207s Preparing to unpack .../180-librust-anstyle-dev_1.0.8-1_ppc64el.deb ... 207s Unpacking librust-anstyle-dev:ppc64el (1.0.8-1) ... 207s Selecting previously unselected package librust-arrayvec-dev:ppc64el. 207s Preparing to unpack .../181-librust-arrayvec-dev_0.7.4-2_ppc64el.deb ... 207s Unpacking librust-arrayvec-dev:ppc64el (0.7.4-2) ... 207s Selecting previously unselected package librust-utf8parse-dev:ppc64el. 207s Preparing to unpack .../182-librust-utf8parse-dev_0.2.1-1_ppc64el.deb ... 207s Unpacking librust-utf8parse-dev:ppc64el (0.2.1-1) ... 207s Selecting previously unselected package librust-anstyle-parse-dev:ppc64el. 207s Preparing to unpack .../183-librust-anstyle-parse-dev_0.2.1-1_ppc64el.deb ... 207s Unpacking librust-anstyle-parse-dev:ppc64el (0.2.1-1) ... 207s Selecting previously unselected package librust-anstyle-query-dev:ppc64el. 207s Preparing to unpack .../184-librust-anstyle-query-dev_1.0.0-1_ppc64el.deb ... 207s Unpacking librust-anstyle-query-dev:ppc64el (1.0.0-1) ... 207s Selecting previously unselected package librust-colorchoice-dev:ppc64el. 207s Preparing to unpack .../185-librust-colorchoice-dev_1.0.0-1_ppc64el.deb ... 207s Unpacking librust-colorchoice-dev:ppc64el (1.0.0-1) ... 207s Selecting previously unselected package librust-anstream-dev:ppc64el. 207s Preparing to unpack .../186-librust-anstream-dev_0.6.15-1_ppc64el.deb ... 207s Unpacking librust-anstream-dev:ppc64el (0.6.15-1) ... 207s Selecting previously unselected package librust-jobserver-dev:ppc64el. 207s Preparing to unpack .../187-librust-jobserver-dev_0.1.32-1_ppc64el.deb ... 207s Unpacking librust-jobserver-dev:ppc64el (0.1.32-1) ... 207s Selecting previously unselected package librust-shlex-dev:ppc64el. 207s Preparing to unpack .../188-librust-shlex-dev_1.3.0-1_ppc64el.deb ... 207s Unpacking librust-shlex-dev:ppc64el (1.3.0-1) ... 207s Selecting previously unselected package librust-cc-dev:ppc64el. 207s Preparing to unpack .../189-librust-cc-dev_1.1.14-1_ppc64el.deb ... 207s Unpacking librust-cc-dev:ppc64el (1.1.14-1) ... 207s Selecting previously unselected package librust-backtrace-dev:ppc64el. 207s Preparing to unpack .../190-librust-backtrace-dev_0.3.69-2_ppc64el.deb ... 207s Unpacking librust-backtrace-dev:ppc64el (0.3.69-2) ... 207s Selecting previously unselected package librust-anyhow-dev:ppc64el. 207s Preparing to unpack .../191-librust-anyhow-dev_1.0.86-1_ppc64el.deb ... 207s Unpacking librust-anyhow-dev:ppc64el (1.0.86-1) ... 207s Selecting previously unselected package librust-bytecheck-derive-dev:ppc64el. 207s Preparing to unpack .../192-librust-bytecheck-derive-dev_0.6.12-1_ppc64el.deb ... 207s Unpacking librust-bytecheck-derive-dev:ppc64el (0.6.12-1) ... 207s Selecting previously unselected package librust-ptr-meta-derive-dev:ppc64el. 207s Preparing to unpack .../193-librust-ptr-meta-derive-dev_0.1.4-1_ppc64el.deb ... 207s Unpacking librust-ptr-meta-derive-dev:ppc64el (0.1.4-1) ... 207s Selecting previously unselected package librust-ptr-meta-dev:ppc64el. 207s Preparing to unpack .../194-librust-ptr-meta-dev_0.1.4-1_ppc64el.deb ... 207s Unpacking librust-ptr-meta-dev:ppc64el (0.1.4-1) ... 207s Selecting previously unselected package librust-simdutf8-dev:ppc64el. 207s Preparing to unpack .../195-librust-simdutf8-dev_0.1.4-4_ppc64el.deb ... 207s Unpacking librust-simdutf8-dev:ppc64el (0.1.4-4) ... 207s Selecting previously unselected package librust-bytemuck-derive-dev:ppc64el. 207s Preparing to unpack .../196-librust-bytemuck-derive-dev_1.5.0-2_ppc64el.deb ... 207s Unpacking librust-bytemuck-derive-dev:ppc64el (1.5.0-2) ... 207s Selecting previously unselected package librust-bytemuck-dev:ppc64el. 207s Preparing to unpack .../197-librust-bytemuck-dev_1.14.0-1_ppc64el.deb ... 207s Unpacking librust-bytemuck-dev:ppc64el (1.14.0-1) ... 207s Selecting previously unselected package librust-atomic-dev:ppc64el. 207s Preparing to unpack .../198-librust-atomic-dev_0.6.0-1_ppc64el.deb ... 207s Unpacking librust-atomic-dev:ppc64el (0.6.0-1) ... 207s Selecting previously unselected package librust-md5-asm-dev:ppc64el. 207s Preparing to unpack .../199-librust-md5-asm-dev_0.5.0-2_ppc64el.deb ... 207s Unpacking librust-md5-asm-dev:ppc64el (0.5.0-2) ... 207s Selecting previously unselected package librust-md-5-dev:ppc64el. 207s Preparing to unpack .../200-librust-md-5-dev_0.10.6-1_ppc64el.deb ... 207s Unpacking librust-md-5-dev:ppc64el (0.10.6-1) ... 208s Selecting previously unselected package librust-cpufeatures-dev:ppc64el. 208s Preparing to unpack .../201-librust-cpufeatures-dev_0.2.11-1_ppc64el.deb ... 208s Unpacking librust-cpufeatures-dev:ppc64el (0.2.11-1) ... 208s Selecting previously unselected package librust-sha1-asm-dev:ppc64el. 208s Preparing to unpack .../202-librust-sha1-asm-dev_0.5.1-2_ppc64el.deb ... 208s Unpacking librust-sha1-asm-dev:ppc64el (0.5.1-2) ... 208s Selecting previously unselected package librust-sha1-dev:ppc64el. 208s Preparing to unpack .../203-librust-sha1-dev_0.10.6-1_ppc64el.deb ... 208s Unpacking librust-sha1-dev:ppc64el (0.10.6-1) ... 208s Selecting previously unselected package librust-slog-dev:ppc64el. 208s Preparing to unpack .../204-librust-slog-dev_2.7.0-1_ppc64el.deb ... 208s Unpacking librust-slog-dev:ppc64el (2.7.0-1) ... 208s Selecting previously unselected package librust-uuid-dev:ppc64el. 208s Preparing to unpack .../205-librust-uuid-dev_1.10.0-1_ppc64el.deb ... 208s Unpacking librust-uuid-dev:ppc64el (1.10.0-1) ... 208s Selecting previously unselected package librust-bytecheck-dev:ppc64el. 208s Preparing to unpack .../206-librust-bytecheck-dev_0.6.12-1_ppc64el.deb ... 208s Unpacking librust-bytecheck-dev:ppc64el (0.6.12-1) ... 208s Selecting previously unselected package librust-autocfg-dev:ppc64el. 208s Preparing to unpack .../207-librust-autocfg-dev_1.1.0-1_ppc64el.deb ... 208s Unpacking librust-autocfg-dev:ppc64el (1.1.0-1) ... 208s Selecting previously unselected package librust-num-traits-dev:ppc64el. 208s Preparing to unpack .../208-librust-num-traits-dev_0.2.19-2_ppc64el.deb ... 208s Unpacking librust-num-traits-dev:ppc64el (0.2.19-2) ... 208s Selecting previously unselected package librust-funty-dev:ppc64el. 208s Preparing to unpack .../209-librust-funty-dev_2.0.0-1_ppc64el.deb ... 208s Unpacking librust-funty-dev:ppc64el (2.0.0-1) ... 208s Selecting previously unselected package librust-radium-dev:ppc64el. 208s Preparing to unpack .../210-librust-radium-dev_1.1.0-1_ppc64el.deb ... 208s Unpacking librust-radium-dev:ppc64el (1.1.0-1) ... 208s Selecting previously unselected package librust-tap-dev:ppc64el. 208s Preparing to unpack .../211-librust-tap-dev_1.0.1-1_ppc64el.deb ... 208s Unpacking librust-tap-dev:ppc64el (1.0.1-1) ... 208s Selecting previously unselected package librust-traitobject-dev:ppc64el. 208s Preparing to unpack .../212-librust-traitobject-dev_0.1.0-1_ppc64el.deb ... 208s Unpacking librust-traitobject-dev:ppc64el (0.1.0-1) ... 208s Selecting previously unselected package librust-unsafe-any-dev:ppc64el. 208s Preparing to unpack .../213-librust-unsafe-any-dev_0.4.2-2_ppc64el.deb ... 208s Unpacking librust-unsafe-any-dev:ppc64el (0.4.2-2) ... 208s Selecting previously unselected package librust-typemap-dev:ppc64el. 208s Preparing to unpack .../214-librust-typemap-dev_0.3.3-2_ppc64el.deb ... 208s Unpacking librust-typemap-dev:ppc64el (0.3.3-2) ... 208s Selecting previously unselected package librust-wyz-dev:ppc64el. 208s Preparing to unpack .../215-librust-wyz-dev_0.5.1-1_ppc64el.deb ... 208s Unpacking librust-wyz-dev:ppc64el (0.5.1-1) ... 208s Selecting previously unselected package librust-bitvec-dev:ppc64el. 208s Preparing to unpack .../216-librust-bitvec-dev_1.0.1-1_ppc64el.deb ... 208s Unpacking librust-bitvec-dev:ppc64el (1.0.1-1) ... 208s Selecting previously unselected package librust-bytes-dev:ppc64el. 208s Preparing to unpack .../217-librust-bytes-dev_1.5.0-1_ppc64el.deb ... 208s Unpacking librust-bytes-dev:ppc64el (1.5.0-1) ... 208s Selecting previously unselected package librust-rend-dev:ppc64el. 208s Preparing to unpack .../218-librust-rend-dev_0.4.0-1_ppc64el.deb ... 208s Unpacking librust-rend-dev:ppc64el (0.4.0-1) ... 208s Selecting previously unselected package librust-rkyv-derive-dev:ppc64el. 208s Preparing to unpack .../219-librust-rkyv-derive-dev_0.7.44-1_ppc64el.deb ... 208s Unpacking librust-rkyv-derive-dev:ppc64el (0.7.44-1) ... 208s Selecting previously unselected package librust-seahash-dev:ppc64el. 208s Preparing to unpack .../220-librust-seahash-dev_4.1.0-1_ppc64el.deb ... 208s Unpacking librust-seahash-dev:ppc64el (4.1.0-1) ... 208s Selecting previously unselected package librust-smol-str-dev:ppc64el. 208s Preparing to unpack .../221-librust-smol-str-dev_0.2.0-1_ppc64el.deb ... 208s Unpacking librust-smol-str-dev:ppc64el (0.2.0-1) ... 208s Selecting previously unselected package librust-tinyvec-dev:ppc64el. 208s Preparing to unpack .../222-librust-tinyvec-dev_1.6.0-2_ppc64el.deb ... 208s Unpacking librust-tinyvec-dev:ppc64el (1.6.0-2) ... 208s Selecting previously unselected package librust-tinyvec-macros-dev:ppc64el. 208s Preparing to unpack .../223-librust-tinyvec-macros-dev_0.1.0-1_ppc64el.deb ... 208s Unpacking librust-tinyvec-macros-dev:ppc64el (0.1.0-1) ... 208s Selecting previously unselected package librust-tinyvec+tinyvec-macros-dev:ppc64el. 208s Preparing to unpack .../224-librust-tinyvec+tinyvec-macros-dev_1.6.0-2_ppc64el.deb ... 208s Unpacking librust-tinyvec+tinyvec-macros-dev:ppc64el (1.6.0-2) ... 208s Selecting previously unselected package librust-rkyv-dev:ppc64el. 208s Preparing to unpack .../225-librust-rkyv-dev_0.7.44-1_ppc64el.deb ... 208s Unpacking librust-rkyv-dev:ppc64el (0.7.44-1) ... 208s Selecting previously unselected package librust-num-complex-dev:ppc64el. 208s Preparing to unpack .../226-librust-num-complex-dev_0.4.6-2_ppc64el.deb ... 208s Unpacking librust-num-complex-dev:ppc64el (0.4.6-2) ... 208s Selecting previously unselected package librust-approx-dev:ppc64el. 208s Preparing to unpack .../227-librust-approx-dev_0.5.1-1_ppc64el.deb ... 208s Unpacking librust-approx-dev:ppc64el (0.5.1-1) ... 208s Selecting previously unselected package librust-array-init-dev:ppc64el. 208s Preparing to unpack .../228-librust-array-init-dev_2.0.1-1_ppc64el.deb ... 208s Unpacking librust-array-init-dev:ppc64el (2.0.1-1) ... 208s Selecting previously unselected package librust-async-attributes-dev. 208s Preparing to unpack .../229-librust-async-attributes-dev_1.1.2-6_all.deb ... 208s Unpacking librust-async-attributes-dev (1.1.2-6) ... 208s Selecting previously unselected package librust-concurrent-queue-dev:ppc64el. 208s Preparing to unpack .../230-librust-concurrent-queue-dev_2.5.0-4_ppc64el.deb ... 208s Unpacking librust-concurrent-queue-dev:ppc64el (2.5.0-4) ... 208s Selecting previously unselected package librust-parking-dev:ppc64el. 208s Preparing to unpack .../231-librust-parking-dev_2.2.0-1_ppc64el.deb ... 208s Unpacking librust-parking-dev:ppc64el (2.2.0-1) ... 208s Selecting previously unselected package librust-pin-project-lite-dev:ppc64el. 208s Preparing to unpack .../232-librust-pin-project-lite-dev_0.2.13-1_ppc64el.deb ... 208s Unpacking librust-pin-project-lite-dev:ppc64el (0.2.13-1) ... 208s Selecting previously unselected package librust-event-listener-dev. 208s Preparing to unpack .../233-librust-event-listener-dev_5.3.1-8_all.deb ... 208s Unpacking librust-event-listener-dev (5.3.1-8) ... 209s Selecting previously unselected package librust-event-listener-strategy-dev:ppc64el. 209s Preparing to unpack .../234-librust-event-listener-strategy-dev_0.5.2-3_ppc64el.deb ... 209s Unpacking librust-event-listener-strategy-dev:ppc64el (0.5.2-3) ... 209s Selecting previously unselected package librust-futures-core-dev:ppc64el. 209s Preparing to unpack .../235-librust-futures-core-dev_0.3.30-1_ppc64el.deb ... 209s Unpacking librust-futures-core-dev:ppc64el (0.3.30-1) ... 209s Selecting previously unselected package librust-async-channel-dev. 209s Preparing to unpack .../236-librust-async-channel-dev_2.3.1-8_all.deb ... 209s Unpacking librust-async-channel-dev (2.3.1-8) ... 209s Selecting previously unselected package librust-async-task-dev. 209s Preparing to unpack .../237-librust-async-task-dev_4.7.1-3_all.deb ... 209s Unpacking librust-async-task-dev (4.7.1-3) ... 209s Selecting previously unselected package librust-fastrand-dev:ppc64el. 209s Preparing to unpack .../238-librust-fastrand-dev_2.1.1-1_ppc64el.deb ... 209s Unpacking librust-fastrand-dev:ppc64el (2.1.1-1) ... 209s Selecting previously unselected package librust-futures-io-dev:ppc64el. 209s Preparing to unpack .../239-librust-futures-io-dev_0.3.30-2_ppc64el.deb ... 209s Unpacking librust-futures-io-dev:ppc64el (0.3.30-2) ... 209s Selecting previously unselected package librust-futures-lite-dev:ppc64el. 209s Preparing to unpack .../240-librust-futures-lite-dev_2.3.0-2_ppc64el.deb ... 209s Unpacking librust-futures-lite-dev:ppc64el (2.3.0-2) ... 209s Selecting previously unselected package librust-slab-dev:ppc64el. 209s Preparing to unpack .../241-librust-slab-dev_0.4.9-1_ppc64el.deb ... 209s Unpacking librust-slab-dev:ppc64el (0.4.9-1) ... 209s Selecting previously unselected package librust-async-executor-dev. 209s Preparing to unpack .../242-librust-async-executor-dev_1.13.1-1_all.deb ... 209s Unpacking librust-async-executor-dev (1.13.1-1) ... 209s Selecting previously unselected package librust-async-lock-dev. 209s Preparing to unpack .../243-librust-async-lock-dev_3.4.0-4_all.deb ... 209s Unpacking librust-async-lock-dev (3.4.0-4) ... 209s Selecting previously unselected package librust-atomic-waker-dev:ppc64el. 209s Preparing to unpack .../244-librust-atomic-waker-dev_1.1.2-1_ppc64el.deb ... 209s Unpacking librust-atomic-waker-dev:ppc64el (1.1.2-1) ... 209s Selecting previously unselected package librust-tracing-attributes-dev:ppc64el. 209s Preparing to unpack .../245-librust-tracing-attributes-dev_0.1.27-1_ppc64el.deb ... 209s Unpacking librust-tracing-attributes-dev:ppc64el (0.1.27-1) ... 209s Selecting previously unselected package librust-valuable-derive-dev:ppc64el. 209s Preparing to unpack .../246-librust-valuable-derive-dev_0.1.0-1_ppc64el.deb ... 209s Unpacking librust-valuable-derive-dev:ppc64el (0.1.0-1) ... 209s Selecting previously unselected package librust-valuable-dev:ppc64el. 209s Preparing to unpack .../247-librust-valuable-dev_0.1.0-4_ppc64el.deb ... 209s Unpacking librust-valuable-dev:ppc64el (0.1.0-4) ... 209s Selecting previously unselected package librust-tracing-core-dev:ppc64el. 209s Preparing to unpack .../248-librust-tracing-core-dev_0.1.32-1_ppc64el.deb ... 209s Unpacking librust-tracing-core-dev:ppc64el (0.1.32-1) ... 209s Selecting previously unselected package librust-tracing-dev:ppc64el. 209s Preparing to unpack .../249-librust-tracing-dev_0.1.40-1_ppc64el.deb ... 209s Unpacking librust-tracing-dev:ppc64el (0.1.40-1) ... 209s Selecting previously unselected package librust-blocking-dev. 209s Preparing to unpack .../250-librust-blocking-dev_1.6.1-5_all.deb ... 209s Unpacking librust-blocking-dev (1.6.1-5) ... 209s Selecting previously unselected package librust-async-fs-dev. 209s Preparing to unpack .../251-librust-async-fs-dev_2.1.2-4_all.deb ... 209s Unpacking librust-async-fs-dev (2.1.2-4) ... 209s Selecting previously unselected package librust-bitflags-dev:ppc64el. 209s Preparing to unpack .../252-librust-bitflags-dev_2.6.0-1_ppc64el.deb ... 209s Unpacking librust-bitflags-dev:ppc64el (2.6.0-1) ... 209s Selecting previously unselected package librust-compiler-builtins+core-dev:ppc64el. 209s Preparing to unpack .../253-librust-compiler-builtins+core-dev_0.1.101-1_ppc64el.deb ... 209s Unpacking librust-compiler-builtins+core-dev:ppc64el (0.1.101-1) ... 209s Selecting previously unselected package librust-compiler-builtins+rustc-dep-of-std-dev:ppc64el. 209s Preparing to unpack .../254-librust-compiler-builtins+rustc-dep-of-std-dev_0.1.101-1_ppc64el.deb ... 209s Unpacking librust-compiler-builtins+rustc-dep-of-std-dev:ppc64el (0.1.101-1) ... 209s Selecting previously unselected package librust-errno-dev:ppc64el. 209s Preparing to unpack .../255-librust-errno-dev_0.3.8-1_ppc64el.deb ... 209s Unpacking librust-errno-dev:ppc64el (0.3.8-1) ... 209s Selecting previously unselected package librust-linux-raw-sys-dev:ppc64el. 209s Preparing to unpack .../256-librust-linux-raw-sys-dev_0.4.14-1_ppc64el.deb ... 209s Unpacking librust-linux-raw-sys-dev:ppc64el (0.4.14-1) ... 209s Selecting previously unselected package librust-rustix-dev:ppc64el. 209s Preparing to unpack .../257-librust-rustix-dev_0.38.32-1_ppc64el.deb ... 209s Unpacking librust-rustix-dev:ppc64el (0.38.32-1) ... 209s Selecting previously unselected package librust-polling-dev:ppc64el. 209s Preparing to unpack .../258-librust-polling-dev_3.4.0-1_ppc64el.deb ... 209s Unpacking librust-polling-dev:ppc64el (3.4.0-1) ... 209s Selecting previously unselected package librust-async-io-dev:ppc64el. 209s Preparing to unpack .../259-librust-async-io-dev_2.3.3-4_ppc64el.deb ... 209s Unpacking librust-async-io-dev:ppc64el (2.3.3-4) ... 209s Selecting previously unselected package librust-mio-dev:ppc64el. 209s Preparing to unpack .../260-librust-mio-dev_1.0.2-2_ppc64el.deb ... 209s Unpacking librust-mio-dev:ppc64el (1.0.2-2) ... 209s Selecting previously unselected package librust-owning-ref-dev:ppc64el. 209s Preparing to unpack .../261-librust-owning-ref-dev_0.4.1-1_ppc64el.deb ... 209s Unpacking librust-owning-ref-dev:ppc64el (0.4.1-1) ... 209s Selecting previously unselected package librust-scopeguard-dev:ppc64el. 209s Preparing to unpack .../262-librust-scopeguard-dev_1.2.0-1_ppc64el.deb ... 209s Unpacking librust-scopeguard-dev:ppc64el (1.2.0-1) ... 209s Selecting previously unselected package librust-lock-api-dev:ppc64el. 209s Preparing to unpack .../263-librust-lock-api-dev_0.4.12-1_ppc64el.deb ... 209s Unpacking librust-lock-api-dev:ppc64el (0.4.12-1) ... 209s Selecting previously unselected package librust-parking-lot-dev:ppc64el. 209s Preparing to unpack .../264-librust-parking-lot-dev_0.12.1-2build1_ppc64el.deb ... 209s Unpacking librust-parking-lot-dev:ppc64el (0.12.1-2build1) ... 209s Selecting previously unselected package librust-signal-hook-registry-dev:ppc64el. 209s Preparing to unpack .../265-librust-signal-hook-registry-dev_1.4.0-1_ppc64el.deb ... 209s Unpacking librust-signal-hook-registry-dev:ppc64el (1.4.0-1) ... 209s Selecting previously unselected package librust-socket2-dev:ppc64el. 210s Preparing to unpack .../266-librust-socket2-dev_0.5.7-1_ppc64el.deb ... 210s Unpacking librust-socket2-dev:ppc64el (0.5.7-1) ... 210s Selecting previously unselected package librust-tokio-macros-dev:ppc64el. 210s Preparing to unpack .../267-librust-tokio-macros-dev_2.4.0-2_ppc64el.deb ... 210s Unpacking librust-tokio-macros-dev:ppc64el (2.4.0-2) ... 210s Selecting previously unselected package librust-tokio-dev:ppc64el. 210s Preparing to unpack .../268-librust-tokio-dev_1.39.3-3_ppc64el.deb ... 210s Unpacking librust-tokio-dev:ppc64el (1.39.3-3) ... 210s Selecting previously unselected package librust-async-global-executor-dev:ppc64el. 210s Preparing to unpack .../269-librust-async-global-executor-dev_2.4.1-5_ppc64el.deb ... 210s Unpacking librust-async-global-executor-dev:ppc64el (2.4.1-5) ... 210s Selecting previously unselected package librust-async-net-dev. 210s Preparing to unpack .../270-librust-async-net-dev_2.0.0-4_all.deb ... 210s Unpacking librust-async-net-dev (2.0.0-4) ... 210s Selecting previously unselected package librust-async-signal-dev:ppc64el. 210s Preparing to unpack .../271-librust-async-signal-dev_0.2.10-1_ppc64el.deb ... 210s Unpacking librust-async-signal-dev:ppc64el (0.2.10-1) ... 210s Selecting previously unselected package librust-async-process-dev. 210s Preparing to unpack .../272-librust-async-process-dev_2.3.0-1_all.deb ... 210s Unpacking librust-async-process-dev (2.3.0-1) ... 210s Selecting previously unselected package librust-kv-log-macro-dev. 210s Preparing to unpack .../273-librust-kv-log-macro-dev_1.0.8-4_all.deb ... 210s Unpacking librust-kv-log-macro-dev (1.0.8-4) ... 210s Selecting previously unselected package librust-pin-utils-dev:ppc64el. 210s Preparing to unpack .../274-librust-pin-utils-dev_0.1.0-1_ppc64el.deb ... 210s Unpacking librust-pin-utils-dev:ppc64el (0.1.0-1) ... 210s Selecting previously unselected package librust-async-std-dev. 210s Preparing to unpack .../275-librust-async-std-dev_1.12.0-22_all.deb ... 210s Unpacking librust-async-std-dev (1.12.0-22) ... 210s Selecting previously unselected package librust-base64-dev:ppc64el. 210s Preparing to unpack .../276-librust-base64-dev_0.21.7-1_ppc64el.deb ... 210s Unpacking librust-base64-dev:ppc64el (0.21.7-1) ... 210s Selecting previously unselected package librust-bit-vec-dev:ppc64el. 210s Preparing to unpack .../277-librust-bit-vec-dev_0.6.3-1_ppc64el.deb ... 210s Unpacking librust-bit-vec-dev:ppc64el (0.6.3-1) ... 210s Selecting previously unselected package librust-bit-set-dev:ppc64el. 210s Preparing to unpack .../278-librust-bit-set-dev_0.5.2-1_ppc64el.deb ... 210s Unpacking librust-bit-set-dev:ppc64el (0.5.2-1) ... 210s Selecting previously unselected package librust-bit-set+std-dev:ppc64el. 210s Preparing to unpack .../279-librust-bit-set+std-dev_0.5.2-1_ppc64el.deb ... 210s Unpacking librust-bit-set+std-dev:ppc64el (0.5.2-1) ... 210s Selecting previously unselected package librust-regex-syntax-dev:ppc64el. 210s Preparing to unpack .../280-librust-regex-syntax-dev_0.8.2-1_ppc64el.deb ... 210s Unpacking librust-regex-syntax-dev:ppc64el (0.8.2-1) ... 210s Selecting previously unselected package librust-regex-automata-dev:ppc64el. 210s Preparing to unpack .../281-librust-regex-automata-dev_0.4.7-1_ppc64el.deb ... 210s Unpacking librust-regex-automata-dev:ppc64el (0.4.7-1) ... 210s Selecting previously unselected package librust-bstr-dev:ppc64el. 210s Preparing to unpack .../282-librust-bstr-dev_1.7.0-2build1_ppc64el.deb ... 210s Unpacking librust-bstr-dev:ppc64el (1.7.0-2build1) ... 210s Selecting previously unselected package librust-bumpalo-dev:ppc64el. 210s Preparing to unpack .../283-librust-bumpalo-dev_3.16.0-1_ppc64el.deb ... 210s Unpacking librust-bumpalo-dev:ppc64el (3.16.0-1) ... 210s Selecting previously unselected package librust-cast-dev:ppc64el. 210s Preparing to unpack .../284-librust-cast-dev_0.3.0-1_ppc64el.deb ... 210s Unpacking librust-cast-dev:ppc64el (0.3.0-1) ... 210s Selecting previously unselected package librust-iana-time-zone-dev:ppc64el. 210s Preparing to unpack .../285-librust-iana-time-zone-dev_0.1.60-1_ppc64el.deb ... 210s Unpacking librust-iana-time-zone-dev:ppc64el (0.1.60-1) ... 210s Selecting previously unselected package librust-wasm-bindgen-shared-dev:ppc64el. 210s Preparing to unpack .../286-librust-wasm-bindgen-shared-dev_0.2.87-1_ppc64el.deb ... 210s Unpacking librust-wasm-bindgen-shared-dev:ppc64el (0.2.87-1) ... 210s Selecting previously unselected package librust-wasm-bindgen-backend-dev:ppc64el. 210s Preparing to unpack .../287-librust-wasm-bindgen-backend-dev_0.2.87-1_ppc64el.deb ... 210s Unpacking librust-wasm-bindgen-backend-dev:ppc64el (0.2.87-1) ... 210s Selecting previously unselected package librust-wasm-bindgen-macro-support-dev:ppc64el. 210s Preparing to unpack .../288-librust-wasm-bindgen-macro-support-dev_0.2.87-1_ppc64el.deb ... 210s Unpacking librust-wasm-bindgen-macro-support-dev:ppc64el (0.2.87-1) ... 210s Selecting previously unselected package librust-wasm-bindgen-macro-dev:ppc64el. 210s Preparing to unpack .../289-librust-wasm-bindgen-macro-dev_0.2.87-1_ppc64el.deb ... 210s Unpacking librust-wasm-bindgen-macro-dev:ppc64el (0.2.87-1) ... 210s Selecting previously unselected package librust-wasm-bindgen-dev:ppc64el. 210s Preparing to unpack .../290-librust-wasm-bindgen-dev_0.2.87-1_ppc64el.deb ... 210s Unpacking librust-wasm-bindgen-dev:ppc64el (0.2.87-1) ... 210s Selecting previously unselected package librust-wasm-bindgen-macro-support+spans-dev:ppc64el. 210s Preparing to unpack .../291-librust-wasm-bindgen-macro-support+spans-dev_0.2.87-1_ppc64el.deb ... 210s Unpacking librust-wasm-bindgen-macro-support+spans-dev:ppc64el (0.2.87-1) ... 210s Selecting previously unselected package librust-wasm-bindgen-macro+spans-dev:ppc64el. 210s Preparing to unpack .../292-librust-wasm-bindgen-macro+spans-dev_0.2.87-1_ppc64el.deb ... 210s Unpacking librust-wasm-bindgen-macro+spans-dev:ppc64el (0.2.87-1) ... 210s Selecting previously unselected package librust-wasm-bindgen+spans-dev:ppc64el. 210s Preparing to unpack .../293-librust-wasm-bindgen+spans-dev_0.2.87-1_ppc64el.deb ... 210s Unpacking librust-wasm-bindgen+spans-dev:ppc64el (0.2.87-1) ... 210s Selecting previously unselected package librust-wasm-bindgen+default-dev:ppc64el. 210s Preparing to unpack .../294-librust-wasm-bindgen+default-dev_0.2.87-1_ppc64el.deb ... 210s Unpacking librust-wasm-bindgen+default-dev:ppc64el (0.2.87-1) ... 210s Selecting previously unselected package librust-js-sys-dev:ppc64el. 210s Preparing to unpack .../295-librust-js-sys-dev_0.3.64-1_ppc64el.deb ... 210s Unpacking librust-js-sys-dev:ppc64el (0.3.64-1) ... 210s Selecting previously unselected package librust-pure-rust-locales-dev:ppc64el. 210s Preparing to unpack .../296-librust-pure-rust-locales-dev_0.8.1-1_ppc64el.deb ... 210s Unpacking librust-pure-rust-locales-dev:ppc64el (0.8.1-1) ... 210s Selecting previously unselected package librust-chrono-dev:ppc64el. 210s Preparing to unpack .../297-librust-chrono-dev_0.4.38-2_ppc64el.deb ... 210s Unpacking librust-chrono-dev:ppc64el (0.4.38-2) ... 211s Selecting previously unselected package librust-regex-dev:ppc64el. 211s Preparing to unpack .../298-librust-regex-dev_1.10.6-1_ppc64el.deb ... 211s Unpacking librust-regex-dev:ppc64el (1.10.6-1) ... 211s Selecting previously unselected package librust-parse-zoneinfo-dev:ppc64el. 211s Preparing to unpack .../299-librust-parse-zoneinfo-dev_0.3.0-1_ppc64el.deb ... 211s Unpacking librust-parse-zoneinfo-dev:ppc64el (0.3.0-1) ... 211s Selecting previously unselected package librust-siphasher-dev:ppc64el. 211s Preparing to unpack .../300-librust-siphasher-dev_0.3.10-1_ppc64el.deb ... 211s Unpacking librust-siphasher-dev:ppc64el (0.3.10-1) ... 211s Selecting previously unselected package librust-phf-shared-dev:ppc64el. 211s Preparing to unpack .../301-librust-phf-shared-dev_0.11.2-1_ppc64el.deb ... 211s Unpacking librust-phf-shared-dev:ppc64el (0.11.2-1) ... 211s Selecting previously unselected package librust-phf-dev:ppc64el. 211s Preparing to unpack .../302-librust-phf-dev_0.11.2-1_ppc64el.deb ... 211s Unpacking librust-phf-dev:ppc64el (0.11.2-1) ... 211s Selecting previously unselected package librust-uncased-dev:ppc64el. 211s Preparing to unpack .../303-librust-uncased-dev_0.9.6-2_ppc64el.deb ... 211s Unpacking librust-uncased-dev:ppc64el (0.9.6-2) ... 211s Selecting previously unselected package librust-phf-shared+uncased-dev:ppc64el. 211s Preparing to unpack .../304-librust-phf-shared+uncased-dev_0.11.2-1_ppc64el.deb ... 211s Unpacking librust-phf-shared+uncased-dev:ppc64el (0.11.2-1) ... 211s Selecting previously unselected package librust-phf+uncased-dev:ppc64el. 211s Preparing to unpack .../305-librust-phf+uncased-dev_0.11.2-1_ppc64el.deb ... 211s Unpacking librust-phf+uncased-dev:ppc64el (0.11.2-1) ... 211s Selecting previously unselected package librust-ciborium-io-dev:ppc64el. 211s Preparing to unpack .../306-librust-ciborium-io-dev_0.2.2-1_ppc64el.deb ... 211s Unpacking librust-ciborium-io-dev:ppc64el (0.2.2-1) ... 211s Selecting previously unselected package librust-half-dev:ppc64el. 211s Preparing to unpack .../307-librust-half-dev_1.8.2-4_ppc64el.deb ... 211s Unpacking librust-half-dev:ppc64el (1.8.2-4) ... 211s Selecting previously unselected package librust-ciborium-ll-dev:ppc64el. 211s Preparing to unpack .../308-librust-ciborium-ll-dev_0.2.2-1_ppc64el.deb ... 211s Unpacking librust-ciborium-ll-dev:ppc64el (0.2.2-1) ... 211s Selecting previously unselected package librust-ciborium-dev:ppc64el. 211s Preparing to unpack .../309-librust-ciborium-dev_0.2.2-2_ppc64el.deb ... 211s Unpacking librust-ciborium-dev:ppc64el (0.2.2-2) ... 211s Selecting previously unselected package librust-clap-lex-dev:ppc64el. 211s Preparing to unpack .../310-librust-clap-lex-dev_0.7.2-2_ppc64el.deb ... 211s Unpacking librust-clap-lex-dev:ppc64el (0.7.2-2) ... 211s Selecting previously unselected package librust-strsim-dev:ppc64el. 211s Preparing to unpack .../311-librust-strsim-dev_0.11.1-1_ppc64el.deb ... 211s Unpacking librust-strsim-dev:ppc64el (0.11.1-1) ... 211s Selecting previously unselected package librust-terminal-size-dev:ppc64el. 211s Preparing to unpack .../312-librust-terminal-size-dev_0.3.0-2_ppc64el.deb ... 211s Unpacking librust-terminal-size-dev:ppc64el (0.3.0-2) ... 211s Selecting previously unselected package librust-unicase-dev:ppc64el. 211s Preparing to unpack .../313-librust-unicase-dev_2.7.0-1_ppc64el.deb ... 211s Unpacking librust-unicase-dev:ppc64el (2.7.0-1) ... 211s Selecting previously unselected package librust-unicode-width-dev:ppc64el. 211s Preparing to unpack .../314-librust-unicode-width-dev_0.1.13-3_ppc64el.deb ... 211s Unpacking librust-unicode-width-dev:ppc64el (0.1.13-3) ... 211s Selecting previously unselected package librust-clap-builder-dev:ppc64el. 211s Preparing to unpack .../315-librust-clap-builder-dev_4.5.15-2_ppc64el.deb ... 211s Unpacking librust-clap-builder-dev:ppc64el (4.5.15-2) ... 211s Selecting previously unselected package librust-heck-dev:ppc64el. 211s Preparing to unpack .../316-librust-heck-dev_0.4.1-1_ppc64el.deb ... 211s Unpacking librust-heck-dev:ppc64el (0.4.1-1) ... 211s Selecting previously unselected package librust-clap-derive-dev:ppc64el. 211s Preparing to unpack .../317-librust-clap-derive-dev_4.5.13-2_ppc64el.deb ... 211s Unpacking librust-clap-derive-dev:ppc64el (4.5.13-2) ... 211s Selecting previously unselected package librust-clap-dev:ppc64el. 211s Preparing to unpack .../318-librust-clap-dev_4.5.16-1_ppc64el.deb ... 211s Unpacking librust-clap-dev:ppc64el (4.5.16-1) ... 211s Selecting previously unselected package librust-csv-core-dev:ppc64el. 211s Preparing to unpack .../319-librust-csv-core-dev_0.1.11-1_ppc64el.deb ... 211s Unpacking librust-csv-core-dev:ppc64el (0.1.11-1) ... 211s Selecting previously unselected package librust-csv-dev:ppc64el. 211s Preparing to unpack .../320-librust-csv-dev_1.3.0-1_ppc64el.deb ... 211s Unpacking librust-csv-dev:ppc64el (1.3.0-1) ... 211s Selecting previously unselected package librust-futures-sink-dev:ppc64el. 211s Preparing to unpack .../321-librust-futures-sink-dev_0.3.31-1_ppc64el.deb ... 211s Unpacking librust-futures-sink-dev:ppc64el (0.3.31-1) ... 211s Selecting previously unselected package librust-futures-channel-dev:ppc64el. 211s Preparing to unpack .../322-librust-futures-channel-dev_0.3.30-1_ppc64el.deb ... 211s Unpacking librust-futures-channel-dev:ppc64el (0.3.30-1) ... 211s Selecting previously unselected package librust-futures-task-dev:ppc64el. 211s Preparing to unpack .../323-librust-futures-task-dev_0.3.30-1_ppc64el.deb ... 211s Unpacking librust-futures-task-dev:ppc64el (0.3.30-1) ... 211s Selecting previously unselected package librust-futures-macro-dev:ppc64el. 211s Preparing to unpack .../324-librust-futures-macro-dev_0.3.30-1_ppc64el.deb ... 211s Unpacking librust-futures-macro-dev:ppc64el (0.3.30-1) ... 211s Selecting previously unselected package librust-futures-util-dev:ppc64el. 211s Preparing to unpack .../325-librust-futures-util-dev_0.3.30-2_ppc64el.deb ... 211s Unpacking librust-futures-util-dev:ppc64el (0.3.30-2) ... 211s Selecting previously unselected package librust-num-cpus-dev:ppc64el. 211s Preparing to unpack .../326-librust-num-cpus-dev_1.16.0-1_ppc64el.deb ... 211s Unpacking librust-num-cpus-dev:ppc64el (1.16.0-1) ... 211s Selecting previously unselected package librust-futures-executor-dev:ppc64el. 211s Preparing to unpack .../327-librust-futures-executor-dev_0.3.30-1_ppc64el.deb ... 211s Unpacking librust-futures-executor-dev:ppc64el (0.3.30-1) ... 211s Selecting previously unselected package librust-futures-dev:ppc64el. 211s Preparing to unpack .../328-librust-futures-dev_0.3.30-2_ppc64el.deb ... 211s Unpacking librust-futures-dev:ppc64el (0.3.30-2) ... 211s Selecting previously unselected package librust-is-terminal-dev:ppc64el. 211s Preparing to unpack .../329-librust-is-terminal-dev_0.4.13-1_ppc64el.deb ... 211s Unpacking librust-is-terminal-dev:ppc64el (0.4.13-1) ... 211s Selecting previously unselected package librust-itertools-dev:ppc64el. 211s Preparing to unpack .../330-librust-itertools-dev_0.10.5-1_ppc64el.deb ... 211s Unpacking librust-itertools-dev:ppc64el (0.10.5-1) ... 211s Selecting previously unselected package librust-oorandom-dev:ppc64el. 211s Preparing to unpack .../331-librust-oorandom-dev_11.1.3-1_ppc64el.deb ... 211s Unpacking librust-oorandom-dev:ppc64el (11.1.3-1) ... 211s Selecting previously unselected package librust-winapi-i686-pc-windows-gnu-dev:ppc64el. 211s Preparing to unpack .../332-librust-winapi-i686-pc-windows-gnu-dev_0.4.0-1_ppc64el.deb ... 211s Unpacking librust-winapi-i686-pc-windows-gnu-dev:ppc64el (0.4.0-1) ... 212s Selecting previously unselected package librust-winapi-x86-64-pc-windows-gnu-dev:ppc64el. 212s Preparing to unpack .../333-librust-winapi-x86-64-pc-windows-gnu-dev_0.4.0-1_ppc64el.deb ... 212s Unpacking librust-winapi-x86-64-pc-windows-gnu-dev:ppc64el (0.4.0-1) ... 212s Selecting previously unselected package librust-winapi-dev:ppc64el. 212s Preparing to unpack .../334-librust-winapi-dev_0.3.9-1_ppc64el.deb ... 212s Unpacking librust-winapi-dev:ppc64el (0.3.9-1) ... 212s Selecting previously unselected package librust-dirs-sys-next-dev:ppc64el. 212s Preparing to unpack .../335-librust-dirs-sys-next-dev_0.1.1-1_ppc64el.deb ... 212s Unpacking librust-dirs-sys-next-dev:ppc64el (0.1.1-1) ... 212s Selecting previously unselected package librust-dirs-next-dev:ppc64el. 212s Preparing to unpack .../336-librust-dirs-next-dev_2.0.0-1_ppc64el.deb ... 212s Unpacking librust-dirs-next-dev:ppc64el (2.0.0-1) ... 212s Selecting previously unselected package librust-float-ord-dev:ppc64el. 212s Preparing to unpack .../337-librust-float-ord-dev_0.3.2-1_ppc64el.deb ... 212s Unpacking librust-float-ord-dev:ppc64el (0.3.2-1) ... 212s Selecting previously unselected package librust-cmake-dev:ppc64el. 212s Preparing to unpack .../338-librust-cmake-dev_0.1.45-1_ppc64el.deb ... 212s Unpacking librust-cmake-dev:ppc64el (0.1.45-1) ... 212s Selecting previously unselected package librust-freetype-sys-dev:ppc64el. 212s Preparing to unpack .../339-librust-freetype-sys-dev_0.13.1-1_ppc64el.deb ... 212s Unpacking librust-freetype-sys-dev:ppc64el (0.13.1-1) ... 212s Selecting previously unselected package librust-freetype-dev:ppc64el. 212s Preparing to unpack .../340-librust-freetype-dev_0.7.0-4_ppc64el.deb ... 212s Unpacking librust-freetype-dev:ppc64el (0.7.0-4) ... 212s Selecting previously unselected package librust-spin-dev:ppc64el. 212s Preparing to unpack .../341-librust-spin-dev_0.9.8-4_ppc64el.deb ... 212s Unpacking librust-spin-dev:ppc64el (0.9.8-4) ... 212s Selecting previously unselected package librust-lazy-static-dev:ppc64el. 212s Preparing to unpack .../342-librust-lazy-static-dev_1.4.0-2_ppc64el.deb ... 212s Unpacking librust-lazy-static-dev:ppc64el (1.4.0-2) ... 212s Selecting previously unselected package librust-pathfinder-simd-dev:ppc64el. 212s Preparing to unpack .../343-librust-pathfinder-simd-dev_0.5.2-1_ppc64el.deb ... 212s Unpacking librust-pathfinder-simd-dev:ppc64el (0.5.2-1) ... 212s Selecting previously unselected package librust-pathfinder-geometry-dev:ppc64el. 212s Preparing to unpack .../344-librust-pathfinder-geometry-dev_0.5.1-1_ppc64el.deb ... 212s Unpacking librust-pathfinder-geometry-dev:ppc64el (0.5.1-1) ... 212s Selecting previously unselected package librust-winapi-util-dev:ppc64el. 212s Preparing to unpack .../345-librust-winapi-util-dev_0.1.6-1_ppc64el.deb ... 212s Unpacking librust-winapi-util-dev:ppc64el (0.1.6-1) ... 212s Selecting previously unselected package librust-same-file-dev:ppc64el. 212s Preparing to unpack .../346-librust-same-file-dev_1.0.6-1_ppc64el.deb ... 212s Unpacking librust-same-file-dev:ppc64el (1.0.6-1) ... 212s Selecting previously unselected package librust-walkdir-dev:ppc64el. 212s Preparing to unpack .../347-librust-walkdir-dev_2.5.0-1_ppc64el.deb ... 212s Unpacking librust-walkdir-dev:ppc64el (2.5.0-1) ... 212s Selecting previously unselected package librust-const-cstr-dev:ppc64el. 212s Preparing to unpack .../348-librust-const-cstr-dev_0.3.0-1_ppc64el.deb ... 212s Unpacking librust-const-cstr-dev:ppc64el (0.3.0-1) ... 212s Selecting previously unselected package librust-libloading-dev:ppc64el. 212s Preparing to unpack .../349-librust-libloading-dev_0.8.5-1_ppc64el.deb ... 212s Unpacking librust-libloading-dev:ppc64el (0.8.5-1) ... 212s Selecting previously unselected package librust-dlib-dev:ppc64el. 212s Preparing to unpack .../350-librust-dlib-dev_0.5.2-2_ppc64el.deb ... 212s Unpacking librust-dlib-dev:ppc64el (0.5.2-2) ... 212s Selecting previously unselected package librust-yeslogic-fontconfig-sys-dev:ppc64el. 212s Preparing to unpack .../351-librust-yeslogic-fontconfig-sys-dev_3.0.1-1_ppc64el.deb ... 212s Unpacking librust-yeslogic-fontconfig-sys-dev:ppc64el (3.0.1-1) ... 212s Selecting previously unselected package librust-font-kit-dev:ppc64el. 212s Preparing to unpack .../352-librust-font-kit-dev_0.11.0-2_ppc64el.deb ... 212s Unpacking librust-font-kit-dev:ppc64el (0.11.0-2) ... 212s Selecting previously unselected package librust-color-quant-dev:ppc64el. 212s Preparing to unpack .../353-librust-color-quant-dev_1.1.0-1_ppc64el.deb ... 212s Unpacking librust-color-quant-dev:ppc64el (1.1.0-1) ... 212s Selecting previously unselected package librust-weezl-dev:ppc64el. 212s Preparing to unpack .../354-librust-weezl-dev_0.1.5-1_ppc64el.deb ... 212s Unpacking librust-weezl-dev:ppc64el (0.1.5-1) ... 212s Selecting previously unselected package librust-gif-dev:ppc64el. 212s Preparing to unpack .../355-librust-gif-dev_0.11.3-1_ppc64el.deb ... 212s Unpacking librust-gif-dev:ppc64el (0.11.3-1) ... 212s Selecting previously unselected package librust-jpeg-decoder-dev:ppc64el. 212s Preparing to unpack .../356-librust-jpeg-decoder-dev_0.3.0-1_ppc64el.deb ... 212s Unpacking librust-jpeg-decoder-dev:ppc64el (0.3.0-1) ... 212s Selecting previously unselected package librust-num-integer-dev:ppc64el. 212s Preparing to unpack .../357-librust-num-integer-dev_0.1.46-1_ppc64el.deb ... 212s Unpacking librust-num-integer-dev:ppc64el (0.1.46-1) ... 212s Selecting previously unselected package librust-humantime-dev:ppc64el. 212s Preparing to unpack .../358-librust-humantime-dev_2.1.0-1_ppc64el.deb ... 212s Unpacking librust-humantime-dev:ppc64el (2.1.0-1) ... 212s Selecting previously unselected package librust-termcolor-dev:ppc64el. 212s Preparing to unpack .../359-librust-termcolor-dev_1.4.1-1_ppc64el.deb ... 212s Unpacking librust-termcolor-dev:ppc64el (1.4.1-1) ... 212s Selecting previously unselected package librust-env-logger-dev:ppc64el. 212s Preparing to unpack .../360-librust-env-logger-dev_0.10.2-2_ppc64el.deb ... 212s Unpacking librust-env-logger-dev:ppc64el (0.10.2-2) ... 212s Selecting previously unselected package librust-quickcheck-dev:ppc64el. 212s Preparing to unpack .../361-librust-quickcheck-dev_1.0.3-3_ppc64el.deb ... 212s Unpacking librust-quickcheck-dev:ppc64el (1.0.3-3) ... 212s Selecting previously unselected package librust-num-bigint-dev:ppc64el. 212s Preparing to unpack .../362-librust-num-bigint-dev_0.4.6-1_ppc64el.deb ... 212s Unpacking librust-num-bigint-dev:ppc64el (0.4.6-1) ... 212s Selecting previously unselected package librust-num-rational-dev:ppc64el. 212s Preparing to unpack .../363-librust-num-rational-dev_0.4.2-1_ppc64el.deb ... 212s Unpacking librust-num-rational-dev:ppc64el (0.4.2-1) ... 213s Selecting previously unselected package librust-png-dev:ppc64el. 213s Preparing to unpack .../364-librust-png-dev_0.17.7-3_ppc64el.deb ... 213s Unpacking librust-png-dev:ppc64el (0.17.7-3) ... 213s Selecting previously unselected package librust-qoi-dev:ppc64el. 213s Preparing to unpack .../365-librust-qoi-dev_0.4.1-2_ppc64el.deb ... 213s Unpacking librust-qoi-dev:ppc64el (0.4.1-2) ... 213s Selecting previously unselected package librust-tiff-dev:ppc64el. 213s Preparing to unpack .../366-librust-tiff-dev_0.9.0-1_ppc64el.deb ... 213s Unpacking librust-tiff-dev:ppc64el (0.9.0-1) ... 213s Selecting previously unselected package libsharpyuv0:ppc64el. 213s Preparing to unpack .../367-libsharpyuv0_1.4.0-0.1_ppc64el.deb ... 213s Unpacking libsharpyuv0:ppc64el (1.4.0-0.1) ... 213s Selecting previously unselected package libwebp7:ppc64el. 213s Preparing to unpack .../368-libwebp7_1.4.0-0.1_ppc64el.deb ... 213s Unpacking libwebp7:ppc64el (1.4.0-0.1) ... 213s Selecting previously unselected package libwebpdemux2:ppc64el. 213s Preparing to unpack .../369-libwebpdemux2_1.4.0-0.1_ppc64el.deb ... 213s Unpacking libwebpdemux2:ppc64el (1.4.0-0.1) ... 213s Selecting previously unselected package libwebpmux3:ppc64el. 213s Preparing to unpack .../370-libwebpmux3_1.4.0-0.1_ppc64el.deb ... 213s Unpacking libwebpmux3:ppc64el (1.4.0-0.1) ... 213s Selecting previously unselected package libwebpdecoder3:ppc64el. 213s Preparing to unpack .../371-libwebpdecoder3_1.4.0-0.1_ppc64el.deb ... 213s Unpacking libwebpdecoder3:ppc64el (1.4.0-0.1) ... 213s Selecting previously unselected package libsharpyuv-dev:ppc64el. 213s Preparing to unpack .../372-libsharpyuv-dev_1.4.0-0.1_ppc64el.deb ... 213s Unpacking libsharpyuv-dev:ppc64el (1.4.0-0.1) ... 213s Selecting previously unselected package libwebp-dev:ppc64el. 213s Preparing to unpack .../373-libwebp-dev_1.4.0-0.1_ppc64el.deb ... 213s Unpacking libwebp-dev:ppc64el (1.4.0-0.1) ... 213s Selecting previously unselected package librust-libwebp-sys-dev:ppc64el. 213s Preparing to unpack .../374-librust-libwebp-sys-dev_0.9.5-1build1_ppc64el.deb ... 213s Unpacking librust-libwebp-sys-dev:ppc64el (0.9.5-1build1) ... 213s Selecting previously unselected package librust-webp-dev:ppc64el. 213s Preparing to unpack .../375-librust-webp-dev_0.2.6-1_ppc64el.deb ... 213s Unpacking librust-webp-dev:ppc64el (0.2.6-1) ... 213s Selecting previously unselected package librust-image-dev:ppc64el. 213s Preparing to unpack .../376-librust-image-dev_0.24.7-2_ppc64el.deb ... 213s Unpacking librust-image-dev:ppc64el (0.24.7-2) ... 213s Selecting previously unselected package librust-plotters-backend-dev:ppc64el. 213s Preparing to unpack .../377-librust-plotters-backend-dev_0.3.5-1_ppc64el.deb ... 213s Unpacking librust-plotters-backend-dev:ppc64el (0.3.5-1) ... 213s Selecting previously unselected package librust-plotters-bitmap-dev:ppc64el. 213s Preparing to unpack .../378-librust-plotters-bitmap-dev_0.3.3-3_ppc64el.deb ... 213s Unpacking librust-plotters-bitmap-dev:ppc64el (0.3.3-3) ... 213s Selecting previously unselected package librust-plotters-svg-dev:ppc64el. 213s Preparing to unpack .../379-librust-plotters-svg-dev_0.3.5-1_ppc64el.deb ... 213s Unpacking librust-plotters-svg-dev:ppc64el (0.3.5-1) ... 213s Selecting previously unselected package librust-web-sys-dev:ppc64el. 213s Preparing to unpack .../380-librust-web-sys-dev_0.3.64-2_ppc64el.deb ... 213s Unpacking librust-web-sys-dev:ppc64el (0.3.64-2) ... 213s Selecting previously unselected package librust-plotters-dev:ppc64el. 213s Preparing to unpack .../381-librust-plotters-dev_0.3.5-4_ppc64el.deb ... 213s Unpacking librust-plotters-dev:ppc64el (0.3.5-4) ... 213s Selecting previously unselected package librust-smol-dev. 213s Preparing to unpack .../382-librust-smol-dev_2.0.2-1_all.deb ... 213s Unpacking librust-smol-dev (2.0.2-1) ... 214s Selecting previously unselected package librust-tinytemplate-dev:ppc64el. 214s Preparing to unpack .../383-librust-tinytemplate-dev_1.2.1-1_ppc64el.deb ... 214s Unpacking librust-tinytemplate-dev:ppc64el (1.2.1-1) ... 214s Selecting previously unselected package librust-criterion-dev. 214s Preparing to unpack .../384-librust-criterion-dev_0.5.1-6_all.deb ... 214s Unpacking librust-criterion-dev (0.5.1-6) ... 214s Selecting previously unselected package librust-phf-generator-dev:ppc64el. 214s Preparing to unpack .../385-librust-phf-generator-dev_0.11.2-2_ppc64el.deb ... 214s Unpacking librust-phf-generator-dev:ppc64el (0.11.2-2) ... 214s Selecting previously unselected package librust-phf-codegen-dev:ppc64el. 214s Preparing to unpack .../386-librust-phf-codegen-dev_0.11.2-1_ppc64el.deb ... 214s Unpacking librust-phf-codegen-dev:ppc64el (0.11.2-1) ... 214s Selecting previously unselected package librust-chrono-tz-build-dev:ppc64el. 214s Preparing to unpack .../387-librust-chrono-tz-build-dev_0.2.1-1_ppc64el.deb ... 214s Unpacking librust-chrono-tz-build-dev:ppc64el (0.2.1-1) ... 214s Selecting previously unselected package librust-chrono-tz-dev:ppc64el. 214s Preparing to unpack .../388-librust-chrono-tz-dev_0.8.6-2_ppc64el.deb ... 214s Unpacking librust-chrono-tz-dev:ppc64el (0.8.6-2) ... 214s Selecting previously unselected package librust-ctor-dev:ppc64el. 214s Preparing to unpack .../389-librust-ctor-dev_0.1.26-1_ppc64el.deb ... 214s Unpacking librust-ctor-dev:ppc64el (0.1.26-1) ... 214s Selecting previously unselected package librust-powerfmt-macros-dev:ppc64el. 214s Preparing to unpack .../390-librust-powerfmt-macros-dev_0.1.0-1_ppc64el.deb ... 214s Unpacking librust-powerfmt-macros-dev:ppc64el (0.1.0-1) ... 214s Selecting previously unselected package librust-powerfmt-dev:ppc64el. 214s Preparing to unpack .../391-librust-powerfmt-dev_0.2.0-1_ppc64el.deb ... 214s Unpacking librust-powerfmt-dev:ppc64el (0.2.0-1) ... 214s Selecting previously unselected package librust-deranged-dev:ppc64el. 214s Preparing to unpack .../392-librust-deranged-dev_0.3.11-1_ppc64el.deb ... 214s Unpacking librust-deranged-dev:ppc64el (0.3.11-1) ... 214s Selecting previously unselected package librust-eui48-dev:ppc64el. 214s Preparing to unpack .../393-librust-eui48-dev_1.1.0-2_ppc64el.deb ... 214s Unpacking librust-eui48-dev:ppc64el (1.1.0-2) ... 214s Selecting previously unselected package librust-indenter-dev:ppc64el. 214s Preparing to unpack .../394-librust-indenter-dev_0.3.3-1_ppc64el.deb ... 214s Unpacking librust-indenter-dev:ppc64el (0.3.3-1) ... 214s Selecting previously unselected package librust-eyre-dev:ppc64el. 214s Preparing to unpack .../395-librust-eyre-dev_0.6.12-1_ppc64el.deb ... 214s Unpacking librust-eyre-dev:ppc64el (0.6.12-1) ... 214s Selecting previously unselected package librust-eyre+default-dev:ppc64el. 214s Preparing to unpack .../396-librust-eyre+default-dev_0.6.12-1_ppc64el.deb ... 214s Unpacking librust-eyre+default-dev:ppc64el (0.6.12-1) ... 214s Selecting previously unselected package librust-fancy-regex-dev:ppc64el. 214s Preparing to unpack .../397-librust-fancy-regex-dev_0.11.0-2_ppc64el.deb ... 214s Unpacking librust-fancy-regex-dev:ppc64el (0.11.0-2) ... 214s Selecting previously unselected package librust-fnv-dev:ppc64el. 214s Preparing to unpack .../398-librust-fnv-dev_1.0.7-1_ppc64el.deb ... 214s Unpacking librust-fnv-dev:ppc64el (1.0.7-1) ... 214s Selecting previously unselected package librust-geo-types-dev:ppc64el. 214s Preparing to unpack .../399-librust-geo-types-dev_0.7.11-2_ppc64el.deb ... 214s Unpacking librust-geo-types-dev:ppc64el (0.7.11-2) ... 214s Selecting previously unselected package librust-ghost-dev:ppc64el. 214s Preparing to unpack .../400-librust-ghost-dev_0.1.5-1_ppc64el.deb ... 214s Unpacking librust-ghost-dev:ppc64el (0.1.5-1) ... 214s Selecting previously unselected package librust-hmac-dev:ppc64el. 214s Preparing to unpack .../401-librust-hmac-dev_0.12.1-1_ppc64el.deb ... 214s Unpacking librust-hmac-dev:ppc64el (0.12.1-1) ... 214s Selecting previously unselected package librust-indoc-dev:ppc64el. 214s Preparing to unpack .../402-librust-indoc-dev_2.0.5-1_ppc64el.deb ... 214s Unpacking librust-indoc-dev:ppc64el (2.0.5-1) ... 214s Selecting previously unselected package librust-inventory-dev:ppc64el. 214s Preparing to unpack .../403-librust-inventory-dev_0.3.2-1_ppc64el.deb ... 214s Unpacking librust-inventory-dev:ppc64el (0.3.2-1) ... 214s Selecting previously unselected package librust-memoffset-dev:ppc64el. 214s Preparing to unpack .../404-librust-memoffset-dev_0.8.0-1_ppc64el.deb ... 214s Unpacking librust-memoffset-dev:ppc64el (0.8.0-1) ... 214s Selecting previously unselected package librust-num-threads-dev:ppc64el. 214s Preparing to unpack .../405-librust-num-threads-dev_0.1.7-1_ppc64el.deb ... 214s Unpacking librust-num-threads-dev:ppc64el (0.1.7-1) ... 214s Selecting previously unselected package librust-postgres-derive-dev:ppc64el. 214s Preparing to unpack .../406-librust-postgres-derive-dev_0.4.5-1_ppc64el.deb ... 214s Unpacking librust-postgres-derive-dev:ppc64el (0.4.5-1) ... 214s Selecting previously unselected package librust-sha2-asm-dev:ppc64el. 214s Preparing to unpack .../407-librust-sha2-asm-dev_0.6.2-2_ppc64el.deb ... 214s Unpacking librust-sha2-asm-dev:ppc64el (0.6.2-2) ... 214s Selecting previously unselected package librust-sha2-dev:ppc64el. 214s Preparing to unpack .../408-librust-sha2-dev_0.10.8-1_ppc64el.deb ... 214s Unpacking librust-sha2-dev:ppc64el (0.10.8-1) ... 214s Selecting previously unselected package librust-unicode-bidi-dev:ppc64el. 214s Preparing to unpack .../409-librust-unicode-bidi-dev_0.3.13-1_ppc64el.deb ... 214s Unpacking librust-unicode-bidi-dev:ppc64el (0.3.13-1) ... 214s Selecting previously unselected package librust-unicode-normalization-dev:ppc64el. 214s Preparing to unpack .../410-librust-unicode-normalization-dev_0.1.22-1_ppc64el.deb ... 214s Unpacking librust-unicode-normalization-dev:ppc64el (0.1.22-1) ... 214s Selecting previously unselected package librust-stringprep-dev:ppc64el. 214s Preparing to unpack .../411-librust-stringprep-dev_0.1.2-1_ppc64el.deb ... 214s Unpacking librust-stringprep-dev:ppc64el (0.1.2-1) ... 214s Selecting previously unselected package librust-postgres-protocol-dev:ppc64el. 214s Preparing to unpack .../412-librust-postgres-protocol-dev_0.6.6-2_ppc64el.deb ... 214s Unpacking librust-postgres-protocol-dev:ppc64el (0.6.6-2) ... 214s Selecting previously unselected package librust-time-core-dev:ppc64el. 214s Preparing to unpack .../413-librust-time-core-dev_0.1.2-1_ppc64el.deb ... 214s Unpacking librust-time-core-dev:ppc64el (0.1.2-1) ... 214s Selecting previously unselected package librust-time-macros-dev:ppc64el. 214s Preparing to unpack .../414-librust-time-macros-dev_0.2.16-1_ppc64el.deb ... 214s Unpacking librust-time-macros-dev:ppc64el (0.2.16-1) ... 214s Selecting previously unselected package librust-time-dev:ppc64el. 214s Preparing to unpack .../415-librust-time-dev_0.3.31-2_ppc64el.deb ... 214s Unpacking librust-time-dev:ppc64el (0.3.31-2) ... 214s Selecting previously unselected package librust-postgres-types-dev:ppc64el. 214s Preparing to unpack .../416-librust-postgres-types-dev_0.2.6-2_ppc64el.deb ... 214s Unpacking librust-postgres-types-dev:ppc64el (0.2.6-2) ... 215s Selecting previously unselected package librust-rand-xorshift-dev:ppc64el. 215s Preparing to unpack .../417-librust-rand-xorshift-dev_0.3.0-2_ppc64el.deb ... 215s Unpacking librust-rand-xorshift-dev:ppc64el (0.3.0-2) ... 215s Selecting previously unselected package librust-quick-error-dev:ppc64el. 215s Preparing to unpack .../418-librust-quick-error-dev_2.0.1-1_ppc64el.deb ... 215s Unpacking librust-quick-error-dev:ppc64el (2.0.1-1) ... 215s Selecting previously unselected package librust-tempfile-dev:ppc64el. 215s Preparing to unpack .../419-librust-tempfile-dev_3.10.1-1_ppc64el.deb ... 215s Unpacking librust-tempfile-dev:ppc64el (3.10.1-1) ... 215s Selecting previously unselected package librust-rusty-fork-dev:ppc64el. 215s Preparing to unpack .../420-librust-rusty-fork-dev_0.3.0-1_ppc64el.deb ... 215s Unpacking librust-rusty-fork-dev:ppc64el (0.3.0-1) ... 215s Selecting previously unselected package librust-wait-timeout-dev:ppc64el. 215s Preparing to unpack .../421-librust-wait-timeout-dev_0.2.0-1_ppc64el.deb ... 215s Unpacking librust-wait-timeout-dev:ppc64el (0.2.0-1) ... 215s Selecting previously unselected package librust-rusty-fork+wait-timeout-dev:ppc64el. 215s Preparing to unpack .../422-librust-rusty-fork+wait-timeout-dev_0.3.0-1_ppc64el.deb ... 215s Unpacking librust-rusty-fork+wait-timeout-dev:ppc64el (0.3.0-1) ... 215s Selecting previously unselected package librust-unarray-dev:ppc64el. 215s Preparing to unpack .../423-librust-unarray-dev_0.1.4-1_ppc64el.deb ... 215s Unpacking librust-unarray-dev:ppc64el (0.1.4-1) ... 215s Selecting previously unselected package librust-proptest-dev:ppc64el. 215s Preparing to unpack .../424-librust-proptest-dev_1.5.0-2_ppc64el.deb ... 215s Unpacking librust-proptest-dev:ppc64el (1.5.0-2) ... 215s Selecting previously unselected package llvm-19-runtime. 215s Preparing to unpack .../425-llvm-19-runtime_1%3a19.1.2-1ubuntu1_ppc64el.deb ... 215s Unpacking llvm-19-runtime (1:19.1.2-1ubuntu1) ... 215s Selecting previously unselected package llvm-runtime:ppc64el. 215s Preparing to unpack .../426-llvm-runtime_1%3a19.0-60~exp1_ppc64el.deb ... 215s Unpacking llvm-runtime:ppc64el (1:19.0-60~exp1) ... 215s Selecting previously unselected package llvm-19-linker-tools. 215s Preparing to unpack .../427-llvm-19-linker-tools_1%3a19.1.2-1ubuntu1_ppc64el.deb ... 215s Unpacking llvm-19-linker-tools (1:19.1.2-1ubuntu1) ... 215s Selecting previously unselected package libpfm4:ppc64el. 215s Preparing to unpack .../428-libpfm4_4.13.0+git83-g91970fe-1_ppc64el.deb ... 215s Unpacking libpfm4:ppc64el (4.13.0+git83-g91970fe-1) ... 215s Selecting previously unselected package llvm-19. 215s Preparing to unpack .../429-llvm-19_1%3a19.1.2-1ubuntu1_ppc64el.deb ... 215s Unpacking llvm-19 (1:19.1.2-1ubuntu1) ... 215s Selecting previously unselected package llvm. 215s Preparing to unpack .../430-llvm_1%3a19.0-60~exp1_ppc64el.deb ... 215s Unpacking llvm (1:19.0-60~exp1) ... 215s Selecting previously unselected package binutils-mingw-w64-x86-64. 215s Preparing to unpack .../431-binutils-mingw-w64-x86-64_2.43.1-4ubuntu1+12_ppc64el.deb ... 215s Unpacking binutils-mingw-w64-x86-64 (2.43.1-4ubuntu1+12) ... 216s Selecting previously unselected package binutils-mingw-w64-i686. 216s Preparing to unpack .../432-binutils-mingw-w64-i686_2.43.1-4ubuntu1+12_ppc64el.deb ... 216s Unpacking binutils-mingw-w64-i686 (2.43.1-4ubuntu1+12) ... 216s Selecting previously unselected package librust-python3-dll-a-dev:ppc64el. 216s Preparing to unpack .../433-librust-python3-dll-a-dev_0.2.10-1_ppc64el.deb ... 216s Unpacking librust-python3-dll-a-dev:ppc64el (0.2.10-1) ... 216s Selecting previously unselected package librust-target-lexicon-dev:ppc64el. 216s Preparing to unpack .../434-librust-target-lexicon-dev_0.12.14-1_ppc64el.deb ... 216s Unpacking librust-target-lexicon-dev:ppc64el (0.12.14-1) ... 216s Selecting previously unselected package librust-pyo3-build-config-dev:ppc64el. 216s Preparing to unpack .../435-librust-pyo3-build-config-dev_0.22.5-1_ppc64el.deb ... 216s Unpacking librust-pyo3-build-config-dev:ppc64el (0.22.5-1) ... 216s Selecting previously unselected package python3.12-dev. 216s Preparing to unpack .../436-python3.12-dev_3.12.7-2_ppc64el.deb ... 216s Unpacking python3.12-dev (3.12.7-2) ... 216s Selecting previously unselected package librust-pyo3-ffi-dev:ppc64el. 216s Preparing to unpack .../437-librust-pyo3-ffi-dev_0.22.5-1_ppc64el.deb ... 216s Unpacking librust-pyo3-ffi-dev:ppc64el (0.22.5-1) ... 216s Selecting previously unselected package librust-pyo3-macros-backend-dev:ppc64el. 216s Preparing to unpack .../438-librust-pyo3-macros-backend-dev_0.22.5-1_ppc64el.deb ... 216s Unpacking librust-pyo3-macros-backend-dev:ppc64el (0.22.5-1) ... 216s Selecting previously unselected package librust-pyo3-macros-dev:ppc64el. 216s Preparing to unpack .../439-librust-pyo3-macros-dev_0.22.5-1_ppc64el.deb ... 216s Unpacking librust-pyo3-macros-dev:ppc64el (0.22.5-1) ... 216s Selecting previously unselected package librust-rust-decimal-dev:ppc64el. 216s Preparing to unpack .../440-librust-rust-decimal-dev_1.36.0-1_ppc64el.deb ... 216s Unpacking librust-rust-decimal-dev:ppc64el (1.36.0-1) ... 216s Selecting previously unselected package librust-unindent-dev:ppc64el. 216s Preparing to unpack .../441-librust-unindent-dev_0.2.3-1_ppc64el.deb ... 216s Unpacking librust-unindent-dev:ppc64el (0.2.3-1) ... 216s Selecting previously unselected package librust-pyo3-dev:ppc64el. 216s Preparing to unpack .../442-librust-pyo3-dev_0.22.5-1_ppc64el.deb ... 216s Unpacking librust-pyo3-dev:ppc64el (0.22.5-1) ... 216s Selecting previously unselected package librust-rustc-hash-dev:ppc64el. 216s Preparing to unpack .../443-librust-rustc-hash-dev_1.1.0-1_ppc64el.deb ... 216s Unpacking librust-rustc-hash-dev:ppc64el (1.1.0-1) ... 216s Selecting previously unselected package pybuild-plugin-autopkgtest. 216s Preparing to unpack .../444-pybuild-plugin-autopkgtest_6.20241024_all.deb ... 216s Unpacking pybuild-plugin-autopkgtest (6.20241024) ... 216s Selecting previously unselected package python3-packaging. 216s Preparing to unpack .../445-python3-packaging_24.1-1_all.deb ... 216s Unpacking python3-packaging (24.1-1) ... 216s Selecting previously unselected package python3-pyproject-hooks. 216s Preparing to unpack .../446-python3-pyproject-hooks_1.2.0-1_all.deb ... 216s Unpacking python3-pyproject-hooks (1.2.0-1) ... 216s Selecting previously unselected package python3-toml. 216s Preparing to unpack .../447-python3-toml_0.10.2-1_all.deb ... 216s Unpacking python3-toml (0.10.2-1) ... 216s Selecting previously unselected package python3-wheel. 216s Preparing to unpack .../448-python3-wheel_0.44.0-1_all.deb ... 216s Unpacking python3-wheel (0.44.0-1) ... 216s Selecting previously unselected package python3-build. 216s Preparing to unpack .../449-python3-build_1.2.2-1_all.deb ... 216s Unpacking python3-build (1.2.2-1) ... 216s Selecting previously unselected package python3-installer. 216s Preparing to unpack .../450-python3-installer_0.7.0+dfsg1-3_all.deb ... 216s Unpacking python3-installer (0.7.0+dfsg1-3) ... 216s Selecting previously unselected package pybuild-plugin-pyproject. 216s Preparing to unpack .../451-pybuild-plugin-pyproject_6.20241024_all.deb ... 216s Unpacking pybuild-plugin-pyproject (6.20241024) ... 216s Selecting previously unselected package python3-all. 216s Preparing to unpack .../452-python3-all_3.12.6-0ubuntu1_ppc64el.deb ... 216s Unpacking python3-all (3.12.6-0ubuntu1) ... 216s Selecting previously unselected package python3-six. 216s Preparing to unpack .../453-python3-six_1.16.0-7_all.deb ... 216s Unpacking python3-six (1.16.0-7) ... 216s Selecting previously unselected package python3-dateutil. 216s Preparing to unpack .../454-python3-dateutil_2.9.0-2_all.deb ... 216s Unpacking python3-dateutil (2.9.0-2) ... 216s Selecting previously unselected package python3-sortedcontainers. 216s Preparing to unpack .../455-python3-sortedcontainers_2.4.0-2_all.deb ... 216s Unpacking python3-sortedcontainers (2.4.0-2) ... 216s Selecting previously unselected package python3-hypothesis. 216s Preparing to unpack .../456-python3-hypothesis_6.105.1-1_all.deb ... 216s Unpacking python3-hypothesis (6.105.1-1) ... 217s Selecting previously unselected package python3-iniconfig. 217s Preparing to unpack .../457-python3-iniconfig_1.1.1-2_all.deb ... 217s Unpacking python3-iniconfig (1.1.1-2) ... 217s Selecting previously unselected package python3-pluggy. 217s Preparing to unpack .../458-python3-pluggy_1.5.0-1_all.deb ... 217s Unpacking python3-pluggy (1.5.0-1) ... 217s Selecting previously unselected package python3-pytest. 217s Preparing to unpack .../459-python3-pytest_8.3.2-1_all.deb ... 217s Unpacking python3-pytest (8.3.2-1) ... 217s Selecting previously unselected package python3-regex. 217s Preparing to unpack .../460-python3-regex_0.1.20240724-1_ppc64el.deb ... 217s Unpacking python3-regex (0.1.20240724-1) ... 217s Selecting previously unselected package python3-semantic-version. 217s Preparing to unpack .../461-python3-semantic-version_2.10.0-2_all.deb ... 217s Unpacking python3-semantic-version (2.10.0-2) ... 217s Selecting previously unselected package rustc. 217s Preparing to unpack .../462-rustc_1.80.1ubuntu2_ppc64el.deb ... 217s Unpacking rustc (1.80.1ubuntu2) ... 217s Selecting previously unselected package cargo. 217s Preparing to unpack .../463-cargo_1.80.1ubuntu2_ppc64el.deb ... 217s Unpacking cargo (1.80.1ubuntu2) ... 217s Selecting previously unselected package python3-setuptools-rust. 217s Preparing to unpack .../464-python3-setuptools-rust_1.9.0+dfsg-2_all.deb ... 217s Unpacking python3-setuptools-rust (1.9.0+dfsg-2) ... 217s Selecting previously unselected package python3-tiktoken. 217s Preparing to unpack .../465-python3-tiktoken_0.8.0-1_ppc64el.deb ... 217s Unpacking python3-tiktoken (0.8.0-1) ... 217s Selecting previously unselected package autopkgtest-satdep. 217s Preparing to unpack .../466-1-autopkgtest-satdep.deb ... 217s Unpacking autopkgtest-satdep (0) ... 217s Setting up dh-python (6.20241024) ... 217s Setting up librust-ciborium-io-dev:ppc64el (0.2.2-1) ... 217s Setting up librust-crossbeam-utils-dev:ppc64el (0.8.19-1) ... 217s Setting up librust-parking-dev:ppc64el (2.2.0-1) ... 217s Setting up librust-ppv-lite86-dev:ppc64el (0.2.16-1) ... 217s Setting up python3-iniconfig (1.1.1-2) ... 217s Setting up libsharpyuv0:ppc64el (1.4.0-0.1) ... 217s Setting up librust-pin-utils-dev:ppc64el (0.1.0-1) ... 217s Setting up librust-fnv-dev:ppc64el (1.0.7-1) ... 217s Setting up librust-libc-dev:ppc64el (0.2.155-1) ... 217s Setting up librust-unindent-dev:ppc64el (0.2.3-1) ... 217s Setting up librust-quick-error-dev:ppc64el (2.0.1-1) ... 217s Setting up librust-is-terminal-dev:ppc64el (0.4.13-1) ... 217s Setting up librust-traitobject-dev:ppc64el (0.1.0-1) ... 217s Setting up librust-either-dev:ppc64el (1.13.0-1) ... 217s Setting up binutils-mingw-w64-x86-64 (2.43.1-4ubuntu1+12) ... 217s Setting up librust-adler-dev:ppc64el (1.0.2-2) ... 217s Setting up librust-version-check-dev:ppc64el (0.9.5-1) ... 217s Setting up librust-base64-dev:ppc64el (0.21.7-1) ... 217s Setting up librust-indoc-dev:ppc64el (2.0.5-1) ... 217s Setting up librust-anstyle-dev:ppc64el (1.0.8-1) ... 217s Setting up librust-winapi-i686-pc-windows-gnu-dev:ppc64el (0.4.0-1) ... 217s Setting up librust-futures-task-dev:ppc64el (0.3.30-1) ... 217s Setting up librust-rustc-hash-dev:ppc64el (1.1.0-1) ... 217s Setting up librust-wasm-bindgen-shared-dev:ppc64el (0.2.87-1) ... 217s Setting up libarchive-zip-perl (1.68-1) ... 217s Setting up librust-colorchoice-dev:ppc64el (1.0.0-1) ... 217s Setting up librust-fastrand-dev:ppc64el (2.1.1-1) ... 217s Setting up librust-socket2-dev:ppc64el (0.5.7-1) ... 217s Setting up libdebhelper-perl (13.20ubuntu1) ... 217s Setting up librust-unsafe-any-dev:ppc64el (0.4.2-2) ... 217s Setting up librust-tinyvec-macros-dev:ppc64el (0.1.0-1) ... 217s Setting up librust-num-cpus-dev:ppc64el (1.16.0-1) ... 217s Setting up librust-libm-dev:ppc64el (0.2.8-1) ... 217s Setting up librust-strsim-dev:ppc64el (0.11.1-1) ... 217s Setting up libwebpdecoder3:ppc64el (1.4.0-0.1) ... 217s Setting up m4 (1.4.19-4build1) ... 217s Setting up librust-rustc-demangle-dev:ppc64el (0.1.21-1) ... 217s Setting up python3-all (3.12.6-0ubuntu1) ... 217s Setting up librust-cpufeatures-dev:ppc64el (0.2.11-1) ... 217s Setting up librust-const-cstr-dev:ppc64el (0.3.0-1) ... 217s Setting up librust-fallible-iterator-dev:ppc64el (0.3.0-2) ... 217s Setting up librust-ryu-dev:ppc64el (1.0.15-1) ... 217s Setting up python3-sortedcontainers (2.4.0-2) ... 217s Setting up librust-humantime-dev:ppc64el (2.1.0-1) ... 217s Setting up librust-anstyle-query-dev:ppc64el (1.0.0-1) ... 217s Setting up librust-cast-dev:ppc64el (0.3.0-1) ... 217s Setting up libgomp1:ppc64el (14.2.0-7ubuntu1) ... 217s Setting up librust-subtle-dev:ppc64el (2.6.1-1) ... 217s Setting up librust-simdutf8-dev:ppc64el (0.1.4-4) ... 217s Setting up librust-atomic-waker-dev:ppc64el (1.1.2-1) ... 217s Setting up librust-miniz-oxide-dev:ppc64el (0.7.1-1) ... 217s Setting up librust-pin-project-lite-dev:ppc64el (0.2.13-1) ... 217s Setting up python3-wheel (0.44.0-1) ... 218s Setting up librust-bytes-dev:ppc64el (1.5.0-1) ... 218s Setting up librust-unicode-segmentation-dev:ppc64el (1.11.0-1) ... 218s Setting up librust-typemap-dev:ppc64el (0.3.3-2) ... 218s Setting up python3-six (1.16.0-7) ... 218s Setting up librust-compiler-builtins-dev:ppc64el (0.1.101-1) ... 218s Setting up librust-weezl-dev:ppc64el (0.1.5-1) ... 218s Setting up librust-utf8parse-dev:ppc64el (0.2.1-1) ... 218s Setting up librust-signal-hook-registry-dev:ppc64el (1.4.0-1) ... 218s Setting up librust-crossbeam-epoch-dev:ppc64el (0.9.18-1) ... 218s Setting up autotools-dev (20220109.1) ... 218s Setting up librust-tap-dev:ppc64el (1.0.1-1) ... 218s Setting up librust-errno-dev:ppc64el (0.3.8-1) ... 218s Setting up python3-packaging (24.1-1) ... 218s Setting up librust-array-init-dev:ppc64el (2.0.1-1) ... 218s Setting up libpkgconf3:ppc64el (1.8.1-4) ... 218s Setting up libpfm4:ppc64el (4.13.0+git83-g91970fe-1) ... 218s Setting up librust-oorandom-dev:ppc64el (11.1.3-1) ... 218s Setting up libexpat1-dev:ppc64el (2.6.2-2) ... 218s Setting up python3-pyproject-hooks (1.2.0-1) ... 218s Setting up librust-rustc-std-workspace-core-dev:ppc64el (1.0.0-1) ... 218s Setting up librust-funty-dev:ppc64el (2.0.0-1) ... 218s Setting up librust-futures-io-dev:ppc64el (0.3.30-2) ... 218s Setting up librust-typenum-dev:ppc64el (1.17.0-2) ... 218s Setting up uuid-dev:ppc64el (2.40.2-1ubuntu1) ... 218s Setting up librust-core-maths-dev:ppc64el (0.1.0-2) ... 218s Setting up librust-stable-deref-trait-dev:ppc64el (1.2.0-1) ... 218s Setting up librust-critical-section-dev:ppc64el (1.1.3-1) ... 218s Setting up libquadmath0:ppc64el (14.2.0-7ubuntu1) ... 218s Setting up librust-scopeguard-dev:ppc64el (1.2.0-1) ... 218s Setting up librust-iana-time-zone-dev:ppc64el (0.1.60-1) ... 218s Setting up fonts-dejavu-mono (2.37-8) ... 218s Setting up libmpc3:ppc64el (1.3.1-1build2) ... 218s Setting up librust-rand-core-dev:ppc64el (0.6.4-2) ... 218s Setting up python3-semantic-version (2.10.0-2) ... 218s Setting up librust-jobserver-dev:ppc64el (0.1.32-1) ... 218s Setting up autopoint (0.22.5-2) ... 218s Setting up libjsoncpp25:ppc64el (1.9.5-6build1) ... 218s Setting up fonts-dejavu-core (2.37-8) ... 218s Setting up librust-seahash-dev:ppc64el (4.1.0-1) ... 218s Setting up pkgconf-bin (1.8.1-4) ... 218s Setting up librust-ab-glyph-rasterizer-dev:ppc64el (0.1.7-1) ... 218s Setting up binutils-mingw-w64-i686 (2.43.1-4ubuntu1+12) ... 218s Setting up librust-time-core-dev:ppc64el (0.1.2-1) ... 218s Setting up python3-regex (0.1.20240724-1) ... 218s Setting up librust-crunchy-dev:ppc64el (0.2.2-1) ... 218s Setting up python3-toml (0.10.2-1) ... 218s Setting up librust-unicase-dev:ppc64el (2.7.0-1) ... 218s Setting up librust-unicode-width-dev:ppc64el (0.1.13-3) ... 218s Setting up python3-installer (0.7.0+dfsg1-3) ... 219s Setting up autoconf (2.72-3) ... 219s Setting up python3-pluggy (1.5.0-1) ... 219s Setting up libwebp7:ppc64el (1.4.0-0.1) ... 219s Setting up libubsan1:ppc64el (14.2.0-7ubuntu1) ... 219s Setting up zlib1g-dev:ppc64el (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 219s Setting up librust-unicode-ident-dev:ppc64el (1.0.13-1) ... 219s Setting up librust-equivalent-dev:ppc64el (1.0.1-1) ... 219s Setting up dwz (0.15-1build6) ... 219s Setting up librust-bitflags-1-dev:ppc64el (1.3.2-5) ... 219s Setting up librust-uncased-dev:ppc64el (0.9.6-2) ... 219s Setting up librust-slog-dev:ppc64el (2.7.0-1) ... 219s Setting up python3-tiktoken (0.8.0-1) ... 219s Setting up librust-pure-rust-locales-dev:ppc64el (0.8.1-1) ... 219s Setting up librhash0:ppc64el (1.4.3-3build1) ... 219s Setting up libasan8:ppc64el (14.2.0-7ubuntu1) ... 219s Setting up librust-wait-timeout-dev:ppc64el (0.2.0-1) ... 219s Setting up librust-ttf-parser-dev:ppc64el (0.24.1-1) ... 219s Setting up librust-cfg-if-dev:ppc64el (1.0.0-1) ... 219s Setting up debugedit (1:5.1-1) ... 219s Setting up librust-color-quant-dev:ppc64el (1.1.0-1) ... 219s Setting up python3-dateutil (2.9.0-2) ... 219s Setting up librust-blobby-dev:ppc64el (0.3.1-1) ... 219s Setting up cmake-data (3.30.3-1) ... 219s Setting up llvm-19-linker-tools (1:19.1.2-1ubuntu1) ... 219s Setting up librust-byteorder-dev:ppc64el (1.5.0-1) ... 219s Setting up libtsan2:ppc64el (14.2.0-7ubuntu1) ... 219s Setting up librust-static-assertions-dev:ppc64el (1.1.0-1) ... 219s Setting up librust-compiler-builtins+core-dev:ppc64el (0.1.101-1) ... 219s Setting up librust-float-ord-dev:ppc64el (0.3.2-1) ... 219s Setting up librust-autocfg-dev:ppc64el (1.1.0-1) ... 219s Setting up libisl23:ppc64el (0.27-1) ... 219s Setting up librust-time-macros-dev:ppc64el (0.2.16-1) ... 219s Setting up llvm-19-runtime (1:19.1.2-1ubuntu1) ... 219s Setting up librust-futures-sink-dev:ppc64el (0.3.31-1) ... 219s Setting up python3-build (1.2.2-1) ... 219s Setting up libsharpyuv-dev:ppc64el (1.4.0-0.1) ... 219s Setting up librust-cfg-if-0.1-dev:ppc64el (0.1.10-2) ... 219s Setting up librust-tinyvec-dev:ppc64el (1.6.0-2) ... 219s Setting up libwebpmux3:ppc64el (1.4.0-0.1) ... 219s Setting up librust-plotters-backend-dev:ppc64el (0.3.5-1) ... 219s Setting up librust-shlex-dev:ppc64el (1.3.0-1) ... 219s Setting up librust-indenter-dev:ppc64el (0.3.3-1) ... 219s Setting up librust-cpp-demangle-dev:ppc64el (0.4.0-1) ... 219s Setting up librust-winapi-x86-64-pc-windows-gnu-dev:ppc64el (0.4.0-1) ... 219s Setting up libcc1-0:ppc64el (14.2.0-7ubuntu1) ... 219s Setting up libbrotli-dev:ppc64el (1.1.0-2build2) ... 219s Setting up liblsan0:ppc64el (14.2.0-7ubuntu1) ... 219s Setting up libitm1:ppc64el (14.2.0-7ubuntu1) ... 219s Setting up librust-clap-lex-dev:ppc64el (0.7.2-2) ... 219s Setting up libhttp-parser2.9:ppc64el (2.9.4-6build1) ... 219s Setting up librust-unarray-dev:ppc64el (0.1.4-1) ... 219s Setting up libstd-rust-1.80:ppc64el (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 219s Setting up librust-itertools-dev:ppc64el (0.10.5-1) ... 219s Setting up librust-heck-dev:ppc64el (0.4.1-1) ... 219s Setting up libbz2-dev:ppc64el (1.0.8-6) ... 219s Setting up automake (1:1.16.5-1.3ubuntu1) ... 219s update-alternatives: using /usr/bin/automake-1.16 to provide /usr/bin/automake (automake) in auto mode 219s Setting up libfile-stripnondeterminism-perl (1.14.0-1) ... 219s Setting up librust-owned-ttf-parser-dev:ppc64el (0.24.0-1) ... 219s Setting up librust-num-threads-dev:ppc64el (0.1.7-1) ... 219s Setting up librust-crossbeam-epoch+std-dev:ppc64el (0.9.18-1) ... 219s Setting up gettext (0.22.5-2) ... 219s Setting up librust-gif-dev:ppc64el (0.11.3-1) ... 219s Setting up librust-crossbeam-deque-dev:ppc64el (0.8.5-1) ... 219s Setting up librust-tiny-keccak-dev:ppc64el (2.0.2-1) ... 219s Setting up librust-linux-raw-sys-dev:ppc64el (0.4.14-1) ... 219s Setting up pybuild-plugin-pyproject (6.20241024) ... 219s Setting up fontconfig-config (2.15.0-1.1ubuntu2) ... 219s Setting up librust-getrandom-dev:ppc64el (0.2.12-1) ... 219s Setting up python3-pytest (8.3.2-1) ... 220s Setting up librust-libloading-dev:ppc64el (0.8.5-1) ... 220s Setting up librust-memmap2-dev:ppc64el (0.9.3-1) ... 220s Setting up libwebpdemux2:ppc64el (1.4.0-0.1) ... 220s Setting up python3-hypothesis (6.105.1-1) ... 220s Setting up librust-ab-glyph-rasterizer+libm-dev:ppc64el (0.1.7-1) ... 220s Setting up libpng-dev:ppc64el (1.6.44-1) ... 220s Setting up librust-tinyvec+tinyvec-macros-dev:ppc64el (1.6.0-2) ... 220s Setting up librust-owning-ref-dev:ppc64el (0.4.1-1) ... 220s Setting up librust-memoffset-dev:ppc64el (0.8.0-1) ... 220s Setting up libpython3.12-dev:ppc64el (3.12.7-2) ... 220s Setting up librust-proc-macro2-dev:ppc64el (1.0.86-1) ... 220s Setting up librust-compiler-builtins+rustc-dep-of-std-dev:ppc64el (0.1.101-1) ... 220s Setting up librust-rayon-core-dev:ppc64el (1.12.1-1) ... 220s Setting up librust-winapi-dev:ppc64el (0.3.9-1) ... 220s Setting up pkgconf:ppc64el (1.8.1-4) ... 220s Setting up librust-ab-glyph-dev:ppc64el (0.2.28-1) ... 220s Setting up libstd-rust-1.80-dev:ppc64el (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 220s Setting up libfreetype-dev:ppc64el (2.13.3+dfsg-1) ... 220s Setting up intltool-debian (0.35.0+20060710.6) ... 220s Setting up librust-rand-core+getrandom-dev:ppc64el (0.6.4-2) ... 220s Setting up librust-rand-xorshift-dev:ppc64el (0.3.0-2) ... 220s Setting up libwebp-dev:ppc64el (1.4.0-0.1) ... 220s Setting up librust-anes-dev:ppc64el (0.1.6-1) ... 220s Setting up llvm-runtime:ppc64el (1:19.0-60~exp1) ... 220s Setting up librust-cc-dev:ppc64el (1.1.14-1) ... 220s Setting up python3.12-dev (3.12.7-2) ... 220s Setting up pkg-config:ppc64el (1.8.1-4) ... 220s Setting up cpp-14-powerpc64le-linux-gnu (14.2.0-7ubuntu1) ... 220s Setting up cpp-14 (14.2.0-7ubuntu1) ... 220s Setting up dh-strip-nondeterminism (1.14.0-1) ... 220s Setting up librust-crc32fast-dev:ppc64el (1.4.2-1) ... 220s Setting up librust-num-traits-dev:ppc64el (0.2.19-2) ... 220s Setting up librust-winapi-util-dev:ppc64el (0.1.6-1) ... 220s Setting up cmake (3.30.3-1) ... 220s Setting up libgit2-1.7:ppc64el (1.7.2+ds-1ubuntu3) ... 220s Setting up llvm-19 (1:19.1.2-1ubuntu1) ... 220s Setting up libfontconfig1:ppc64el (2.15.0-1.1ubuntu2) ... 220s Setting up librust-sha1-asm-dev:ppc64el (0.5.1-2) ... 220s Setting up libgcc-14-dev:ppc64el (14.2.0-7ubuntu1) ... 220s Setting up librust-same-file-dev:ppc64el (1.0.6-1) ... 220s Setting up librust-rayon-dev:ppc64el (1.10.0-1) ... 220s Setting up librust-termcolor-dev:ppc64el (1.4.1-1) ... 220s Setting up librust-pkg-config-dev:ppc64el (0.3.27-1) ... 220s Setting up libstdc++-14-dev:ppc64el (14.2.0-7ubuntu1) ... 220s Setting up cpp-powerpc64le-linux-gnu (4:14.1.0-2ubuntu1) ... 220s Setting up gcc-14-powerpc64le-linux-gnu (14.2.0-7ubuntu1) ... 220s Setting up librust-jpeg-decoder-dev:ppc64el (0.3.0-1) ... 220s Setting up librust-dirs-sys-next-dev:ppc64el (0.1.1-1) ... 220s Setting up librust-cmake-dev:ppc64el (0.1.45-1) ... 220s Setting up librust-num-integer-dev:ppc64el (0.1.46-1) ... 220s Setting up librust-dirs-next-dev:ppc64el (2.0.0-1) ... 220s Setting up libpython3-dev:ppc64el (3.12.6-0ubuntu1) ... 220s Setting up librust-dlib-dev:ppc64el (0.5.2-2) ... 220s Setting up g++-14-powerpc64le-linux-gnu (14.2.0-7ubuntu1) ... 220s Setting up libfontconfig-dev:ppc64el (2.15.0-1.1ubuntu2) ... 220s Setting up librust-sha2-asm-dev:ppc64el (0.6.2-2) ... 220s Setting up librust-libwebp-sys-dev:ppc64el (0.9.5-1build1) ... 220s Setting up po-debconf (1.0.21+nmu1) ... 220s Setting up librust-quote-dev:ppc64el (1.0.37-1) ... 220s Setting up librust-freetype-sys-dev:ppc64el (0.13.1-1) ... 220s Setting up librust-libz-sys-dev:ppc64el (1.1.20-1) ... 220s Setting up librust-syn-dev:ppc64el (2.0.77-1) ... 220s Setting up librust-rand-core+std-dev:ppc64el (0.6.4-2) ... 220s Setting up librust-powerfmt-macros-dev:ppc64el (0.1.0-1) ... 220s Setting up gcc-14 (14.2.0-7ubuntu1) ... 220s Setting up librust-powerfmt-dev:ppc64el (0.2.0-1) ... 220s Setting up gcc-powerpc64le-linux-gnu (4:14.1.0-2ubuntu1) ... 220s Setting up librust-sval-derive-dev:ppc64el (2.6.1-2) ... 220s Setting up libpython3-all-dev:ppc64el (3.12.6-0ubuntu1) ... 220s Setting up librust-md5-asm-dev:ppc64el (0.5.0-2) ... 220s Setting up librust-freetype-dev:ppc64el (0.7.0-4) ... 220s Setting up librust-zeroize-derive-dev:ppc64el (1.4.2-1) ... 220s Setting up llvm (1:19.0-60~exp1) ... 220s Setting up librust-postgres-derive-dev:ppc64el (0.4.5-1) ... 220s Setting up librust-syn-1-dev:ppc64el (1.0.109-2) ... 220s Setting up librust-clap-derive-dev:ppc64el (4.5.13-2) ... 220s Setting up librust-bytecheck-derive-dev:ppc64el (0.6.12-1) ... 220s Setting up librust-no-panic-dev:ppc64el (0.1.13-1) ... 220s Setting up cpp (4:14.1.0-2ubuntu1) ... 220s Setting up librust-serde-derive-dev:ppc64el (1.0.210-1) ... 220s Setting up librust-walkdir-dev:ppc64el (2.5.0-1) ... 220s Setting up librust-zerocopy-derive-dev:ppc64el (0.7.32-2) ... 220s Setting up g++-14 (14.2.0-7ubuntu1) ... 220s Setting up librust-valuable-derive-dev:ppc64el (0.1.0-1) ... 220s Setting up librust-ghost-dev:ppc64el (0.1.5-1) ... 220s Setting up librust-serde-dev:ppc64el (1.0.210-2) ... 220s Setting up librust-bytemuck-derive-dev:ppc64el (1.5.0-2) ... 220s Setting up librust-derive-arbitrary-dev:ppc64el (1.3.2-1) ... 220s Setting up librust-allocator-api2-dev:ppc64el (0.2.16-1) ... 220s Setting up g++-powerpc64le-linux-gnu (4:14.1.0-2ubuntu1) ... 220s Setting up librust-async-attributes-dev (1.1.2-6) ... 220s Setting up librust-rand-chacha-dev:ppc64el (0.3.1-2) ... 220s Setting up librust-futures-macro-dev:ppc64el (0.3.30-1) ... 220s Setting up librust-ctor-dev:ppc64el (0.1.26-1) ... 220s Setting up librust-unicode-bidi-dev:ppc64el (0.3.13-1) ... 220s Setting up librust-tracing-attributes-dev:ppc64el (0.1.27-1) ... 220s Setting up librust-ptr-meta-derive-dev:ppc64el (0.1.4-1) ... 220s Setting up librust-serde-fmt-dev (1.0.3-3) ... 220s Setting up libtool (2.4.7-7build1) ... 220s Setting up librust-portable-atomic-dev:ppc64el (1.4.3-2) ... 220s Setting up librust-tokio-macros-dev:ppc64el (2.4.0-2) ... 220s Setting up librust-flate2-dev:ppc64el (1.0.27-2) ... 220s Setting up librust-lock-api-dev:ppc64el (0.4.12-1) ... 220s Setting up librust-ptr-meta-dev:ppc64el (0.1.4-1) ... 220s Setting up librust-inventory-dev:ppc64el (0.3.2-1) ... 220s Setting up librust-sval-dev:ppc64el (2.6.1-2) ... 220s Setting up librust-itoa-dev:ppc64el (1.0.9-1) ... 220s Setting up gcc (4:14.1.0-2ubuntu1) ... 220s Setting up librust-bumpalo-dev:ppc64el (3.16.0-1) ... 220s Setting up librust-python3-dll-a-dev:ppc64el (0.2.10-1) ... 220s Setting up librust-siphasher-dev:ppc64el (0.3.10-1) ... 220s Setting up rustc-1.80 (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 220s Setting up dh-autoreconf (20) ... 220s Setting up librust-rand-core+serde-dev:ppc64el (0.6.4-2) ... 220s Setting up librust-sval-ref-dev:ppc64el (2.6.1-1) ... 220s Setting up librust-rkyv-derive-dev:ppc64el (0.7.44-1) ... 220s Setting up librust-zerocopy-dev:ppc64el (0.7.32-1) ... 220s Setting up librust-semver-dev:ppc64el (1.0.23-1) ... 220s Setting up librust-bytemuck-dev:ppc64el (1.14.0-1) ... 220s Setting up librust-bit-vec-dev:ppc64el (0.6.3-1) ... 220s Setting up librust-zeroize-dev:ppc64el (1.8.1-1) ... 220s Setting up librust-slab-dev:ppc64el (0.4.9-1) ... 220s Setting up g++ (4:14.1.0-2ubuntu1) ... 220s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 220s Setting up rustc (1.80.1ubuntu2) ... 220s Setting up librust-arbitrary-dev:ppc64el (1.3.2-1) ... 220s Setting up librust-valuable-dev:ppc64el (0.1.0-4) ... 220s Setting up librust-target-lexicon-dev:ppc64el (0.12.14-1) ... 220s Setting up librust-serde-test-dev:ppc64el (1.0.171-1) ... 220s Setting up librust-bit-set-dev:ppc64el (0.5.2-1) ... 220s Setting up build-essential (12.10ubuntu1) ... 220s Setting up librust-concurrent-queue-dev:ppc64el (2.5.0-4) ... 220s Setting up cargo-1.80 (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 220s Setting up librust-erased-serde-dev:ppc64el (0.3.31-1) ... 220s Setting up librust-radium-dev:ppc64el (1.1.0-1) ... 220s Setting up librust-bit-set+std-dev:ppc64el (0.5.2-1) ... 220s Setting up librust-phf-shared-dev:ppc64el (0.11.2-1) ... 220s Setting up librust-tiff-dev:ppc64el (0.9.0-1) ... 220s Setting up librust-smol-str-dev:ppc64el (0.2.0-1) ... 220s Setting up librust-atomic-dev:ppc64el (0.6.0-1) ... 220s Setting up librust-generic-array-dev:ppc64el (0.14.7-1) ... 220s Setting up librust-half-dev:ppc64el (1.8.2-4) ... 220s Setting up librust-phf-dev:ppc64el (0.11.2-1) ... 220s Setting up librust-spin-dev:ppc64el (0.9.8-4) ... 220s Setting up librust-sval-dynamic-dev:ppc64el (2.6.1-1) ... 220s Setting up librust-qoi-dev:ppc64el (0.4.1-2) ... 220s Setting up librust-async-task-dev (4.7.1-3) ... 220s Setting up librust-crypto-common-dev:ppc64el (0.1.6-1) ... 220s Setting up librust-ciborium-ll-dev:ppc64el (0.2.2-1) ... 220s Setting up librust-futures-core-dev:ppc64el (0.3.30-1) ... 220s Setting up librust-lazy-static-dev:ppc64el (1.4.0-2) ... 220s Setting up librust-sval-buffer-dev:ppc64el (2.6.1-1) ... 220s Setting up librust-arrayvec-dev:ppc64el (0.7.4-2) ... 220s Setting up librust-png-dev:ppc64el (0.17.7-3) ... 220s Setting up librust-rustc-version-dev:ppc64el (0.4.0-1) ... 220s Setting up librust-event-listener-dev (5.3.1-8) ... 220s Setting up debhelper (13.20ubuntu1) ... 220s Setting up librust-smallvec-dev:ppc64el (1.13.2-1) ... 220s Setting up librust-sval-fmt-dev:ppc64el (2.6.1-1) ... 220s Setting up librust-const-oid-dev:ppc64el (0.9.3-1) ... 220s Setting up librust-anstyle-parse-dev:ppc64el (0.2.1-1) ... 220s Setting up cargo (1.80.1ubuntu2) ... 220s Setting up librust-ciborium-dev:ppc64el (0.2.2-2) ... 220s Setting up librust-block-buffer-dev:ppc64el (0.10.2-2) ... 220s Setting up python3-setuptools-rust (1.9.0+dfsg-2) ... 220s Setting up librust-pathfinder-simd-dev:ppc64el (0.5.2-1) ... 220s Setting up librust-unicode-normalization-dev:ppc64el (0.1.22-1) ... 220s Setting up librust-anstream-dev:ppc64el (0.6.15-1) ... 220s Setting up librust-bitflags-dev:ppc64el (2.6.0-1) ... 220s Setting up librust-regex-syntax-dev:ppc64el (0.8.2-1) ... 220s Setting up librust-parking-lot-core-dev:ppc64el (0.9.10-1) ... 220s Setting up librust-futures-channel-dev:ppc64el (0.3.30-1) ... 220s Setting up librust-once-cell-dev:ppc64el (1.19.0-1) ... 220s Setting up librust-pyo3-build-config-dev:ppc64el (0.22.5-1) ... 220s Setting up librust-phf-shared+uncased-dev:ppc64el (0.11.2-1) ... 220s Setting up librust-digest-dev:ppc64el (0.10.7-2) ... 220s Setting up librust-md-5-dev:ppc64el (0.10.6-1) ... 220s Setting up librust-sval-serde-dev:ppc64el (2.6.1-1) ... 220s Setting up librust-parking-lot-dev:ppc64el (0.12.1-2build1) ... 220s Setting up librust-event-listener-strategy-dev:ppc64el (0.5.2-3) ... 220s Setting up librust-pyo3-macros-backend-dev:ppc64el (0.22.5-1) ... 220s Setting up librust-pyo3-ffi-dev:ppc64el (0.22.5-1) ... 220s Setting up pybuild-plugin-autopkgtest (6.20241024) ... 220s Setting up librust-const-random-macro-dev:ppc64el (0.1.16-2) ... 220s Setting up librust-const-random-dev:ppc64el (0.1.17-2) ... 220s Setting up librust-pyo3-macros-dev:ppc64el (0.22.5-1) ... 220s Setting up librust-sha1-dev:ppc64el (0.10.6-1) ... 220s Setting up librust-ahash-dev (0.8.11-8) ... 220s Setting up librust-async-channel-dev (2.3.1-8) ... 220s Setting up librust-stringprep-dev:ppc64el (0.1.2-1) ... 220s Setting up librust-tracing-core-dev:ppc64el (0.1.32-1) ... 220s Setting up librust-async-lock-dev (3.4.0-4) ... 220s Setting up librust-eyre-dev:ppc64el (0.6.12-1) ... 220s Setting up librust-yeslogic-fontconfig-sys-dev:ppc64el (3.0.1-1) ... 220s Setting up librust-sha2-dev:ppc64el (0.10.8-1) ... 220s Setting up librust-hmac-dev:ppc64el (0.12.1-1) ... 220s Setting up librust-rustix-dev:ppc64el (0.38.32-1) ... 220s Setting up librust-wyz-dev:ppc64el (0.5.1-1) ... 220s Setting up librust-bitvec-dev:ppc64el (1.0.1-1) ... 220s Setting up librust-phf+uncased-dev:ppc64el (0.11.2-1) ... 220s Setting up librust-value-bag-sval2-dev:ppc64el (1.9.0-1) ... 220s Setting up librust-tempfile-dev:ppc64el (3.10.1-1) ... 220s Setting up librust-eyre+default-dev:ppc64el (0.6.12-1) ... 220s Setting up librust-rusty-fork-dev:ppc64el (0.3.0-1) ... 220s Setting up librust-hashbrown-dev:ppc64el (0.14.5-5) ... 220s Setting up librust-rusty-fork+wait-timeout-dev:ppc64el (0.3.0-1) ... 220s Setting up librust-terminal-size-dev:ppc64el (0.3.0-2) ... 221s Setting up librust-indexmap-dev:ppc64el (2.2.6-1) ... 221s Setting up librust-gimli-dev:ppc64el (0.28.1-2) ... 221s Setting up librust-webp-dev:ppc64el (0.2.6-1) ... 221s Setting up librust-memchr-dev:ppc64el (2.7.1-1) ... 221s Setting up librust-futures-util-dev:ppc64el (0.3.30-2) ... 221s Setting up librust-csv-core-dev:ppc64el (0.1.11-1) ... 221s Setting up librust-futures-lite-dev:ppc64el (2.3.0-2) ... 221s Setting up librust-csv-dev:ppc64el (1.3.0-1) ... 221s Setting up librust-serde-json-dev:ppc64el (1.0.128-1) ... 221s Setting up librust-async-executor-dev (1.13.1-1) ... 221s Setting up librust-futures-executor-dev:ppc64el (0.3.30-1) ... 221s Setting up librust-value-bag-serde1-dev:ppc64el (1.9.0-1) ... 221s Setting up librust-tinytemplate-dev:ppc64el (1.2.1-1) ... 221s Setting up librust-futures-dev:ppc64el (0.3.30-2) ... 221s Setting up librust-value-bag-dev:ppc64el (1.9.0-1) ... 221s Setting up librust-log-dev:ppc64el (0.4.22-1) ... 221s Setting up librust-kv-log-macro-dev (1.0.8-4) ... 221s Setting up librust-pathfinder-geometry-dev:ppc64el (0.5.1-1) ... 221s Setting up librust-tracing-dev:ppc64el (0.1.40-1) ... 221s Setting up librust-polling-dev:ppc64el (3.4.0-1) ... 221s Setting up librust-aho-corasick-dev:ppc64el (1.1.3-1) ... 221s Setting up librust-font-kit-dev:ppc64el (0.11.0-2) ... 221s Setting up librust-async-io-dev:ppc64el (2.3.3-4) ... 221s Setting up librust-blocking-dev (1.6.1-5) ... 221s Setting up librust-async-net-dev (2.0.0-4) ... 221s Setting up librust-rand-dev:ppc64el (0.8.5-1) ... 221s Setting up librust-mio-dev:ppc64el (1.0.2-2) ... 221s Setting up librust-wasm-bindgen-backend-dev:ppc64el (0.2.87-1) ... 221s Setting up librust-twox-hash-dev:ppc64el (1.6.3-1) ... 221s Setting up librust-proptest-dev:ppc64el (1.5.0-2) ... 221s Setting up librust-wasm-bindgen-macro-support-dev:ppc64el (0.2.87-1) ... 221s Setting up librust-regex-automata-dev:ppc64el (0.4.7-1) ... 221s Setting up librust-wasm-bindgen-macro-support+spans-dev:ppc64el (0.2.87-1) ... 221s Setting up librust-wasm-bindgen-macro-dev:ppc64el (0.2.87-1) ... 221s Setting up librust-uuid-dev:ppc64el (1.10.0-1) ... 221s Setting up librust-bstr-dev:ppc64el (1.7.0-2build1) ... 221s Setting up librust-async-signal-dev:ppc64el (0.2.10-1) ... 221s Setting up librust-bytecheck-dev:ppc64el (0.6.12-1) ... 221s Setting up librust-postgres-protocol-dev:ppc64el (0.6.6-2) ... 221s Setting up librust-async-fs-dev (2.1.2-4) ... 221s Setting up librust-wasm-bindgen-dev:ppc64el (0.2.87-1) ... 221s Setting up librust-convert-case-dev:ppc64el (0.6.0-2) ... 221s Setting up librust-regex-dev:ppc64el (1.10.6-1) ... 221s Setting up librust-fancy-regex-dev:ppc64el (0.11.0-2) ... 221s Setting up librust-async-process-dev (2.3.0-1) ... 221s Setting up librust-wasm-bindgen-macro+spans-dev:ppc64el (0.2.87-1) ... 221s Setting up librust-rend-dev:ppc64el (0.4.0-1) ... 221s Setting up librust-derive-more-0.99-dev:ppc64el (0.99.18-1) ... 221s Setting up librust-env-logger-dev:ppc64el (0.10.2-2) ... 221s Setting up librust-wasm-bindgen+spans-dev:ppc64el (0.2.87-1) ... 221s Setting up librust-wasm-bindgen+default-dev:ppc64el (0.2.87-1) ... 221s Setting up librust-rkyv-dev:ppc64el (0.7.44-1) ... 221s Setting up librust-eui48-dev:ppc64el (1.1.0-2) ... 221s Setting up librust-parse-zoneinfo-dev:ppc64el (0.3.0-1) ... 221s Setting up librust-smol-dev (2.0.2-1) ... 221s Setting up librust-js-sys-dev:ppc64el (0.3.64-1) ... 221s Setting up librust-num-complex-dev:ppc64el (0.4.6-2) ... 221s Setting up librust-approx-dev:ppc64el (0.5.1-1) ... 221s Setting up librust-ruzstd-dev:ppc64el (0.5.0-1) ... 221s Setting up librust-web-sys-dev:ppc64el (0.3.64-2) ... 221s Setting up librust-quickcheck-dev:ppc64el (1.0.3-3) ... 221s Setting up librust-geo-types-dev:ppc64el (0.7.11-2) ... 221s Setting up librust-deranged-dev:ppc64el (0.3.11-1) ... 221s Setting up librust-num-bigint-dev:ppc64el (0.4.6-1) ... 221s Setting up librust-num-rational-dev:ppc64el (0.4.2-1) ... 221s Setting up librust-chrono-dev:ppc64el (0.4.38-2) ... 221s Setting up librust-object-dev:ppc64el (0.32.2-1) ... 221s Setting up librust-image-dev:ppc64el (0.24.7-2) ... 221s Setting up librust-time-dev:ppc64el (0.3.31-2) ... 221s Setting up librust-plotters-bitmap-dev:ppc64el (0.3.3-3) ... 221s Setting up librust-postgres-types-dev:ppc64el (0.2.6-2) ... 221s Setting up librust-addr2line-dev:ppc64el (0.21.0-2) ... 221s Setting up librust-plotters-svg-dev:ppc64el (0.3.5-1) ... 221s Setting up librust-rust-decimal-dev:ppc64el (1.36.0-1) ... 221s Setting up librust-plotters-dev:ppc64el (0.3.5-4) ... 221s Setting up librust-backtrace-dev:ppc64el (0.3.69-2) ... 221s Setting up librust-tokio-dev:ppc64el (1.39.3-3) ... 221s Setting up librust-async-global-executor-dev:ppc64el (2.4.1-5) ... 221s Setting up librust-clap-builder-dev:ppc64el (4.5.15-2) ... 221s Setting up librust-clap-dev:ppc64el (4.5.16-1) ... 221s Setting up librust-async-std-dev (1.12.0-22) ... 221s Setting up librust-anyhow-dev:ppc64el (1.0.86-1) ... 221s Setting up librust-criterion-dev (0.5.1-6) ... 221s Setting up librust-phf-generator-dev:ppc64el (0.11.2-2) ... 221s Setting up librust-phf-codegen-dev:ppc64el (0.11.2-1) ... 221s Setting up librust-chrono-tz-build-dev:ppc64el (0.2.1-1) ... 221s Setting up librust-chrono-tz-dev:ppc64el (0.8.6-2) ... 221s Setting up librust-pyo3-dev:ppc64el (0.22.5-1) ... 221s Setting up autopkgtest-satdep (0) ... 221s Processing triggers for libc-bin (2.40-1ubuntu3) ... 221s Processing triggers for systemd (256.5-2ubuntu4) ... 221s Processing triggers for man-db (2.12.1-3) ... 223s Processing triggers for install-info (7.1.1-1) ... 238s (Reading database ... 99363 files and directories currently installed.) 238s Removing autopkgtest-satdep (0) ... 239s autopkgtest [18:28:44]: test pybuild-autopkgtest: pybuild-autopkgtest 239s autopkgtest [18:28:44]: test pybuild-autopkgtest: [----------------------- 239s pybuild-autopkgtest 240s I: pybuild base:311: cd /tmp/autopkgtest.ycJWu9/autopkgtest_tmp/build; python3.12 -m pytest tests 240s ============================= test session starts ============================== 240s platform linux -- Python 3.12.7+, pytest-8.3.2, pluggy-1.5.0 240s rootdir: /tmp/autopkgtest.ycJWu9/autopkgtest_tmp/build 240s configfile: pyproject.toml 240s plugins: hypothesis-6.105.1, typeguard-4.4.1 240s collected 30 items 240s 844s tests/test_encoding.py FFFFFFFFFFFFFFFFFFFFFF [ 73%] 845s tests/test_misc.py F. [ 80%] 848s tests/test_offsets.py FF [ 86%] 849s tests/test_pickle.py F [ 90%] 851s tests/test_simple_public.py FF. [100%] 851s 851s =================================== FAILURES =================================== 851s _________________________________ test_simple __________________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/gpt-2/encodings/main/vocab.bpe', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_simple(): 851s > enc = tiktoken.get_encoding("gpt2") 851s 851s tests/test_encoding.py:15: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:18: in gpt2 851s mergeable_ranks = data_gym_to_mergeable_bpe_ranks( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:103: in data_gym_to_mergeable_bpe_ranks 851s vocab_bpe_contents = read_file_cached(vocab_bpe_file, vocab_bpe_hash).decode() 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s _____________________________ test_simple_repeated _____________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/gpt-2/encodings/main/vocab.bpe', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_simple_repeated(): 851s > enc = tiktoken.get_encoding("gpt2") 851s 851s tests/test_encoding.py:32: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:18: in gpt2 851s mergeable_ranks = data_gym_to_mergeable_bpe_ranks( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:103: in data_gym_to_mergeable_bpe_ranks 851s vocab_bpe_contents = read_file_cached(vocab_bpe_file, vocab_bpe_hash).decode() 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ______________________________ test_simple_regex _______________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_simple_regex(): 851s > enc = tiktoken.get_encoding("cl100k_base") 851s 851s tests/test_encoding.py:53: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ______________________________ test_basic_encode _______________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_basic_encode(): 851s > enc = tiktoken.get_encoding("r50k_base") 851s 851s tests/test_encoding.py:62: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ______________________________ test_encode_empty _______________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_encode_empty(): 851s > enc = tiktoken.get_encoding("r50k_base") 851s 851s tests/test_encoding.py:74: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ______________________________ test_encode_bytes _______________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_encode_bytes(): 851s > enc = tiktoken.get_encoding("cl100k_base") 851s 851s tests/test_encoding.py:79: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s _________________________ test_encode_surrogate_pairs __________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_encode_surrogate_pairs(): 851s > enc = tiktoken.get_encoding("cl100k_base") 851s 851s tests/test_encoding.py:84: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s _________________ test_catastrophically_repetitive[r50k_base] __________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'r50k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s def test_catastrophically_repetitive(make_enc: Callable[[], tiktoken.Encoding]): 851s > enc = make_enc() 851s 851s tests/test_encoding.py:96: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ________________ test_catastrophically_repetitive[cl100k_base] _________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'cl100k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s def test_catastrophically_repetitive(make_enc: Callable[[], tiktoken.Encoding]): 851s > enc = make_enc() 851s 851s tests/test_encoding.py:96: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s _______________________ test_basic_roundtrip[r50k_base] ________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'r50k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s def test_basic_roundtrip(make_enc): 851s > enc = make_enc() 851s 851s tests/test_encoding.py:115: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ______________________ test_basic_roundtrip[cl100k_base] _______________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'cl100k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s def test_basic_roundtrip(make_enc): 851s > enc = make_enc() 851s 851s tests/test_encoding.py:115: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ________________________ test_hyp_roundtrip[r50k_base] _________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'r50k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s > @hypothesis.given(text=st.text()) 851s 851s tests/test_encoding.py:131: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s tests/test_encoding.py:134: in test_hyp_roundtrip 851s enc = make_enc() 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s E Falsifying example: test_hyp_roundtrip( 851s E make_enc=functools.partial(get_encoding, 'r50k_base'), 851s E text='', # or any other generated value 851s E ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s _______________________ test_hyp_roundtrip[cl100k_base] ________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'cl100k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s > @hypothesis.given(text=st.text()) 851s 851s tests/test_encoding.py:131: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s tests/test_encoding.py:134: in test_hyp_roundtrip 851s enc = make_enc() 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s E Falsifying example: test_hyp_roundtrip( 851s E make_enc=functools.partial(get_encoding, 'cl100k_base'), 851s E text='', # or any other generated value 851s E ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ____________________ test_single_token_roundtrip[r50k_base] ____________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'r50k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s def test_single_token_roundtrip(make_enc: Callable[[], tiktoken.Encoding]): 851s > enc = make_enc() 851s 851s tests/test_encoding.py:141: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ___________________ test_single_token_roundtrip[cl100k_base] ___________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'cl100k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s def test_single_token_roundtrip(make_enc: Callable[[], tiktoken.Encoding]): 851s > enc = make_enc() 851s 851s tests/test_encoding.py:141: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ______________________________ test_special_token ______________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_special_token(): 851s > enc = tiktoken.get_encoding("cl100k_base") 851s 851s tests/test_encoding.py:157: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s _____________________ test_hyp_special_ordinary[r50k_base] _____________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'r50k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s > @hypothesis.given(text=st.text()) 851s 851s tests/test_encoding.py:208: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s tests/test_encoding.py:211: in test_hyp_special_ordinary 851s enc = make_enc() 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s E Falsifying example: test_hyp_special_ordinary( 851s E make_enc=functools.partial(get_encoding, 'r50k_base'), 851s E text='', # or any other generated value 851s E ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ____________________ test_hyp_special_ordinary[cl100k_base] ____________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'cl100k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s > @hypothesis.given(text=st.text()) 851s 851s tests/test_encoding.py:208: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s tests/test_encoding.py:211: in test_hyp_special_ordinary 851s enc = make_enc() 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s E Falsifying example: test_hyp_special_ordinary( 851s E make_enc=functools.partial(get_encoding, 'cl100k_base'), 851s E text='', # or any other generated value 851s E ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s _________________________ test_batch_encode[r50k_base] _________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'r50k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s def test_batch_encode(make_enc: Callable[[], tiktoken.Encoding]): 851s > enc = make_enc() 851s 851s tests/test_encoding.py:222: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ________________________ test_batch_encode[cl100k_base] ________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'cl100k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s def test_batch_encode(make_enc: Callable[[], tiktoken.Encoding]): 851s > enc = make_enc() 851s 851s tests/test_encoding.py:222: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s _____________________ test_hyp_batch_roundtrip[r50k_base] ______________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'r50k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s > @hypothesis.given(batch=st.lists(st.text())) 851s 851s tests/test_encoding.py:237: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s tests/test_encoding.py:240: in test_hyp_batch_roundtrip 851s enc = make_enc() 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s E Falsifying example: test_hyp_batch_roundtrip( 851s E make_enc=functools.partial(get_encoding, 'r50k_base'), 851s E batch=[], # or any other generated value 851s E ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ____________________ test_hyp_batch_roundtrip[cl100k_base] _____________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'cl100k_base') 851s 851s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 851s > @hypothesis.given(batch=st.lists(st.text())) 851s 851s tests/test_encoding.py:237: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s tests/test_encoding.py:240: in test_hyp_batch_roundtrip 851s enc = make_enc() 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s E Falsifying example: test_hyp_batch_roundtrip( 851s E make_enc=functools.partial(get_encoding, 'cl100k_base'), 851s E batch=[], # or any other generated value 851s E ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ___________________________ test_encoding_for_model ____________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/gpt-2/encodings/main/vocab.bpe', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_encoding_for_model(): 851s > enc = tiktoken.encoding_for_model("gpt2") 851s 851s tests/test_misc.py:8: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/model.py:105: in encoding_for_model 851s return get_encoding(encoding_name_for_model(model_name)) 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:18: in gpt2 851s mergeable_ranks = data_gym_to_mergeable_bpe_ranks( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:103: in data_gym_to_mergeable_bpe_ranks 851s vocab_bpe_contents = read_file_cached(vocab_bpe_file, vocab_bpe_hash).decode() 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ________________________ test_hyp_offsets[cl100k_base] _________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s make_enc = functools.partial(, 'cl100k_base') 851s 851s @pytest.mark.parametrize("make_enc", SOME_ENCODING_FACTORIES) 851s > @hypothesis.given(data=st.data()) 851s 851s tests/test_offsets.py:29: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s tests/test_offsets.py:32: in test_hyp_offsets 851s enc = make_enc() 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s E Falsifying example: test_hyp_offsets( 851s E make_enc=functools.partial(get_encoding, 'cl100k_base'), 851s E data=data(...), 851s E ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ______________________________ test_basic_offsets ______________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_basic_offsets(): 851s > enc = tiktoken.get_encoding("cl100k_base") 851s 851s tests/test_offsets.py:50: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s _________________________________ test_pickle __________________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_pickle(): 851s import pickle 851s 851s > enc_old = tiktoken.get_encoding("r50k_base") 851s 851s tests/test_pickle.py:7: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 851s mergeable_ranks = load_tiktoken_bpe( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 851s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/r50k_base.tiktoken (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s _________________________________ test_simple __________________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = None, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/gpt-2/encodings/main/vocab.bpe', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_simple(): 851s # Note that there are more actual tests, they're just not currently public :-) 851s > enc = tiktoken.get_encoding("gpt2") 851s 851s tests/test_simple_public.py:9: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:18: in gpt2 851s mergeable_ranks = data_gym_to_mergeable_bpe_ranks( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:103: in data_gym_to_mergeable_bpe_ranks 851s vocab_bpe_contents = read_file_cached(vocab_bpe_file, vocab_bpe_hash).decode() 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s ___________________________ test_encoding_for_model ____________________________ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s > sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 851s raise err 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 851s source_address = None, socket_options = [(6, 1, 1)] 851s 851s def create_connection( 851s address: tuple[str, int], 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s source_address: tuple[str, int] | None = None, 851s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 851s ) -> socket.socket: 851s """Connect to *address* and return the socket object. 851s 851s Convenience function. Connect to *address* (a 2-tuple ``(host, 851s port)``) and return the socket object. Passing the optional 851s *timeout* parameter will set the timeout on the socket instance 851s before attempting to connect. If no *timeout* is supplied, the 851s global default timeout setting returned by :func:`socket.getdefaulttimeout` 851s is used. If *source_address* is set it must be a tuple of (host, port) 851s for the socket to bind as a source address before making the connection. 851s An host of '' or port 0 tells the OS to use the default. 851s """ 851s 851s host, port = address 851s if host.startswith("["): 851s host = host.strip("[]") 851s err = None 851s 851s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 851s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 851s # The original create_connection function always returns all records. 851s family = allowed_gai_family() 851s 851s try: 851s host.encode("idna") 851s except UnicodeError: 851s raise LocationParseError(f"'{host}', label empty or too long") from None 851s 851s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 851s af, socktype, proto, canonname, sa = res 851s sock = None 851s try: 851s sock = socket.socket(af, socktype, proto) 851s 851s # If provided, set socket level options before connecting. 851s _set_socket_options(sock, socket_options) 851s 851s if timeout is not _DEFAULT_TIMEOUT: 851s sock.settimeout(timeout) 851s if source_address: 851s sock.bind(source_address) 851s > sock.connect(sa) 851s E ConnectionRefusedError: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', body = None 851s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 851s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s redirect = False, assert_same_host = False 851s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 851s release_conn = False, chunked = False, body_pos = NoE: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest.ycJWu9/autopkgtest_tmp/build; python3.12 -m pytest tests 851s pybuild-autopkgtest: error: pybuild --autopkgtest --test-pytest -i python{version} -p 3.12 returned exit code 13 851s make: *** [/tmp/vfWODLs__Q/run:4: pybuild-autopkgtest] Error 25 851s pybuild-autopkgtest: error: /tmp/vfWODLs__Q/run pybuild-autopkgtest returned exit code 2 851s ne, preload_content = False 851s decode_content = False, response_kw = {} 851s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/gpt-2/encodings/main/vocab.bpe', query=None, fragment=None) 851s destination_scheme = None, conn = None, release_this_conn = True 851s http_tunnel_required = False, err = None, clean_exit = False 851s 851s def urlopen( # type: ignore[override] 851s self, 851s method: str, 851s url: str, 851s body: _TYPE_BODY | None = None, 851s headers: typing.Mapping[str, str] | None = None, 851s retries: Retry | bool | int | None = None, 851s redirect: bool = True, 851s assert_same_host: bool = True, 851s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 851s pool_timeout: int | None = None, 851s release_conn: bool | None = None, 851s chunked: bool = False, 851s body_pos: _TYPE_BODY_POSITION | None = None, 851s preload_content: bool = True, 851s decode_content: bool = True, 851s **response_kw: typing.Any, 851s ) -> BaseHTTPResponse: 851s """ 851s Get a connection from the pool and perform an HTTP request. This is the 851s lowest level call for making a request, so you'll need to specify all 851s the raw details. 851s 851s .. note:: 851s 851s More commonly, it's appropriate to use a convenience method 851s such as :meth:`request`. 851s 851s .. note:: 851s 851s `release_conn` will only behave as expected if 851s `preload_content=False` because we want to make 851s `preload_content=False` the default behaviour someday soon without 851s breaking backwards compatibility. 851s 851s :param method: 851s HTTP request method (such as GET, POST, PUT, etc.) 851s 851s :param url: 851s The URL to perform the request on. 851s 851s :param body: 851s Data to send in the request body, either :class:`str`, :class:`bytes`, 851s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 851s 851s :param headers: 851s Dictionary of custom headers to send, such as User-Agent, 851s If-None-Match, etc. If None, pool headers are used. If provided, 851s these headers completely replace any pool-specific headers. 851s 851s :param retries: 851s Configure the number of retries to allow before raising a 851s :class:`~urllib3.exceptions.MaxRetryError` exception. 851s 851s Pass ``None`` to retry until you receive a response. Pass a 851s :class:`~urllib3.util.retry.Retry` object for fine-grained control 851s over different types of retries. 851s Pass an integer number to retry connection errors that many times, 851s but no other types of errors. Pass zero to never retry. 851s 851s If ``False``, then retries are disabled and any exception is raised 851s immediately. Also, instead of raising a MaxRetryError on redirects, 851s the redirect response will be returned. 851s 851s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 851s 851s :param redirect: 851s If True, automatically handle redirects (status codes 301, 302, 851s 303, 307, 308). Each redirect counts as a retry. Disabling retries 851s will disable redirect, too. 851s 851s :param assert_same_host: 851s If ``True``, will make sure that the host of the pool requests is 851s consistent else will raise HostChangedError. When ``False``, you can 851s use the pool on an HTTP proxy and request foreign hosts. 851s 851s :param timeout: 851s If specified, overrides the default timeout for this one 851s request. It may be a float (in seconds) or an instance of 851s :class:`urllib3.util.Timeout`. 851s 851s :param pool_timeout: 851s If set and the pool is set to block=True, then this method will 851s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 851s connection is available within the time period. 851s 851s :param bool preload_content: 851s If True, the response's body will be preloaded into memory. 851s 851s :param bool decode_content: 851s If True, will attempt to decode the body based on the 851s 'content-encoding' header. 851s 851s :param release_conn: 851s If False, then the urlopen call will not release the connection 851s back into the pool once a response is received (but will release if 851s you read the entire contents of the response such as when 851s `preload_content=True`). This is useful if you're not preloading 851s the response's content immediately. You will need to call 851s ``r.release_conn()`` on the response ``r`` to return the connection 851s back into the pool. If None, it takes the value of ``preload_content`` 851s which defaults to ``True``. 851s 851s :param bool chunked: 851s If True, urllib3 will send the body using chunked transfer 851s encoding. Otherwise, urllib3 will send the body using the standard 851s content-length form. Defaults to False. 851s 851s :param int body_pos: 851s Position to seek to in file-like body in the event of a retry or 851s redirect. Typically this won't need to be set because urllib3 will 851s auto-populate the value when needed. 851s """ 851s parsed_url = parse_url(url) 851s destination_scheme = parsed_url.scheme 851s 851s if headers is None: 851s headers = self.headers 851s 851s if not isinstance(retries, Retry): 851s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 851s 851s if release_conn is None: 851s release_conn = preload_content 851s 851s # Check host 851s if assert_same_host and not self.is_same_host(url): 851s raise HostChangedError(self, url, retries) 851s 851s # Ensure that the URL we're connecting to is properly encoded 851s if url.startswith("/"): 851s url = to_str(_encode_target(url)) 851s else: 851s url = to_str(parsed_url.url) 851s 851s conn = None 851s 851s # Track whether `conn` needs to be released before 851s # returning/raising/recursing. Update this variable if necessary, and 851s # leave `release_conn` constant throughout the function. That way, if 851s # the function recurses, the original value of `release_conn` will be 851s # passed down into the recursive call, and its value will be respected. 851s # 851s # See issue #651 [1] for details. 851s # 851s # [1] 851s release_this_conn = release_conn 851s 851s http_tunnel_required = connection_requires_http_tunnel( 851s self.proxy, self.proxy_config, destination_scheme 851s ) 851s 851s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 851s # have to copy the headers dict so we can safely change it without those 851s # changes being reflected in anyone else's copy. 851s if not http_tunnel_required: 851s headers = headers.copy() # type: ignore[attr-defined] 851s headers.update(self.proxy_headers) # type: ignore[union-attr] 851s 851s # Must keep the exception bound to a separate variable or else Python 3 851s # complains about UnboundLocalError. 851s err = None 851s 851s # Keep track of whether we cleanly exited the except block. This 851s # ensures we do proper cleanup in finally. 851s clean_exit = False 851s 851s # Rewind body position, if needed. Record current position 851s # for future rewinds in the event of a redirect/retry. 851s body_pos = set_file_position(body, body_pos) 851s 851s try: 851s # Request a connection from the queue. 851s timeout_obj = self._get_timeout(timeout) 851s conn = self._get_conn(timeout=pool_timeout) 851s 851s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 851s 851s # Is this a closed/new connection that requires CONNECT tunnelling? 851s if self.proxy is not None and http_tunnel_required and conn.is_closed: 851s try: 851s self._prepare_proxy(conn) 851s except (BaseSSLError, OSError, SocketTimeout) as e: 851s self._raise_timeout( 851s err=e, url=self.proxy.url, timeout_value=conn.timeout 851s ) 851s raise 851s 851s # If we're going to release the connection in ``finally:``, then 851s # the response doesn't need to know about the connection. Otherwise 851s # it will also try to release it and we'll have a double-release 851s # mess. 851s response_conn = conn if not release_conn else None 851s 851s # Make the request on the HTTPConnection object 851s > response = self._make_request( 851s conn, 851s method, 851s url, 851s timeout=timeout_obj, 851s body=body, 851s headers=headers, 851s chunked=chunked, 851s retries=retries, 851s response_conn=response_conn, 851s preload_content=preload_content, 851s decode_content=decode_content, 851s **response_kw, 851s ) 851s 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 851s raise new_e 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 851s self._validate_conn(conn) 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 851s conn.connect() 851s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 851s self.sock = sock = self._new_conn() 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s 851s def _new_conn(self) -> socket.socket: 851s """Establish a socket connection and set nodelay settings on it. 851s 851s :return: New socket connection. 851s """ 851s try: 851s sock = connection.create_connection( 851s (self._dns_host, self.port), 851s self.timeout, 851s source_address=self.source_address, 851s socket_options=self.socket_options, 851s ) 851s except socket.gaierror as e: 851s raise NameResolutionError(self.host, self, e) from e 851s except SocketTimeout as e: 851s raise ConnectTimeoutError( 851s self, 851s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 851s ) from e 851s 851s except OSError as e: 851s > raise NewConnectionError( 851s self, f"Failed to establish a new connection: {e}" 851s ) from e 851s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 851s 851s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 851s 851s The above exception was the direct cause of the following exception: 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s > resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:667: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 851s retries = retries.increment( 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 851s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', response = None 851s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 851s _pool = 851s _stacktrace = 851s 851s def increment( 851s self, 851s method: str | None = None, 851s url: str | None = None, 851s response: BaseHTTPResponse | None = None, 851s error: Exception | None = None, 851s _pool: ConnectionPool | None = None, 851s _stacktrace: TracebackType | None = None, 851s ) -> Retry: 851s """Return a new Retry object with incremented retry counters. 851s 851s :param response: A response object, or None, if the server did not 851s return a response. 851s :type response: :class:`~urllib3.response.BaseHTTPResponse` 851s :param Exception error: An error encountered during the request, or 851s None if the response was received successfully. 851s 851s :return: A new ``Retry`` object. 851s """ 851s if self.total is False and error: 851s # Disabled, indicate to re-raise the error. 851s raise reraise(type(error), error, _stacktrace) 851s 851s total = self.total 851s if total is not None: 851s total -= 1 851s 851s connect = self.connect 851s read = self.read 851s redirect = self.redirect 851s status_count = self.status 851s other = self.other 851s cause = "unknown" 851s status = None 851s redirect_location = None 851s 851s if error and self._is_connection_error(error): 851s # Connect retry? 851s if connect is False: 851s raise reraise(type(error), error, _stacktrace) 851s elif connect is not None: 851s connect -= 1 851s 851s elif error and self._is_read_error(error): 851s # Read retry? 851s if read is False or method is None or not self._is_method_retryable(method): 851s raise reraise(type(error), error, _stacktrace) 851s elif read is not None: 851s read -= 1 851s 851s elif error: 851s # Other retry? 851s if other is not None: 851s other -= 1 851s 851s elif response and response.get_redirect_location(): 851s # Redirect retry? 851s if redirect is not None: 851s redirect -= 1 851s cause = "too many redirects" 851s response_redirect_location = response.get_redirect_location() 851s if response_redirect_location: 851s redirect_location = response_redirect_location 851s status = response.status 851s 851s else: 851s # Incrementing because of a server error like a 500 in 851s # status_forcelist and the given method is in the allowed_methods 851s cause = ResponseError.GENERIC_ERROR 851s if response and response.status: 851s if status_count is not None: 851s status_count -= 1 851s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 851s status = response.status 851s 851s history = self.history + ( 851s RequestHistory(method, url, error, status, redirect_location), 851s ) 851s 851s new_retry = self.new( 851s total=total, 851s connect=connect, 851s read=read, 851s redirect=redirect, 851s status=status_count, 851s other=other, 851s history=history, 851s ) 851s 851s if new_retry.is_exhausted(): 851s reason = error or ResponseError(cause) 851s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 851s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 851s 851s During handling of the above exception, another exception occurred: 851s 851s def test_encoding_for_model(): 851s > enc = tiktoken.encoding_for_model("gpt2") 851s 851s tests/test_simple_public.py:26: 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s /usr/lib/python3/dist-packages/tiktoken/model.py:105: in encoding_for_model 851s return get_encoding(encoding_name_for_model(model_name)) 851s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 851s enc = Encoding(**constructor()) 851s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:18: in gpt2 851s mergeable_ranks = data_gym_to_mergeable_bpe_ranks( 851s /usr/lib/python3/dist-packages/tiktoken/load.py:103: in data_gym_to_mergeable_bpe_ranks 851s vocab_bpe_contents = read_file_cached(vocab_bpe_file, vocab_bpe_hash).decode() 851s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 851s contents = read_file(blobpath) 851s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 851s resp = requests.get(blobpath) 851s /usr/lib/python3/dist-packages/requests/api.py:73: in get 851s return request("get", url, params=params, **kwargs) 851s /usr/lib/python3/dist-packages/requests/api.py:59: in request 851s return session.request(method=method, url=url, **kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 851s resp = self.send(prep, **send_kwargs) 851s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 851s r = adapter.send(request, **kwargs) 851s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 851s 851s self = 851s request = , stream = False 851s timeout = Timeout(connect=None, read=None, total=None), verify = True 851s cert = None, proxies = OrderedDict() 851s 851s def send( 851s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 851s ): 851s """Sends PreparedRequest object. Returns Response object. 851s 851s :param request: The :class:`PreparedRequest ` being sent. 851s :param stream: (optional) Whether to stream the request content. 851s :param timeout: (optional) How long to wait for the server to send 851s data before giving up, as a float, or a :ref:`(connect timeout, 851s read timeout) ` tuple. 851s :type timeout: float or tuple or urllib3 Timeout object 851s :param verify: (optional) Either a boolean, in which case it controls whether 851s we verify the server's TLS certificate, or a string, in which case it 851s must be a path to a CA bundle to use 851s :param cert: (optional) Any user-provided SSL certificate to be trusted. 851s :param proxies: (optional) The proxies dictionary to apply to the request. 851s :rtype: requests.Response 851s """ 851s 851s try: 851s conn = self.get_connection_with_tls_context( 851s request, verify, proxies=proxies, cert=cert 851s ) 851s except LocationValueError as e: 851s raise InvalidURL(e, request=request) 851s 851s self.cert_verify(conn, request.url, verify, cert) 851s url = self.request_url(request, proxies) 851s self.add_headers( 851s request, 851s stream=stream, 851s timeout=timeout, 851s verify=verify, 851s cert=cert, 851s proxies=proxies, 851s ) 851s 851s chunked = not (request.body is None or "Content-Length" in request.headers) 851s 851s if isinstance(timeout, tuple): 851s try: 851s connect, read = timeout 851s timeout = TimeoutSauce(connect=connect, read=read) 851s except ValueError: 851s raise ValueError( 851s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 851s f"or a single float to set both timeouts to the same value." 851s ) 851s elif isinstance(timeout, TimeoutSauce): 851s pass 851s else: 851s timeout = TimeoutSauce(connect=timeout, read=timeout) 851s 851s try: 851s resp = conn.urlopen( 851s method=request.method, 851s url=url, 851s body=request.body, 851s headers=request.headers, 851s redirect=False, 851s assert_same_host=False, 851s preload_content=False, 851s decode_content=False, 851s retries=self.max_retries, 851s timeout=timeout, 851s chunked=chunked, 851s ) 851s 851s except (ProtocolError, OSError) as err: 851s raise ConnectionError(err, request=request) 851s 851s except MaxRetryError as e: 851s if isinstance(e.reason, ConnectTimeoutError): 851s # TODO: Remove this in 3.0.0: see #2811 851s if not isinstance(e.reason, NewConnectionError): 851s raise ConnectTimeout(e, request=request) 851s 851s if isinstance(e.reason, ResponseError): 851s raise RetryError(e, request=request) 851s 851s if isinstance(e.reason, _ProxyError): 851s raise ProxyError(e, request=request) 851s 851s if isinstance(e.reason, _SSLError): 851s # This branch is for urllib3 v1.22 and later. 851s raise SSLError(e, request=request) 851s 851s > raise ConnectionError(e, request=request) 851s E requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 851s 851s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 851s =========================== short test summary info ============================ 851s FAILED tests/test_encoding.py::test_simple - requests.exceptions.ConnectionEr... 851s FAILED tests/test_encoding.py::test_simple_repeated - requests.exceptions.Con... 851s FAILED tests/test_encoding.py::test_simple_regex - requests.exceptions.Connec... 851s FAILED tests/test_encoding.py::test_basic_encode - requests.exceptions.Connec... 851s FAILED tests/test_encoding.py::test_encode_empty - requests.exceptions.Connec... 851s FAILED tests/test_encoding.py::test_encode_bytes - requests.exceptions.Connec... 851s FAILED tests/test_encoding.py::test_encode_surrogate_pairs - requests.excepti... 851s FAILED tests/test_encoding.py::test_catastrophically_repetitive[r50k_base] - ... 851s FAILED tests/test_encoding.py::test_catastrophically_repetitive[cl100k_base] 851s FAILED tests/test_encoding.py::test_basic_roundtrip[r50k_base] - requests.exc... 851s FAILED tests/test_encoding.py::test_basic_roundtrip[cl100k_base] - requests.e... 851s FAILED tests/test_encoding.py::test_hyp_roundtrip[r50k_base] - requests.excep... 851s FAILED tests/test_encoding.py::test_hyp_roundtrip[cl100k_base] - requests.exc... 851s FAILED tests/test_encoding.py::test_single_token_roundtrip[r50k_base] - reque... 851s FAILED tests/test_encoding.py::test_single_token_roundtrip[cl100k_base] - req... 851s FAILED tests/test_encoding.py::test_special_token - requests.exceptions.Conne... 851s FAILED tests/test_encoding.py::test_hyp_special_ordinary[r50k_base] - request... 851s FAILED tests/test_encoding.py::test_hyp_special_ordinary[cl100k_base] - reque... 851s FAILED tests/test_encoding.py::test_batch_encode[r50k_base] - requests.except... 851s FAILED tests/test_encoding.py::test_batch_encode[cl100k_base] - requests.exce... 851s FAILED tests/test_encoding.py::test_hyp_batch_roundtrip[r50k_base] - requests... 851s FAILED tests/test_encoding.py::test_hyp_batch_roundtrip[cl100k_base] - reques... 851s FAILED tests/test_misc.py::test_encoding_for_model - requests.exceptions.Conn... 851s FAILED tests/test_offsets.py::test_hyp_offsets[cl100k_base] - requests.except... 851s FAILED tests/test_offsets.py::test_basic_offsets - requests.exceptions.Connec... 851s FAILED tests/test_pickle.py::test_pickle - requests.exceptions.ConnectionErro... 851s FAILED tests/test_simple_public.py::test_simple - requests.exceptions.Connect... 851s FAILED tests/test_simple_public.py::test_encoding_for_model - requests.except... 851s =================== 28 failed, 2 passed in 611.22s (0:10:11) =================== 852s autopkgtest [18:38:57]: test pybuild-autopkgtest: -----------------------] 852s autopkgtest [18:38:57]: test pybuild-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 852s pybuild-autopkgtest FAIL non-zero exit status 25 853s autopkgtest [18:38:58]: @@@@@@@@@@@@@@@@@@@@ summary 853s pybuild-autopkgtest FAIL non-zero exit status 25 866s virt: nova [W] Using flock in prodstack6-ppc64el 866s virt: Creating nova instance adt-plucky-ppc64el-tiktoken-20241109-173317-juju-7f2275-prod-proposed-migration-environment-2-2d7e4713-bca7-4cc9-853a-6fc8981dec9a from image adt/ubuntu-plucky-ppc64el-server-20241108.img (UUID 211c30ab-5e06-4166-a7df-df534accb012)...