0s autopkgtest [14:53:23]: starting date and time: 2024-11-08 14:53:23+0000 0s autopkgtest [14:53:23]: git checkout: 6f3be7a8 Fix armhf LXD image generation for plucky 0s autopkgtest [14:53:23]: host juju-7f2275-prod-proposed-migration-environment-9; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.94mne1qk/out --timeout-copy=6000 --setup-commands 'ln -s /dev/null /etc/systemd/system/bluetooth.service; printf "http_proxy=http://squid.internal:3128\nhttps_proxy=http://squid.internal:3128\nno_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\n" >> /etc/environment' --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 -- lxd -r lxd-armhf-10.145.243.234 lxd-armhf-10.145.243.234:autopkgtest/ubuntu/plucky/armhf 54s autopkgtest [14:54:17]: testbed dpkg architecture: armhf 56s autopkgtest [14:54:19]: testbed apt version: 2.9.8 56s autopkgtest [14:54:19]: @@@@@@@@@@@@@@@@@@@@ test bed setup 64s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [73.9 kB] 64s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [7016 B] 64s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [18.2 kB] 64s Get:4 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [1308 kB] 65s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [168 kB] 65s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf Packages [214 kB] 65s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/universe armhf Packages [966 kB] 65s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse armhf Packages [17.7 kB] 65s Fetched 2773 kB in 2s (1547 kB/s) 66s Reading package lists... 83s tee: /proc/self/fd/2: Permission denied 107s Hit:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease 107s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 107s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 107s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 108s Reading package lists... 108s Reading package lists... 109s Building dependency tree... 109s Reading state information... 109s Calculating upgrade... 110s The following packages were automatically installed and are no longer required: 110s libperl5.38t64 perl-modules-5.38 python3-netifaces 110s Use 'apt autoremove' to remove them. 110s The following NEW packages will be installed: 110s libperl5.40 perl-modules-5.40 110s The following packages will be upgraded: 110s base-files distro-info-data fwupd gcc-14-base info install-info iproute2 110s libarchive13t64 libatomic1 libblockdev-crypto3 libblockdev-fs3 110s libblockdev-loop3 libblockdev-mdraid3 libblockdev-nvme3 libblockdev-part3 110s libblockdev-swap3 libblockdev-utils3 libblockdev3 libdb5.3t64 libdw1t64 110s libelf1t64 libevdev2 libflashrom1 libftdi1-2 libfwupd2 libgcc-s1 libinih1 110s libkeyutils1 libldap-common libldap2 liblocale-gettext-perl libnetplan1 110s libpipeline1 libplymouth5 libsgutils2-1.46-2 libstdc++6 110s libtext-charwidth-perl libtext-iconv-perl libtraceevent1 110s libtraceevent1-plugin libxau6 motd-news-config nano netplan-generator 110s netplan.io perl perl-base plymouth plymouth-theme-ubuntu-text 110s python3-configobj python3-jaraco.functools python3-json-pointer 110s python3-lazr.uri python3-netplan python3-oauthlib python3-typeguard 110s python3-zipp sg3-utils sg3-utils-udev ssh-import-id ufw vim-common vim-tiny 110s xxd 110s 64 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. 110s Need to get 21.3 MB of archives. 110s After this operation, 42.8 MB of additional disk space will be used. 110s Get:1 http://ftpmaster.internal/ubuntu plucky/main armhf motd-news-config all 13.5ubuntu3 [5190 B] 110s Get:2 http://ftpmaster.internal/ubuntu plucky/main armhf base-files armhf 13.5ubuntu3 [75.1 kB] 110s Get:3 http://ftpmaster.internal/ubuntu plucky/main armhf perl-modules-5.40 all 5.40.0-6 [3214 kB] 111s Get:4 http://ftpmaster.internal/ubuntu plucky/main armhf libperl5.40 armhf 5.40.0-6 [4140 kB] 111s Get:5 http://ftpmaster.internal/ubuntu plucky/main armhf perl armhf 5.40.0-6 [262 kB] 111s Get:6 http://ftpmaster.internal/ubuntu plucky/main armhf perl-base armhf 5.40.0-6 [1674 kB] 111s Get:7 http://ftpmaster.internal/ubuntu plucky/main armhf liblocale-gettext-perl armhf 1.07-7build1 [15.0 kB] 111s Get:8 http://ftpmaster.internal/ubuntu plucky/main armhf libtext-iconv-perl armhf 1.7-8build4 [12.8 kB] 111s Get:9 http://ftpmaster.internal/ubuntu plucky/main armhf libtext-charwidth-perl armhf 0.04-11build4 [9128 B] 111s Get:10 http://ftpmaster.internal/ubuntu plucky/main armhf libdb5.3t64 armhf 5.3.28+dfsg2-9 [655 kB] 111s Get:11 http://ftpmaster.internal/ubuntu plucky/main armhf libatomic1 armhf 14.2.0-7ubuntu1 [7842 B] 111s Get:12 http://ftpmaster.internal/ubuntu plucky/main armhf gcc-14-base armhf 14.2.0-7ubuntu1 [51.2 kB] 111s Get:13 http://ftpmaster.internal/ubuntu plucky/main armhf libstdc++6 armhf 14.2.0-7ubuntu1 [711 kB] 111s Get:14 http://ftpmaster.internal/ubuntu plucky/main armhf libgcc-s1 armhf 14.2.0-7ubuntu1 [40.8 kB] 111s Get:15 http://ftpmaster.internal/ubuntu plucky/main armhf install-info armhf 7.1.1-1 [61.4 kB] 111s Get:16 http://ftpmaster.internal/ubuntu plucky/main armhf distro-info-data all 0.63 [6588 B] 111s Get:17 http://ftpmaster.internal/ubuntu plucky/main armhf libdw1t64 armhf 0.192-4 [243 kB] 111s Get:18 http://ftpmaster.internal/ubuntu plucky/main armhf libelf1t64 armhf 0.192-4 [50.2 kB] 111s Get:19 http://ftpmaster.internal/ubuntu plucky/main armhf iproute2 armhf 6.10.0-2ubuntu1 [1082 kB] 111s Get:20 http://ftpmaster.internal/ubuntu plucky/main armhf libkeyutils1 armhf 1.6.3-4ubuntu2 [8712 B] 111s Get:21 http://ftpmaster.internal/ubuntu plucky/main armhf netplan-generator armhf 1.1.1-1 [60.4 kB] 111s Get:22 http://ftpmaster.internal/ubuntu plucky/main armhf python3-netplan armhf 1.1.1-1 [24.1 kB] 111s Get:23 http://ftpmaster.internal/ubuntu plucky/main armhf netplan.io armhf 1.1.1-1 [66.4 kB] 111s Get:24 http://ftpmaster.internal/ubuntu plucky/main armhf libnetplan1 armhf 1.1.1-1 [122 kB] 111s Get:25 http://ftpmaster.internal/ubuntu plucky/main armhf vim-tiny armhf 2:9.1.0777-1ubuntu1 [693 kB] 111s Get:26 http://ftpmaster.internal/ubuntu plucky/main armhf vim-common all 2:9.1.0777-1ubuntu1 [394 kB] 111s Get:27 http://ftpmaster.internal/ubuntu plucky/main armhf xxd armhf 2:9.1.0777-1ubuntu1 [66.8 kB] 111s Get:28 http://ftpmaster.internal/ubuntu plucky/main armhf info armhf 7.1.1-1 [126 kB] 111s Get:29 http://ftpmaster.internal/ubuntu plucky/main armhf libevdev2 armhf 1.13.3+dfsg-1 [29.7 kB] 111s Get:30 http://ftpmaster.internal/ubuntu plucky/main armhf libpipeline1 armhf 1.5.8-1 [26.9 kB] 111s Get:31 http://ftpmaster.internal/ubuntu plucky/main armhf libplymouth5 armhf 24.004.60-1ubuntu11 [140 kB] 111s Get:32 http://ftpmaster.internal/ubuntu plucky/main armhf libtraceevent1-plugin armhf 1:1.8.3-1ubuntu1 [18.1 kB] 111s Get:33 http://ftpmaster.internal/ubuntu plucky/main armhf libtraceevent1 armhf 1:1.8.3-1ubuntu1 [52.1 kB] 111s Get:34 http://ftpmaster.internal/ubuntu plucky/main armhf libxau6 armhf 1:1.0.11-1 [6558 B] 111s Get:35 http://ftpmaster.internal/ubuntu plucky/main armhf nano armhf 8.2-1 [276 kB] 111s Get:36 http://ftpmaster.internal/ubuntu plucky/main armhf plymouth-theme-ubuntu-text armhf 24.004.60-1ubuntu11 [9920 B] 111s Get:37 http://ftpmaster.internal/ubuntu plucky/main armhf plymouth armhf 24.004.60-1ubuntu11 [142 kB] 111s Get:38 http://ftpmaster.internal/ubuntu plucky/main armhf ufw all 0.36.2-8 [170 kB] 111s Get:39 http://ftpmaster.internal/ubuntu plucky/main armhf libarchive13t64 armhf 3.7.4-1ubuntu1 [331 kB] 111s Get:40 http://ftpmaster.internal/ubuntu plucky/main armhf libftdi1-2 armhf 1.5-7 [25.7 kB] 111s Get:41 http://ftpmaster.internal/ubuntu plucky/main armhf libflashrom1 armhf 1.4.0-3ubuntu1 [141 kB] 111s Get:42 http://ftpmaster.internal/ubuntu plucky/main armhf libfwupd2 armhf 1.9.26-2 [125 kB] 111s Get:43 http://ftpmaster.internal/ubuntu plucky/main armhf fwupd armhf 1.9.26-2 [4404 kB] 112s Get:44 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-utils3 armhf 3.2.0-2 [17.4 kB] 112s Get:45 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-crypto3 armhf 3.2.0-2 [22.3 kB] 112s Get:46 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-fs3 armhf 3.2.0-2 [34.3 kB] 112s Get:47 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-loop3 armhf 3.2.0-2 [6552 B] 112s Get:48 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-mdraid3 armhf 3.2.0-2 [13.4 kB] 112s Get:49 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-nvme3 armhf 3.2.0-2 [17.6 kB] 112s Get:50 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-part3 armhf 3.2.0-2 [16.5 kB] 112s Get:51 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-swap3 armhf 3.2.0-2 [8942 B] 112s Get:52 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev3 armhf 3.2.0-2 [44.2 kB] 112s Get:53 http://ftpmaster.internal/ubuntu plucky/main armhf libinih1 armhf 58-1ubuntu1 [6750 B] 112s Get:54 http://ftpmaster.internal/ubuntu plucky/main armhf libldap-common all 2.6.8+dfsg-1~exp4ubuntu3 [32.3 kB] 112s Get:55 http://ftpmaster.internal/ubuntu plucky/main armhf libldap2 armhf 2.6.8+dfsg-1~exp4ubuntu3 [173 kB] 112s Get:56 http://ftpmaster.internal/ubuntu plucky/main armhf libsgutils2-1.46-2 armhf 1.46-3ubuntu5 [82.5 kB] 112s Get:57 http://ftpmaster.internal/ubuntu plucky/main armhf python3-configobj all 5.0.9-1 [33.9 kB] 112s Get:58 http://ftpmaster.internal/ubuntu plucky/main armhf python3-jaraco.functools all 4.1.0-1 [11.8 kB] 112s Get:59 http://ftpmaster.internal/ubuntu plucky/main armhf python3-json-pointer all 2.4-2 [8396 B] 112s Get:60 http://ftpmaster.internal/ubuntu plucky/main armhf python3-lazr.uri all 1.0.6-4 [13.6 kB] 112s Get:61 http://ftpmaster.internal/ubuntu plucky/main armhf python3-oauthlib all 3.2.2-2 [89.8 kB] 112s Get:62 http://ftpmaster.internal/ubuntu plucky/main armhf python3-typeguard all 4.4.1-1 [29.0 kB] 112s Get:63 http://ftpmaster.internal/ubuntu plucky/main armhf python3-zipp all 3.20.2-1 [10.1 kB] 112s Get:64 http://ftpmaster.internal/ubuntu plucky/main armhf sg3-utils armhf 1.46-3ubuntu5 [816 kB] 112s Get:65 http://ftpmaster.internal/ubuntu plucky/main armhf sg3-utils-udev all 1.46-3ubuntu5 [5916 B] 112s Get:66 http://ftpmaster.internal/ubuntu plucky/main armhf ssh-import-id all 5.11-0ubuntu3 [10.1 kB] 112s Preconfiguring packages ... 112s Fetched 21.3 MB in 2s (11.7 MB/s) 113s (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 ... 59386 files and directories currently installed.) 113s Preparing to unpack .../motd-news-config_13.5ubuntu3_all.deb ... 113s Unpacking motd-news-config (13.5ubuntu3) over (13.3ubuntu6) ... 113s Preparing to unpack .../base-files_13.5ubuntu3_armhf.deb ... 113s Unpacking base-files (13.5ubuntu3) over (13.3ubuntu6) ... 113s Setting up base-files (13.5ubuntu3) ... 113s Installing new version of config file /etc/issue ... 113s Installing new version of config file /etc/issue.net ... 113s Installing new version of config file /etc/lsb-release ... 114s motd-news.service is a disabled or a static unit not running, not starting it. 114s (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 ... 59386 files and directories currently installed.) 114s Preparing to unpack .../perl_5.40.0-6_armhf.deb ... 114s Unpacking perl (5.40.0-6) over (5.38.2-5) ... 114s Selecting previously unselected package perl-modules-5.40. 114s Preparing to unpack .../perl-modules-5.40_5.40.0-6_all.deb ... 114s Unpacking perl-modules-5.40 (5.40.0-6) ... 114s Selecting previously unselected package libperl5.40:armhf. 114s Preparing to unpack .../libperl5.40_5.40.0-6_armhf.deb ... 114s Unpacking libperl5.40:armhf (5.40.0-6) ... 115s Preparing to unpack .../perl-base_5.40.0-6_armhf.deb ... 115s Unpacking perl-base (5.40.0-6) over (5.38.2-5) ... 115s Setting up perl-base (5.40.0-6) ... 115s (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 ... 61462 files and directories currently installed.) 115s Preparing to unpack .../liblocale-gettext-perl_1.07-7build1_armhf.deb ... 115s Unpacking liblocale-gettext-perl (1.07-7build1) over (1.07-7) ... 115s Preparing to unpack .../libtext-iconv-perl_1.7-8build4_armhf.deb ... 115s Unpacking libtext-iconv-perl:armhf (1.7-8build4) over (1.7-8build3) ... 115s Preparing to unpack .../libtext-charwidth-perl_0.04-11build4_armhf.deb ... 115s Unpacking libtext-charwidth-perl:armhf (0.04-11build4) over (0.04-11build3) ... 115s Preparing to unpack .../libdb5.3t64_5.3.28+dfsg2-9_armhf.deb ... 115s Unpacking libdb5.3t64:armhf (5.3.28+dfsg2-9) over (5.3.28+dfsg2-7) ... 115s Setting up libdb5.3t64:armhf (5.3.28+dfsg2-9) ... 115s (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 ... 61462 files and directories currently installed.) 115s Preparing to unpack .../libatomic1_14.2.0-7ubuntu1_armhf.deb ... 115s Unpacking libatomic1:armhf (14.2.0-7ubuntu1) over (14.2.0-4ubuntu2) ... 115s Preparing to unpack .../gcc-14-base_14.2.0-7ubuntu1_armhf.deb ... 115s Unpacking gcc-14-base:armhf (14.2.0-7ubuntu1) over (14.2.0-4ubuntu2) ... 115s Setting up gcc-14-base:armhf (14.2.0-7ubuntu1) ... 115s (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 ... 61462 files and directories currently installed.) 115s Preparing to unpack .../libstdc++6_14.2.0-7ubuntu1_armhf.deb ... 115s Unpacking libstdc++6:armhf (14.2.0-7ubuntu1) over (14.2.0-4ubuntu2) ... 115s Setting up libstdc++6:armhf (14.2.0-7ubuntu1) ... 116s (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 ... 61462 files and directories currently installed.) 116s Preparing to unpack .../libgcc-s1_14.2.0-7ubuntu1_armhf.deb ... 116s Unpacking libgcc-s1:armhf (14.2.0-7ubuntu1) over (14.2.0-4ubuntu2) ... 116s Setting up libgcc-s1:armhf (14.2.0-7ubuntu1) ... 116s (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 ... 61462 files and directories currently installed.) 116s Preparing to unpack .../install-info_7.1.1-1_armhf.deb ... 116s Unpacking install-info (7.1.1-1) over (7.1-3build2) ... 116s Setting up install-info (7.1.1-1) ... 116s (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 ... 61462 files and directories currently installed.) 116s Preparing to unpack .../00-distro-info-data_0.63_all.deb ... 116s Unpacking distro-info-data (0.63) over (0.62) ... 116s Preparing to unpack .../01-libdw1t64_0.192-4_armhf.deb ... 116s Unpacking libdw1t64:armhf (0.192-4) over (0.191-2) ... 116s Preparing to unpack .../02-libelf1t64_0.192-4_armhf.deb ... 116s Unpacking libelf1t64:armhf (0.192-4) over (0.191-2) ... 116s Preparing to unpack .../03-iproute2_6.10.0-2ubuntu1_armhf.deb ... 116s Unpacking iproute2 (6.10.0-2ubuntu1) over (6.10.0-2) ... 116s Preparing to unpack .../04-libkeyutils1_1.6.3-4ubuntu2_armhf.deb ... 116s Unpacking libkeyutils1:armhf (1.6.3-4ubuntu2) over (1.6.3-3build1) ... 116s Preparing to unpack .../05-netplan-generator_1.1.1-1_armhf.deb ... 117s Adding 'diversion of /lib/systemd/system-generators/netplan to /lib/systemd/system-generators/netplan.usr-is-merged by netplan-generator' 117s Unpacking netplan-generator (1.1.1-1) over (1.1-1) ... 117s Preparing to unpack .../06-python3-netplan_1.1.1-1_armhf.deb ... 117s Unpacking python3-netplan (1.1.1-1) over (1.1-1) ... 117s Preparing to unpack .../07-netplan.io_1.1.1-1_armhf.deb ... 117s Unpacking netplan.io (1.1.1-1) over (1.1-1) ... 117s Preparing to unpack .../08-libnetplan1_1.1.1-1_armhf.deb ... 117s Unpacking libnetplan1:armhf (1.1.1-1) over (1.1-1) ... 117s Preparing to unpack .../09-vim-tiny_2%3a9.1.0777-1ubuntu1_armhf.deb ... 117s Unpacking vim-tiny (2:9.1.0777-1ubuntu1) over (2:9.1.0496-1ubuntu6) ... 117s Preparing to unpack .../10-vim-common_2%3a9.1.0777-1ubuntu1_all.deb ... 117s Unpacking vim-common (2:9.1.0777-1ubuntu1) over (2:9.1.0496-1ubuntu6) ... 117s Preparing to unpack .../11-xxd_2%3a9.1.0777-1ubuntu1_armhf.deb ... 117s Unpacking xxd (2:9.1.0777-1ubuntu1) over (2:9.1.0496-1ubuntu6) ... 117s Preparing to unpack .../12-info_7.1.1-1_armhf.deb ... 117s Unpacking info (7.1.1-1) over (7.1-3build2) ... 117s Preparing to unpack .../13-libevdev2_1.13.3+dfsg-1_armhf.deb ... 117s Unpacking libevdev2:armhf (1.13.3+dfsg-1) over (1.13.2+dfsg-1) ... 117s Preparing to unpack .../14-libpipeline1_1.5.8-1_armhf.deb ... 117s Unpacking libpipeline1:armhf (1.5.8-1) over (1.5.7-2) ... 117s Preparing to unpack .../15-libplymouth5_24.004.60-1ubuntu11_armhf.deb ... 117s Unpacking libplymouth5:armhf (24.004.60-1ubuntu11) over (24.004.60-1ubuntu10) ... 117s Preparing to unpack .../16-libtraceevent1-plugin_1%3a1.8.3-1ubuntu1_armhf.deb ... 117s Unpacking libtraceevent1-plugin:armhf (1:1.8.3-1ubuntu1) over (1:1.8.2-1ubuntu3) ... 117s Preparing to unpack .../17-libtraceevent1_1%3a1.8.3-1ubuntu1_armhf.deb ... 117s Unpacking libtraceevent1:armhf (1:1.8.3-1ubuntu1) over (1:1.8.2-1ubuntu3) ... 117s Preparing to unpack .../18-libxau6_1%3a1.0.11-1_armhf.deb ... 117s Unpacking libxau6:armhf (1:1.0.11-1) over (1:1.0.9-1build6) ... 117s Preparing to unpack .../19-nano_8.2-1_armhf.deb ... 117s Unpacking nano (8.2-1) over (8.1-1) ... 117s Preparing to unpack .../20-plymouth-theme-ubuntu-text_24.004.60-1ubuntu11_armhf.deb ... 117s Unpacking plymouth-theme-ubuntu-text (24.004.60-1ubuntu11) over (24.004.60-1ubuntu10) ... 117s Preparing to unpack .../21-plymouth_24.004.60-1ubuntu11_armhf.deb ... 117s Unpacking plymouth (24.004.60-1ubuntu11) over (24.004.60-1ubuntu10) ... 118s Preparing to unpack .../22-ufw_0.36.2-8_all.deb ... 118s Unpacking ufw (0.36.2-8) over (0.36.2-6) ... 118s Preparing to unpack .../23-libarchive13t64_3.7.4-1ubuntu1_armhf.deb ... 118s Unpacking libarchive13t64:armhf (3.7.4-1ubuntu1) over (3.7.4-1) ... 118s Preparing to unpack .../24-libftdi1-2_1.5-7_armhf.deb ... 118s Unpacking libftdi1-2:armhf (1.5-7) over (1.5-6build5) ... 118s Preparing to unpack .../25-libflashrom1_1.4.0-3ubuntu1_armhf.deb ... 118s Unpacking libflashrom1:armhf (1.4.0-3ubuntu1) over (1.3.0-2.1ubuntu2) ... 118s Preparing to unpack .../26-libfwupd2_1.9.26-2_armhf.deb ... 118s Unpacking libfwupd2:armhf (1.9.26-2) over (1.9.24-1) ... 118s Preparing to unpack .../27-fwupd_1.9.26-2_armhf.deb ... 118s Unpacking fwupd (1.9.26-2) over (1.9.24-1) ... 118s Preparing to unpack .../28-libblockdev-utils3_3.2.0-2_armhf.deb ... 118s Unpacking libblockdev-utils3:armhf (3.2.0-2) over (3.1.1-2) ... 118s Preparing to unpack .../29-libblockdev-crypto3_3.2.0-2_armhf.deb ... 118s Unpacking libblockdev-crypto3:armhf (3.2.0-2) over (3.1.1-2) ... 118s Preparing to unpack .../30-libblockdev-fs3_3.2.0-2_armhf.deb ... 118s Unpacking libblockdev-fs3:armhf (3.2.0-2) over (3.1.1-2) ... 119s Preparing to unpack .../31-libblockdev-loop3_3.2.0-2_armhf.deb ... 119s Unpacking libblockdev-loop3:armhf (3.2.0-2) over (3.1.1-2) ... 119s Preparing to unpack .../32-libblockdev-mdraid3_3.2.0-2_armhf.deb ... 119s Unpacking libblockdev-mdraid3:armhf (3.2.0-2) over (3.1.1-2) ... 119s Preparing to unpack .../33-libblockdev-nvme3_3.2.0-2_armhf.deb ... 119s Unpacking libblockdev-nvme3:armhf (3.2.0-2) over (3.1.1-2) ... 119s Preparing to unpack .../34-libblockdev-part3_3.2.0-2_armhf.deb ... 119s Unpacking libblockdev-part3:armhf (3.2.0-2) over (3.1.1-2) ... 119s Preparing to unpack .../35-libblockdev-swap3_3.2.0-2_armhf.deb ... 119s Unpacking libblockdev-swap3:armhf (3.2.0-2) over (3.1.1-2) ... 119s Preparing to unpack .../36-libblockdev3_3.2.0-2_armhf.deb ... 119s Unpacking libblockdev3:armhf (3.2.0-2) over (3.1.1-2) ... 119s Preparing to unpack .../37-libinih1_58-1ubuntu1_armhf.deb ... 119s Unpacking libinih1:armhf (58-1ubuntu1) over (55-1ubuntu2) ... 119s Preparing to unpack .../38-libldap-common_2.6.8+dfsg-1~exp4ubuntu3_all.deb ... 119s Unpacking libldap-common (2.6.8+dfsg-1~exp4ubuntu3) over (2.6.8+dfsg-1~exp4ubuntu1) ... 119s Preparing to unpack .../39-libldap2_2.6.8+dfsg-1~exp4ubuntu3_armhf.deb ... 119s Unpacking libldap2:armhf (2.6.8+dfsg-1~exp4ubuntu3) over (2.6.8+dfsg-1~exp4ubuntu1) ... 119s Preparing to unpack .../40-libsgutils2-1.46-2_1.46-3ubuntu5_armhf.deb ... 119s Unpacking libsgutils2-1.46-2:armhf (1.46-3ubuntu5) over (1.46-3ubuntu4) ... 119s Preparing to unpack .../41-python3-configobj_5.0.9-1_all.deb ... 119s Unpacking python3-configobj (5.0.9-1) over (5.0.8-3) ... 119s Preparing to unpack .../42-python3-jaraco.functools_4.1.0-1_all.deb ... 119s Unpacking python3-jaraco.functools (4.1.0-1) over (4.0.2-1) ... 119s Preparing to unpack .../43-python3-json-pointer_2.4-2_all.deb ... 119s Unpacking python3-json-pointer (2.4-2) over (2.0-0ubuntu1) ... 119s Preparing to unpack .../44-python3-lazr.uri_1.0.6-4_all.deb ... 119s Unpacking python3-lazr.uri (1.0.6-4) over (1.0.6-3) ... 119s Preparing to unpack .../45-python3-oauthlib_3.2.2-2_all.deb ... 120s Unpacking python3-oauthlib (3.2.2-2) over (3.2.2-1) ... 120s Preparing to unpack .../46-python3-typeguard_4.4.1-1_all.deb ... 120s Unpacking python3-typeguard (4.4.1-1) over (4.3.0-1) ... 120s Preparing to unpack .../47-python3-zipp_3.20.2-1_all.deb ... 120s Unpacking python3-zipp (3.20.2-1) over (3.20.0-1) ... 120s Preparing to unpack .../48-sg3-utils_1.46-3ubuntu5_armhf.deb ... 120s Unpacking sg3-utils (1.46-3ubuntu5) over (1.46-3ubuntu4) ... 120s Preparing to unpack .../49-sg3-utils-udev_1.46-3ubuntu5_all.deb ... 120s Unpacking sg3-utils-udev (1.46-3ubuntu5) over (1.46-3ubuntu4) ... 120s Preparing to unpack .../50-ssh-import-id_5.11-0ubuntu3_all.deb ... 120s Unpacking ssh-import-id (5.11-0ubuntu3) over (5.11-0ubuntu2) ... 120s Setting up libpipeline1:armhf (1.5.8-1) ... 120s Setting up motd-news-config (13.5ubuntu3) ... 120s Setting up libtext-iconv-perl:armhf (1.7-8build4) ... 120s Setting up libtext-charwidth-perl:armhf (0.04-11build4) ... 120s Setting up libxau6:armhf (1:1.0.11-1) ... 120s Setting up libkeyutils1:armhf (1.6.3-4ubuntu2) ... 120s Setting up python3-jaraco.functools (4.1.0-1) ... 120s Setting up distro-info-data (0.63) ... 120s Setting up libinih1:armhf (58-1ubuntu1) ... 120s Setting up ssh-import-id (5.11-0ubuntu3) ... 120s Setting up python3-typeguard (4.4.1-1) ... 121s Setting up libfwupd2:armhf (1.9.26-2) ... 121s Setting up libsgutils2-1.46-2:armhf (1.46-3ubuntu5) ... 121s Setting up ufw (0.36.2-8) ... 122s Setting up python3-lazr.uri (1.0.6-4) ... 122s Setting up python3-zipp (3.20.2-1) ... 122s Setting up libnetplan1:armhf (1.1.1-1) ... 122s Setting up libldap-common (2.6.8+dfsg-1~exp4ubuntu3) ... 122s Setting up xxd (2:9.1.0777-1ubuntu1) ... 122s Setting up libelf1t64:armhf (0.192-4) ... 122s Setting up libdw1t64:armhf (0.192-4) ... 122s Setting up libftdi1-2:armhf (1.5-7) ... 122s Setting up libflashrom1:armhf (1.4.0-3ubuntu1) ... 122s Setting up python3-oauthlib (3.2.2-2) ... 122s Setting up python3-configobj (5.0.9-1) ... 122s Setting up vim-common (2:9.1.0777-1ubuntu1) ... 122s Installing new version of config file /etc/vim/vimrc ... 122s Setting up libblockdev-utils3:armhf (3.2.0-2) ... 122s Setting up libatomic1:armhf (14.2.0-7ubuntu1) ... 122s Setting up libblockdev-nvme3:armhf (3.2.0-2) ... 122s Setting up nano (8.2-1) ... 122s Setting up libblockdev-fs3:armhf (3.2.0-2) ... 122s Setting up perl-modules-5.40 (5.40.0-6) ... 122s Setting up python3-json-pointer (2.4-2) ... 123s Setting up libtraceevent1:armhf (1:1.8.3-1ubuntu1) ... 123s Setting up python3-netplan (1.1.1-1) ... 123s Setting up netplan-generator (1.1.1-1) ... 123s Removing 'diversion of /lib/systemd/system-generators/netplan to /lib/systemd/system-generators/netplan.usr-is-merged by netplan-generator' 123s Setting up libarchive13t64:armhf (3.7.4-1ubuntu1) ... 123s Setting up libevdev2:armhf (1.13.3+dfsg-1) ... 123s Setting up libldap2:armhf (2.6.8+dfsg-1~exp4ubuntu3) ... 123s Setting up fwupd (1.9.26-2) ... 123s fwupd-offline-update.service is a disabled or a static unit not running, not starting it. 123s fwupd-refresh.service is a disabled or a static unit not running, not starting it. 123s fwupd.service is a disabled or a static unit not running, not starting it. 123s Setting up info (7.1.1-1) ... 123s Setting up liblocale-gettext-perl (1.07-7build1) ... 123s Setting up sg3-utils (1.46-3ubuntu5) ... 123s Setting up libblockdev-mdraid3:armhf (3.2.0-2) ... 123s Setting up libblockdev-crypto3:armhf (3.2.0-2) ... 123s Setting up libblockdev-swap3:armhf (3.2.0-2) ... 123s Setting up iproute2 (6.10.0-2ubuntu1) ... 124s Setting up libblockdev-loop3:armhf (3.2.0-2) ... 124s Setting up vim-tiny (2:9.1.0777-1ubuntu1) ... 124s Setting up libblockdev3:armhf (3.2.0-2) ... 124s Installing new version of config file /etc/libblockdev/3/conf.d/00-default.cfg ... 124s Setting up libblockdev-part3:armhf (3.2.0-2) ... 124s Setting up sg3-utils-udev (1.46-3ubuntu5) ... 124s update-initramfs: deferring update (trigger activated) 124s Setting up netplan.io (1.1.1-1) ... 124s Setting up libperl5.40:armhf (5.40.0-6) ... 124s Setting up perl (5.40.0-6) ... 124s Setting up libtraceevent1-plugin:armhf (1:1.8.3-1ubuntu1) ... 124s Setting up libplymouth5:armhf (24.004.60-1ubuntu11) ... 124s Setting up plymouth (24.004.60-1ubuntu11) ... 124s update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults 124s update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults 124s Setting up plymouth-theme-ubuntu-text (24.004.60-1ubuntu11) ... 124s update-initramfs: deferring update (trigger activated) 125s Processing triggers for install-info (7.1.1-1) ... 125s Processing triggers for initramfs-tools (0.142ubuntu34) ... 125s Processing triggers for libc-bin (2.40-1ubuntu3) ... 125s Processing triggers for rsyslog (8.2406.0-1ubuntu2) ... 125s Processing triggers for man-db (2.12.1-3) ... 127s Processing triggers for dbus (1.14.10-4ubuntu5) ... 127s Reading package lists... 127s Building dependency tree... 127s Reading state information... 128s The following packages will be REMOVED: 128s libperl5.38t64* perl-modules-5.38* python3-netifaces* 128s 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. 128s After this operation, 41.7 MB disk space will be freed. 128s (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 ... 61462 files and directories currently installed.) 128s Removing libperl5.38t64:armhf (5.38.2-5) ... 128s Removing perl-modules-5.38 (5.38.2-5) ... 128s Removing python3-netifaces:armhf (0.11.0-2build3) ... 128s Processing triggers for man-db (2.12.1-3) ... 129s Processing triggers for libc-bin (2.40-1ubuntu3) ... 131s autopkgtest [14:55:34]: rebooting testbed after setup commands that affected boot 197s autopkgtest [14:56:40]: testbed running kernel: Linux 6.8.0-47-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Oct 2 16:39:14 UTC 2 224s autopkgtest [14:57:07]: @@@@@@@@@@@@@@@@@@@@ apt-source tiktoken 235s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed/universe tiktoken 0.8.0-1 (dsc) [2252 B] 235s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/universe tiktoken 0.8.0-1 (tar) [31.6 kB] 235s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/universe tiktoken 0.8.0-1 (diff) [3840 B] 235s gpgv: Signature made Wed Oct 30 06:26:55 2024 UTC 235s gpgv: using RSA key 638BC75EC1E5C589067E35DE62645EB35F686A8A 235s gpgv: issuer "cdluminate@gmail.com" 235s gpgv: Can't check signature: No public key 235s dpkg-source: warning: cannot verify inline signature for ./tiktoken_0.8.0-1.dsc: no acceptable signature found 235s autopkgtest [14:57:18]: testing package tiktoken version 0.8.0-1 237s autopkgtest [14:57:20]: build not needed 241s autopkgtest [14:57:24]: test pybuild-autopkgtest: preparing testbed 251s Reading package lists... 251s Building dependency tree... 251s Reading state information... 252s Starting pkgProblemResolver with broken count: 0 252s Starting 2 pkgProblemResolver with broken count: 0 252s Done 252s The following additional packages will be installed: 252s autoconf automake autopoint autotools-dev binutils-mingw-w64-i686 252s binutils-mingw-w64-x86-64 build-essential cargo cargo-1.80 cmake cmake-data 252s cpp cpp-14 cpp-14-arm-linux-gnueabihf cpp-arm-linux-gnueabihf debhelper 252s debugedit dh-autoreconf dh-python dh-strip-nondeterminism dwz 252s fontconfig-config fonts-dejavu-core fonts-dejavu-mono g++ g++-14 252s g++-14-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc gcc-14 252s gcc-14-arm-linux-gnueabihf gcc-arm-linux-gnueabihf gettext intltool-debian 252s libarchive-zip-perl libasan8 libbrotli-dev libbz2-dev libc-dev-bin libc6-dev 252s libcc1-0 libcrypt-dev libdebhelper-perl libexpat1-dev 252s libfile-stripnondeterminism-perl libfontconfig-dev libfontconfig1 252s libfreetype-dev libfreetype6 libgcc-14-dev libgit2-1.7 libgomp1 253s libhttp-parser2.9 libisl23 libjsoncpp25 libllvm18 libllvm19 libmpc3 libpfm4 253s libpkgconf3 libpng-dev libpython3-all-dev libpython3-dev libpython3.12-dev 253s libpython3.12t64 librhash0 librust-ab-glyph-dev 253s librust-ab-glyph-rasterizer+libm-dev librust-ab-glyph-rasterizer-dev 253s librust-addr2line-dev librust-adler-dev librust-ahash-dev 253s librust-aho-corasick-dev librust-allocator-api2-dev librust-anes-dev 253s librust-anstream-dev librust-anstyle-dev librust-anstyle-parse-dev 253s librust-anstyle-query-dev librust-anyhow-dev librust-approx-dev 253s librust-arbitrary-dev librust-array-init-dev librust-arrayvec-dev 253s librust-async-attributes-dev librust-async-channel-dev 253s librust-async-executor-dev librust-async-fs-dev 253s librust-async-global-executor-dev librust-async-io-dev 253s librust-async-lock-dev librust-async-net-dev librust-async-process-dev 253s librust-async-signal-dev librust-async-std-dev librust-async-task-dev 253s librust-atomic-dev librust-atomic-waker-dev librust-autocfg-dev 253s librust-backtrace-dev librust-base64-dev librust-bit-set+std-dev 253s librust-bit-set-dev librust-bit-vec-dev librust-bitflags-1-dev 253s librust-bitflags-dev librust-bitvec-dev librust-blobby-dev 253s librust-block-buffer-dev librust-blocking-dev librust-bstr-dev 253s librust-bumpalo-dev librust-bytecheck-derive-dev librust-bytecheck-dev 253s librust-bytemuck-derive-dev librust-bytemuck-dev librust-byteorder-dev 253s librust-bytes-dev librust-cast-dev librust-cc-dev librust-cfg-if-0.1-dev 253s librust-cfg-if-dev librust-chrono-dev librust-chrono-tz-build-dev 253s librust-chrono-tz-dev librust-ciborium-dev librust-ciborium-io-dev 253s librust-ciborium-ll-dev librust-clap-builder-dev librust-clap-derive-dev 253s librust-clap-dev librust-clap-lex-dev librust-cmake-dev 253s librust-color-quant-dev librust-colorchoice-dev 253s librust-compiler-builtins+core-dev 253s librust-compiler-builtins+rustc-dep-of-std-dev librust-compiler-builtins-dev 253s librust-concurrent-queue-dev librust-const-cstr-dev librust-const-oid-dev 253s librust-const-random-dev librust-const-random-macro-dev 253s librust-convert-case-dev librust-core-maths-dev librust-cpp-demangle-dev 253s librust-cpufeatures-dev librust-crc32fast-dev librust-criterion-dev 253s librust-critical-section-dev librust-crossbeam-deque-dev 253s librust-crossbeam-epoch+std-dev librust-crossbeam-epoch-dev 253s librust-crossbeam-utils-dev librust-crunchy-dev librust-crypto-common-dev 253s librust-csv-core-dev librust-csv-dev librust-ctor-dev librust-deranged-dev 253s librust-derive-arbitrary-dev librust-derive-more-0.99-dev librust-digest-dev 253s librust-dirs-next-dev librust-dirs-sys-next-dev librust-dlib-dev 253s librust-either-dev librust-env-logger-dev librust-equivalent-dev 253s librust-erased-serde-dev librust-errno-dev librust-eui48-dev 253s librust-event-listener-dev librust-event-listener-strategy-dev 253s librust-eyre+default-dev librust-eyre-dev librust-fallible-iterator-dev 253s librust-fancy-regex-dev librust-fastrand-dev librust-flate2-dev 253s librust-float-ord-dev librust-fnv-dev librust-font-kit-dev 253s librust-freetype-dev librust-freetype-sys-dev librust-funty-dev 253s librust-futures-channel-dev librust-futures-core-dev librust-futures-dev 253s librust-futures-executor-dev librust-futures-io-dev librust-futures-lite-dev 253s librust-futures-macro-dev librust-futures-sink-dev librust-futures-task-dev 253s librust-futures-util-dev librust-generic-array-dev librust-geo-types-dev 253s librust-getrandom-dev librust-ghost-dev librust-gif-dev librust-gimli-dev 253s librust-half-dev librust-hashbrown-dev librust-heck-dev librust-hmac-dev 253s librust-humantime-dev librust-iana-time-zone-dev librust-image-dev 253s librust-indenter-dev librust-indexmap-dev librust-indoc-dev 253s librust-inventory-dev librust-is-terminal-dev librust-itertools-dev 253s librust-itoa-dev librust-jobserver-dev librust-jpeg-decoder-dev 253s librust-js-sys-dev librust-kv-log-macro-dev librust-lazy-static-dev 253s librust-libc-dev librust-libloading-dev librust-libm-dev 253s librust-libwebp-sys-dev librust-libz-sys-dev librust-linux-raw-sys-dev 253s librust-lock-api-dev librust-log-dev librust-md-5-dev librust-md5-asm-dev 253s librust-memchr-dev librust-memmap2-dev librust-memoffset-dev 253s librust-miniz-oxide-dev librust-mio-dev librust-no-panic-dev 253s librust-num-bigint-dev librust-num-complex-dev librust-num-cpus-dev 253s librust-num-integer-dev librust-num-rational-dev librust-num-threads-dev 253s librust-num-traits-dev librust-object-dev librust-once-cell-dev 253s librust-oorandom-dev librust-owned-ttf-parser-dev librust-owning-ref-dev 253s librust-parking-dev librust-parking-lot-core-dev librust-parking-lot-dev 253s librust-parse-zoneinfo-dev librust-pathfinder-geometry-dev 253s librust-pathfinder-simd-dev librust-phf+uncased-dev librust-phf-codegen-dev 253s librust-phf-dev librust-phf-generator-dev librust-phf-shared+uncased-dev 253s librust-phf-shared-dev librust-pin-project-lite-dev librust-pin-utils-dev 253s librust-pkg-config-dev librust-plotters-backend-dev 253s librust-plotters-bitmap-dev librust-plotters-dev librust-plotters-svg-dev 253s librust-png-dev librust-polling-dev librust-portable-atomic-dev 253s librust-postgres-derive-dev librust-postgres-protocol-dev 253s librust-postgres-types-dev librust-powerfmt-dev librust-powerfmt-macros-dev 253s librust-ppv-lite86-dev librust-proc-macro2-dev librust-proptest-dev 253s librust-ptr-meta-derive-dev librust-ptr-meta-dev 253s librust-pure-rust-locales-dev librust-pyo3-build-config-dev librust-pyo3-dev 253s librust-pyo3-ffi-dev librust-pyo3-macros-backend-dev librust-pyo3-macros-dev 253s librust-python3-dll-a-dev librust-qoi-dev librust-quick-error-dev 253s librust-quickcheck-dev librust-quote-dev librust-radium-dev 253s librust-rand-chacha-dev librust-rand-core+getrandom-dev 253s librust-rand-core+serde-dev librust-rand-core+std-dev librust-rand-core-dev 253s librust-rand-dev librust-rand-xorshift-dev librust-rayon-core-dev 253s librust-rayon-dev librust-regex-automata-dev librust-regex-dev 253s librust-regex-syntax-dev librust-rend-dev librust-rkyv-derive-dev 253s librust-rkyv-dev librust-rust-decimal-dev librust-rustc-demangle-dev 253s librust-rustc-hash-dev librust-rustc-std-workspace-core-dev 253s librust-rustc-version-dev librust-rustix-dev 253s librust-rusty-fork+wait-timeout-dev librust-rusty-fork-dev 253s librust-ruzstd-dev librust-ryu-dev librust-same-file-dev 253s librust-scopeguard-dev librust-seahash-dev librust-semver-dev 253s librust-serde-derive-dev librust-serde-dev librust-serde-fmt-dev 253s librust-serde-json-dev librust-serde-test-dev librust-sha1-asm-dev 253s librust-sha1-dev librust-sha2-asm-dev librust-sha2-dev librust-shlex-dev 253s librust-signal-hook-registry-dev librust-simdutf8-dev librust-siphasher-dev 253s librust-slab-dev librust-slog-dev librust-smallvec-dev librust-smol-dev 253s librust-smol-str-dev librust-socket2-dev librust-spin-dev 253s librust-stable-deref-trait-dev librust-static-assertions-dev 253s librust-stringprep-dev librust-strsim-dev librust-subtle-dev 253s librust-sval-buffer-dev librust-sval-derive-dev librust-sval-dev 253s librust-sval-dynamic-dev librust-sval-fmt-dev librust-sval-ref-dev 253s librust-sval-serde-dev librust-syn-1-dev librust-syn-dev librust-tap-dev 253s librust-target-lexicon-dev librust-tempfile-dev librust-termcolor-dev 253s librust-terminal-size-dev librust-tiff-dev librust-time-core-dev 253s librust-time-dev librust-time-macros-dev librust-tiny-keccak-dev 253s librust-tinytemplate-dev librust-tinyvec+tinyvec-macros-dev 253s librust-tinyvec-dev librust-tinyvec-macros-dev librust-tokio-dev 253s librust-tokio-macros-dev librust-tracing-attributes-dev 253s librust-tracing-core-dev librust-tracing-dev librust-traitobject-dev 253s librust-ttf-parser-dev librust-twox-hash-dev librust-typemap-dev 253s librust-typenum-dev librust-unarray-dev librust-uncased-dev 253s librust-unicase-dev librust-unicode-bidi-dev librust-unicode-ident-dev 253s librust-unicode-normalization-dev librust-unicode-segmentation-dev 253s librust-unicode-width-dev librust-unindent-dev librust-unsafe-any-dev 253s librust-utf8parse-dev librust-uuid-dev librust-valuable-derive-dev 253s librust-valuable-dev librust-value-bag-dev librust-value-bag-serde1-dev 253s librust-value-bag-sval2-dev librust-version-check-dev 253s librust-wait-timeout-dev librust-walkdir-dev 253s librust-wasm-bindgen+default-dev librust-wasm-bindgen+spans-dev 253s librust-wasm-bindgen-backend-dev librust-wasm-bindgen-dev 253s librust-wasm-bindgen-macro+spans-dev librust-wasm-bindgen-macro-dev 253s librust-wasm-bindgen-macro-support+spans-dev 253s librust-wasm-bindgen-macro-support-dev librust-wasm-bindgen-shared-dev 253s librust-web-sys-dev librust-webp-dev librust-weezl-dev librust-winapi-dev 253s librust-winapi-i686-pc-windows-gnu-dev librust-winapi-util-dev 253s librust-winapi-x86-64-pc-windows-gnu-dev librust-wyz-dev 253s librust-yeslogic-fontconfig-sys-dev librust-zerocopy-derive-dev 253s librust-zerocopy-dev librust-zeroize-derive-dev librust-zeroize-dev 253s libsharpyuv-dev libsharpyuv0 libstd-rust-1.80 libstd-rust-1.80-dev 253s libstdc++-14-dev libtool libubsan1 libwebp-dev libwebp7 libwebpdecoder3 253s libwebpdemux2 libwebpmux3 linux-libc-dev llvm llvm-19 llvm-19-linker-tools 253s llvm-19-runtime llvm-runtime m4 pkg-config pkgconf pkgconf-bin po-debconf 253s pybuild-plugin-autopkgtest pybuild-plugin-pyproject python3-all 253s python3-build python3-dateutil python3-hypothesis python3-iniconfig 253s python3-installer python3-packaging python3-pluggy python3-pyproject-hooks 253s python3-pytest python3-regex python3-semantic-version 253s python3-setuptools-rust python3-six python3-sortedcontainers 253s python3-tiktoken python3-toml python3-wheel python3.12-dev rpcsvc-proto 253s rustc rustc-1.80 uuid-dev zlib1g-dev 253s Suggested packages: 253s autoconf-archive gnu-standards autoconf-doc cargo-1.80-doc cmake-doc 253s cmake-format elpa-cmake-mode ninja-build cpp-doc gcc-14-locales cpp-14-doc 253s dh-make flit gcc-14-doc gcc-multilib manpages-dev flex bison gdb gcc-doc 253s gdb-arm-linux-gnueabihf gettext-doc libasprintf-dev libgettextpo-dev 253s libc-devtools glibc-doc freetype2-doc librust-adler+compiler-builtins-dev 253s librust-adler+core-dev librust-adler+rustc-dep-of-std-dev 253s librust-backtrace+cpp-demangle-dev librust-backtrace+rustc-serialize-dev 253s librust-backtrace+serde-dev librust-backtrace+verify-winapi-dev 253s librust-backtrace+winapi-dev librust-bytes+serde-dev 253s librust-cfg-if-0.1+core-dev librust-cfg-if+core-dev 253s librust-compiler-builtins+c-dev gnuplot-nox librust-csv-core+libc-dev 253s librust-either+serde-dev librust-getrandom+compiler-builtins-dev 253s librust-getrandom+core-dev librust-getrandom+rustc-dep-of-std-dev 253s librust-libc+rustc-dep-of-std-dev librust-libc+rustc-std-workspace-core-dev 253s librust-phf+phf-macros-dev librust-phf+serde-dev librust-phf+unicase-dev 253s librust-phf-shared+unicase-dev librust-rand-xorshift+serde-dev 253s librust-rustc-demangle+compiler-builtins-dev librust-rustc-demangle+core-dev 253s librust-rustc-demangle+rustc-dep-of-std-dev librust-ryu+no-panic-dev 253s librust-slog+erased-serde-dev librust-tinyvec+arbitrary-dev 253s librust-tinyvec+serde-dev librust-uncased+serde-dev 253s librust-uncased+with-serde-alloc-dev 253s librust-wasm-bindgen-backend+extra-traits-dev librust-wasm-bindgen+serde-dev 253s librust-wasm-bindgen+serde-serialize-dev librust-wasm-bindgen+serde-json-dev 253s librust-wasm-bindgen+strict-macro-dev 253s librust-wasm-bindgen+xxx-debug-only-print-generated-code-dev 253s librust-wasm-bindgen-macro+strict-macro-dev 253s librust-wasm-bindgen-macro-support+extra-traits-dev librust-weezl+async-dev 253s librust-weezl+futures-dev libstdc++-14-doc libtool-doc gfortran 253s | fortran95-compiler gcj-jdk llvm-19-doc m4-doc libmail-box-perl python3-pip 253s python3-venv python-build-doc python-hypothesis-doc python-installer-doc 253s python-semantic-version-doc python-sortedcontainers-doc llvm-18 lld-18 253s clang-18 253s Recommended packages: 253s bzip2-doc manpages manpages-dev libarchive-cpio-perl libpng-tools libssl3 253s librust-phf+std-dev librust-subtle+default-dev libltdl-dev llvm-19-dev 253s libmail-sendmail-perl python3-click 253s The following NEW packages will be installed: 253s autoconf automake autopkgtest-satdep autopoint autotools-dev 253s binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 build-essential cargo 253s cargo-1.80 cmake cmake-data cpp cpp-14 cpp-14-arm-linux-gnueabihf 253s cpp-arm-linux-gnueabihf debhelper debugedit dh-autoreconf dh-python 253s dh-strip-nondeterminism dwz fontconfig-config fonts-dejavu-core 253s fonts-dejavu-mono g++ g++-14 g++-14-arm-linux-gnueabihf 253s g++-arm-linux-gnueabihf gcc gcc-14 gcc-14-arm-linux-gnueabihf 253s gcc-arm-linux-gnueabihf gettext intltool-debian libarchive-zip-perl libasan8 253s libbrotli-dev libbz2-dev libc-dev-bin libc6-dev libcc1-0 libcrypt-dev 253s libdebhelper-perl libexpat1-dev libfile-stripnondeterminism-perl 253s libfontconfig-dev libfontconfig1 libfreetype-dev libfreetype6 libgcc-14-dev 253s libgit2-1.7 libgomp1 libhttp-parser2.9 libisl23 libjsoncpp25 libllvm18 253s libllvm19 libmpc3 libpfm4 libpkgconf3 libpng-dev libpython3-all-dev 253s libpython3-dev libpython3.12-dev libpython3.12t64 librhash0 253s librust-ab-glyph-dev librust-ab-glyph-rasterizer+libm-dev 253s librust-ab-glyph-rasterizer-dev librust-addr2line-dev librust-adler-dev 253s librust-ahash-dev librust-aho-corasick-dev librust-allocator-api2-dev 253s librust-anes-dev librust-anstream-dev librust-anstyle-dev 253s librust-anstyle-parse-dev librust-anstyle-query-dev librust-anyhow-dev 253s librust-approx-dev librust-arbitrary-dev librust-array-init-dev 253s librust-arrayvec-dev librust-async-attributes-dev librust-async-channel-dev 253s librust-async-executor-dev librust-async-fs-dev 253s librust-async-global-executor-dev librust-async-io-dev 253s librust-async-lock-dev librust-async-net-dev librust-async-process-dev 253s librust-async-signal-dev librust-async-std-dev librust-async-task-dev 253s librust-atomic-dev librust-atomic-waker-dev librust-autocfg-dev 253s librust-backtrace-dev librust-base64-dev librust-bit-set+std-dev 253s librust-bit-set-dev librust-bit-vec-dev librust-bitflags-1-dev 253s librust-bitflags-dev librust-bitvec-dev librust-blobby-dev 253s librust-block-buffer-dev librust-blocking-dev librust-bstr-dev 253s librust-bumpalo-dev librust-bytecheck-derive-dev librust-bytecheck-dev 253s librust-bytemuck-derive-dev librust-bytemuck-dev librust-byteorder-dev 253s librust-bytes-dev librust-cast-dev librust-cc-dev librust-cfg-if-0.1-dev 253s librust-cfg-if-dev librust-chrono-dev librust-chrono-tz-build-dev 253s librust-chrono-tz-dev librust-ciborium-dev librust-ciborium-io-dev 253s librust-ciborium-ll-dev librust-clap-builder-dev librust-clap-derive-dev 253s librust-clap-dev librust-clap-lex-dev librust-cmake-dev 253s librust-color-quant-dev librust-colorchoice-dev 253s librust-compiler-builtins+core-dev 253s librust-compiler-builtins+rustc-dep-of-std-dev librust-compiler-builtins-dev 253s librust-concurrent-queue-dev librust-const-cstr-dev librust-const-oid-dev 253s librust-const-random-dev librust-const-random-macro-dev 253s librust-convert-case-dev librust-core-maths-dev librust-cpp-demangle-dev 253s librust-cpufeatures-dev librust-crc32fast-dev librust-criterion-dev 253s librust-critical-section-dev librust-crossbeam-deque-dev 253s librust-crossbeam-epoch+std-dev librust-crossbeam-epoch-dev 253s librust-crossbeam-utils-dev librust-crunchy-dev librust-crypto-common-dev 253s librust-csv-core-dev librust-csv-dev librust-ctor-dev librust-deranged-dev 253s librust-derive-arbitrary-dev librust-derive-more-0.99-dev librust-digest-dev 253s librust-dirs-next-dev librust-dirs-sys-next-dev librust-dlib-dev 253s librust-either-dev librust-env-logger-dev librust-equivalent-dev 253s librust-erased-serde-dev librust-errno-dev librust-eui48-dev 253s librust-event-listener-dev librust-event-listener-strategy-dev 253s librust-eyre+default-dev librust-eyre-dev librust-fallible-iterator-dev 253s librust-fancy-regex-dev librust-fastrand-dev librust-flate2-dev 253s librust-float-ord-dev librust-fnv-dev librust-font-kit-dev 253s librust-freetype-dev librust-freetype-sys-dev librust-funty-dev 253s librust-futures-channel-dev librust-futures-core-dev librust-futures-dev 253s librust-futures-executor-dev librust-futures-io-dev librust-futures-lite-dev 253s librust-futures-macro-dev librust-futures-sink-dev librust-futures-task-dev 253s librust-futures-util-dev librust-generic-array-dev librust-geo-types-dev 253s librust-getrandom-dev librust-ghost-dev librust-gif-dev librust-gimli-dev 253s librust-half-dev librust-hashbrown-dev librust-heck-dev librust-hmac-dev 253s librust-humantime-dev librust-iana-time-zone-dev librust-image-dev 253s librust-indenter-dev librust-indexmap-dev librust-indoc-dev 253s librust-inventory-dev librust-is-terminal-dev librust-itertools-dev 253s librust-itoa-dev librust-jobserver-dev librust-jpeg-decoder-dev 253s librust-js-sys-dev librust-kv-log-macro-dev librust-lazy-static-dev 253s librust-libc-dev librust-libloading-dev librust-libm-dev 253s librust-libwebp-sys-dev librust-libz-sys-dev librust-linux-raw-sys-dev 253s librust-lock-api-dev librust-log-dev librust-md-5-dev librust-md5-asm-dev 253s librust-memchr-dev librust-memmap2-dev librust-memoffset-dev 253s librust-miniz-oxide-dev librust-mio-dev librust-no-panic-dev 253s librust-num-bigint-dev librust-num-complex-dev librust-num-cpus-dev 253s librust-num-integer-dev librust-num-rational-dev librust-num-threads-dev 253s librust-num-traits-dev librust-object-dev librust-once-cell-dev 253s librust-oorandom-dev librust-owned-ttf-parser-dev librust-owning-ref-dev 253s librust-parking-dev librust-parking-lot-core-dev librust-parking-lot-dev 253s librust-parse-zoneinfo-dev librust-pathfinder-geometry-dev 253s librust-pathfinder-simd-dev librust-phf+uncased-dev librust-phf-codegen-dev 253s librust-phf-dev librust-phf-generator-dev librust-phf-shared+uncased-dev 253s librust-phf-shared-dev librust-pin-project-lite-dev librust-pin-utils-dev 253s librust-pkg-config-dev librust-plotters-backend-dev 253s librust-plotters-bitmap-dev librust-plotters-dev librust-plotters-svg-dev 253s librust-png-dev librust-polling-dev librust-portable-atomic-dev 253s librust-postgres-derive-dev librust-postgres-protocol-dev 253s librust-postgres-types-dev librust-powerfmt-dev librust-powerfmt-macros-dev 253s librust-ppv-lite86-dev librust-proc-macro2-dev librust-proptest-dev 253s librust-ptr-meta-derive-dev librust-ptr-meta-dev 253s librust-pure-rust-locales-dev librust-pyo3-build-config-dev librust-pyo3-dev 253s librust-pyo3-ffi-dev librust-pyo3-macros-backend-dev librust-pyo3-macros-dev 253s librust-python3-dll-a-dev librust-qoi-dev librust-quick-error-dev 253s librust-quickcheck-dev librust-quote-dev librust-radium-dev 253s librust-rand-chacha-dev librust-rand-core+getrandom-dev 253s librust-rand-core+serde-dev librust-rand-core+std-dev librust-rand-core-dev 253s librust-rand-dev librust-rand-xorshift-dev librust-rayon-core-dev 253s librust-rayon-dev librust-regex-automata-dev librust-regex-dev 253s librust-regex-syntax-dev librust-rend-dev librust-rkyv-derive-dev 253s librust-rkyv-dev librust-rust-decimal-dev librust-rustc-demangle-dev 253s librust-rustc-hash-dev librust-rustc-std-workspace-core-dev 253s librust-rustc-version-dev librust-rustix-dev 253s librust-rusty-fork+wait-timeout-dev librust-rusty-fork-dev 253s librust-ruzstd-dev librust-ryu-dev librust-same-file-dev 253s librust-scopeguard-dev librust-seahash-dev librust-semver-dev 253s librust-serde-derive-dev librust-serde-dev librust-serde-fmt-dev 253s librust-serde-json-dev librust-serde-test-dev librust-sha1-asm-dev 253s librust-sha1-dev librust-sha2-asm-dev librust-sha2-dev librust-shlex-dev 253s librust-signal-hook-registry-dev librust-simdutf8-dev librust-siphasher-dev 253s librust-slab-dev librust-slog-dev librust-smallvec-dev librust-smol-dev 253s librust-smol-str-dev librust-socket2-dev librust-spin-dev 253s librust-stable-deref-trait-dev librust-static-assertions-dev 253s librust-stringprep-dev librust-strsim-dev librust-subtle-dev 253s librust-sval-buffer-dev librust-sval-derive-dev librust-sval-dev 253s librust-sval-dynamic-dev librust-sval-fmt-dev librust-sval-ref-dev 253s librust-sval-serde-dev librust-syn-1-dev librust-syn-dev librust-tap-dev 253s librust-target-lexicon-dev librust-tempfile-dev librust-termcolor-dev 253s librust-terminal-size-dev librust-tiff-dev librust-time-core-dev 253s librust-time-dev librust-time-macros-dev librust-tiny-keccak-dev 253s librust-tinytemplate-dev librust-tinyvec+tinyvec-macros-dev 253s librust-tinyvec-dev librust-tinyvec-macros-dev librust-tokio-dev 253s librust-tokio-macros-dev librust-tracing-attributes-dev 253s librust-tracing-core-dev librust-tracing-dev librust-traitobject-dev 253s librust-ttf-parser-dev librust-twox-hash-dev librust-typemap-dev 253s librust-typenum-dev librust-unarray-dev librust-uncased-dev 253s librust-unicase-dev librust-unicode-bidi-dev librust-unicode-ident-dev 253s librust-unicode-normalization-dev librust-unicode-segmentation-dev 253s librust-unicode-width-dev librust-unindent-dev librust-unsafe-any-dev 253s librust-utf8parse-dev librust-uuid-dev librust-valuable-derive-dev 253s librust-valuable-dev librust-value-bag-dev librust-value-bag-serde1-dev 253s librust-value-bag-sval2-dev librust-version-check-dev 253s librust-wait-timeout-dev librust-walkdir-dev 253s librust-wasm-bindgen+default-dev librust-wasm-bindgen+spans-dev 253s librust-wasm-bindgen-backend-dev librust-wasm-bindgen-dev 253s librust-wasm-bindgen-macro+spans-dev librust-wasm-bindgen-macro-dev 253s librust-wasm-bindgen-macro-support+spans-dev 253s librust-wasm-bindgen-macro-support-dev librust-wasm-bindgen-shared-dev 253s librust-web-sys-dev librust-webp-dev librust-weezl-dev librust-winapi-dev 253s librust-winapi-i686-pc-windows-gnu-dev librust-winapi-util-dev 253s librust-winapi-x86-64-pc-windows-gnu-dev librust-wyz-dev 253s librust-yeslogic-fontconfig-sys-dev librust-zerocopy-derive-dev 253s librust-zerocopy-dev librust-zeroize-derive-dev librust-zeroize-dev 253s libsharpyuv-dev libsharpyuv0 libstd-rust-1.80 libstd-rust-1.80-dev 253s libstdc++-14-dev libtool libubsan1 libwebp-dev libwebp7 libwebpdecoder3 253s libwebpdemux2 libwebpmux3 linux-libc-dev llvm llvm-19 llvm-19-linker-tools 253s llvm-19-runtime llvm-runtime m4 pkg-config pkgconf pkgconf-bin po-debconf 253s pybuild-plugin-autopkgtest pybuild-plugin-pyproject python3-all 253s python3-build python3-dateutil python3-hypothesis python3-iniconfig 253s python3-installer python3-packaging python3-pluggy python3-pyproject-hooks 253s python3-pytest python3-regex python3-semantic-version 253s python3-setuptools-rust python3-six python3-sortedcontainers 253s python3-tiktoken python3-toml python3-wheel python3.12-dev rpcsvc-proto 253s rustc rustc-1.80 uuid-dev zlib1g-dev 253s 0 upgraded, 472 newly installed, 0 to remove and 0 not upgraded. 253s Need to get 247 MB/247 MB of archives. 253s After this operation, 957 MB of additional disk space will be used. 253s Get:1 /tmp/autopkgtest.hefNha/1-autopkgtest-satdep.deb autopkgtest-satdep armhf 0 [864 B] 253s Get:2 http://ftpmaster.internal/ubuntu plucky/main armhf m4 armhf 1.4.19-4build1 [235 kB] 253s Get:3 http://ftpmaster.internal/ubuntu plucky/main armhf autoconf all 2.72-3 [382 kB] 253s Get:4 http://ftpmaster.internal/ubuntu plucky/main armhf autotools-dev all 20220109.1 [44.9 kB] 253s Get:5 http://ftpmaster.internal/ubuntu plucky/main armhf automake all 1:1.16.5-1.3ubuntu1 [558 kB] 253s Get:6 http://ftpmaster.internal/ubuntu plucky/main armhf autopoint all 0.22.5-2 [616 kB] 253s Get:7 http://ftpmaster.internal/ubuntu plucky/main armhf libc-dev-bin armhf 2.40-1ubuntu3 [19.2 kB] 253s Get:8 http://ftpmaster.internal/ubuntu plucky/main armhf linux-libc-dev armhf 6.11.0-8.8 [1628 kB] 254s Get:9 http://ftpmaster.internal/ubuntu plucky/main armhf libcrypt-dev armhf 1:4.4.36-4build1 [120 kB] 254s Get:10 http://ftpmaster.internal/ubuntu plucky/main armhf rpcsvc-proto armhf 1.4.2-0ubuntu7 [62.2 kB] 254s Get:11 http://ftpmaster.internal/ubuntu plucky/main armhf libc6-dev armhf 2.40-1ubuntu3 [1370 kB] 254s Get:12 http://ftpmaster.internal/ubuntu plucky/main armhf libisl23 armhf 0.27-1 [546 kB] 254s Get:13 http://ftpmaster.internal/ubuntu plucky/main armhf libmpc3 armhf 1.3.1-1build2 [47.1 kB] 254s Get:14 http://ftpmaster.internal/ubuntu plucky/main armhf cpp-14-arm-linux-gnueabihf armhf 14.2.0-7ubuntu1 [9219 kB] 254s Get:15 http://ftpmaster.internal/ubuntu plucky/main armhf cpp-14 armhf 14.2.0-7ubuntu1 [1030 B] 254s Get:16 http://ftpmaster.internal/ubuntu plucky/main armhf cpp-arm-linux-gnueabihf armhf 4:14.1.0-2ubuntu1 [5464 B] 254s Get:17 http://ftpmaster.internal/ubuntu plucky/main armhf cpp armhf 4:14.1.0-2ubuntu1 [22.4 kB] 254s Get:18 http://ftpmaster.internal/ubuntu plucky/main armhf libcc1-0 armhf 14.2.0-7ubuntu1 [43.3 kB] 254s Get:19 http://ftpmaster.internal/ubuntu plucky/main armhf libgomp1 armhf 14.2.0-7ubuntu1 [125 kB] 254s Get:20 http://ftpmaster.internal/ubuntu plucky/main armhf libasan8 armhf 14.2.0-7ubuntu1 [2901 kB] 254s Get:21 http://ftpmaster.internal/ubuntu plucky/main armhf libubsan1 armhf 14.2.0-7ubuntu1 [1150 kB] 254s Get:22 http://ftpmaster.internal/ubuntu plucky/main armhf libgcc-14-dev armhf 14.2.0-7ubuntu1 [897 kB] 254s Get:23 http://ftpmaster.internal/ubuntu plucky/main armhf gcc-14-arm-linux-gnueabihf armhf 14.2.0-7ubuntu1 [18.0 MB] 255s Get:24 http://ftpmaster.internal/ubuntu plucky/main armhf gcc-14 armhf 14.2.0-7ubuntu1 [495 kB] 255s Get:25 http://ftpmaster.internal/ubuntu plucky/main armhf gcc-arm-linux-gnueabihf armhf 4:14.1.0-2ubuntu1 [1222 B] 255s Get:26 http://ftpmaster.internal/ubuntu plucky/main armhf gcc armhf 4:14.1.0-2ubuntu1 [5002 B] 255s Get:27 http://ftpmaster.internal/ubuntu plucky/main armhf libstdc++-14-dev armhf 14.2.0-7ubuntu1 [2567 kB] 255s Get:28 http://ftpmaster.internal/ubuntu plucky/main armhf g++-14-arm-linux-gnueabihf armhf 14.2.0-7ubuntu1 [10.5 MB] 255s Get:29 http://ftpmaster.internal/ubuntu plucky/main armhf g++-14 armhf 14.2.0-7ubuntu1 [19.8 kB] 255s Get:30 http://ftpmaster.internal/ubuntu plucky/main armhf g++-arm-linux-gnueabihf armhf 4:14.1.0-2ubuntu1 [968 B] 255s Get:31 http://ftpmaster.internal/ubuntu plucky/main armhf g++ armhf 4:14.1.0-2ubuntu1 [1084 B] 255s Get:32 http://ftpmaster.internal/ubuntu plucky/main armhf build-essential armhf 12.10ubuntu1 [4928 B] 255s Get:33 http://ftpmaster.internal/ubuntu plucky/main armhf libhttp-parser2.9 armhf 2.9.4-6build1 [21.1 kB] 255s Get:34 http://ftpmaster.internal/ubuntu plucky/main armhf libgit2-1.7 armhf 1.7.2+ds-1ubuntu3 [444 kB] 255s Get:35 http://ftpmaster.internal/ubuntu plucky/main armhf libllvm18 armhf 1:18.1.8-11 [26.6 MB] 256s Get:36 http://ftpmaster.internal/ubuntu plucky/main armhf libstd-rust-1.80 armhf 1.80.1+dfsg0ubuntu1-0ubuntu1 [19.7 MB] 256s Get:37 http://ftpmaster.internal/ubuntu plucky/main armhf libstd-rust-1.80-dev armhf 1.80.1+dfsg0ubuntu1-0ubuntu1 [39.9 MB] 257s Get:38 http://ftpmaster.internal/ubuntu plucky/main armhf rustc-1.80 armhf 1.80.1+dfsg0ubuntu1-0ubuntu1 [3081 kB] 258s Get:39 http://ftpmaster.internal/ubuntu plucky/main armhf cargo-1.80 armhf 1.80.1+dfsg0ubuntu1-0ubuntu1 [5646 kB] 258s Get:40 http://ftpmaster.internal/ubuntu plucky/main armhf libjsoncpp25 armhf 1.9.5-6build1 [75.3 kB] 258s Get:41 http://ftpmaster.internal/ubuntu plucky/main armhf librhash0 armhf 1.4.3-3build1 [143 kB] 258s Get:42 http://ftpmaster.internal/ubuntu plucky/main armhf cmake-data all 3.30.3-1 [2246 kB] 258s Get:43 http://ftpmaster.internal/ubuntu plucky/main armhf cmake armhf 3.30.3-1 [6319 kB] 258s Get:44 http://ftpmaster.internal/ubuntu plucky/main armhf libdebhelper-perl all 13.20ubuntu1 [94.2 kB] 258s Get:45 http://ftpmaster.internal/ubuntu plucky/main armhf libtool all 2.4.7-7build1 [166 kB] 258s Get:46 http://ftpmaster.internal/ubuntu plucky/main armhf dh-autoreconf all 20 [16.1 kB] 258s Get:47 http://ftpmaster.internal/ubuntu plucky/main armhf libarchive-zip-perl all 1.68-1 [90.2 kB] 258s Get:48 http://ftpmaster.internal/ubuntu plucky/main armhf libfile-stripnondeterminism-perl all 1.14.0-1 [20.1 kB] 258s Get:49 http://ftpmaster.internal/ubuntu plucky/main armhf dh-strip-nondeterminism all 1.14.0-1 [5058 B] 258s Get:50 http://ftpmaster.internal/ubuntu plucky/main armhf debugedit armhf 1:5.1-1 [46.5 kB] 258s Get:51 http://ftpmaster.internal/ubuntu plucky/main armhf dwz armhf 0.15-1build6 [116 kB] 258s Get:52 http://ftpmaster.internal/ubuntu plucky/main armhf gettext armhf 0.22.5-2 [995 kB] 258s Get:53 http://ftpmaster.internal/ubuntu plucky/main armhf intltool-debian all 0.35.0+20060710.6 [23.2 kB] 258s Get:54 http://ftpmaster.internal/ubuntu plucky/main armhf po-debconf all 1.0.21+nmu1 [233 kB] 258s Get:55 http://ftpmaster.internal/ubuntu plucky/main armhf debhelper all 13.20ubuntu1 [893 kB] 258s Get:56 http://ftpmaster.internal/ubuntu plucky/universe armhf dh-python all 6.20240824 [112 kB] 258s Get:57 http://ftpmaster.internal/ubuntu plucky/main armhf fonts-dejavu-mono all 2.37-8 [502 kB] 258s Get:58 http://ftpmaster.internal/ubuntu plucky/main armhf fonts-dejavu-core all 2.37-8 [835 kB] 258s Get:59 http://ftpmaster.internal/ubuntu plucky/main armhf fontconfig-config armhf 2.15.0-1.1ubuntu2 [37.4 kB] 258s Get:60 http://ftpmaster.internal/ubuntu plucky/main armhf libbrotli-dev armhf 1.1.0-2build2 [337 kB] 258s Get:61 http://ftpmaster.internal/ubuntu plucky/main armhf libbz2-dev armhf 1.0.8-6 [30.9 kB] 258s Get:62 http://ftpmaster.internal/ubuntu plucky/main armhf libexpat1-dev armhf 2.6.2-2 [121 kB] 258s Get:63 http://ftpmaster.internal/ubuntu plucky/main armhf libfreetype6 armhf 2.13.3+dfsg-1 [330 kB] 258s Get:64 http://ftpmaster.internal/ubuntu plucky/main armhf libfontconfig1 armhf 2.15.0-1.1ubuntu2 [113 kB] 258s Get:65 http://ftpmaster.internal/ubuntu plucky/main armhf zlib1g-dev armhf 1:1.3.dfsg+really1.3.1-1ubuntu1 [880 kB] 258s Get:66 http://ftpmaster.internal/ubuntu plucky/main armhf libpng-dev armhf 1.6.44-1 [249 kB] 258s Get:67 http://ftpmaster.internal/ubuntu plucky/main armhf libfreetype-dev armhf 2.13.3+dfsg-1 [509 kB] 258s Get:68 http://ftpmaster.internal/ubuntu plucky/main armhf uuid-dev armhf 2.40.2-1ubuntu1 [51.0 kB] 258s Get:69 http://ftpmaster.internal/ubuntu plucky/main armhf libpkgconf3 armhf 1.8.1-3ubuntu1 [26.6 kB] 258s Get:70 http://ftpmaster.internal/ubuntu plucky/main armhf pkgconf-bin armhf 1.8.1-3ubuntu1 [21.2 kB] 258s Get:71 http://ftpmaster.internal/ubuntu plucky/main armhf pkgconf armhf 1.8.1-3ubuntu1 [16.8 kB] 258s Get:72 http://ftpmaster.internal/ubuntu plucky/main armhf libfontconfig-dev armhf 2.15.0-1.1ubuntu2 [143 kB] 258s Get:73 http://ftpmaster.internal/ubuntu plucky/main armhf libllvm19 armhf 1:19.1.2-1ubuntu1 [27.8 MB] 259s Get:74 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3.12t64 armhf 3.12.7-1 [2076 kB] 259s Get:75 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3.12-dev armhf 3.12.7-1 [4344 kB] 260s Get:76 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3-dev armhf 3.12.6-0ubuntu1 [10.2 kB] 260s Get:77 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3-all-dev armhf 3.12.6-0ubuntu1 [914 B] 260s Get:78 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ab-glyph-rasterizer-dev armhf 0.1.7-1 [12.2 kB] 260s Get:79 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-libm-dev armhf 0.2.8-1 [101 kB] 260s Get:80 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ab-glyph-rasterizer+libm-dev armhf 0.1.7-1 [1062 B] 260s Get:81 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-core-maths-dev armhf 0.1.0-2 [7944 B] 260s Get:82 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ttf-parser-dev armhf 0.24.1-1 [148 kB] 260s Get:83 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-owned-ttf-parser-dev armhf 0.24.0-1 [129 kB] 260s Get:84 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ab-glyph-dev armhf 0.2.28-1 [20.7 kB] 260s Get:85 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-cfg-if-dev armhf 1.0.0-1 [10.5 kB] 260s Get:86 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-cpp-demangle-dev armhf 0.4.0-1 [66.1 kB] 260s Get:87 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-fallible-iterator-dev armhf 0.3.0-2 [20.3 kB] 260s Get:88 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-unicode-ident-dev armhf 1.0.12-1 [37.7 kB] 260s Get:89 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-proc-macro2-dev armhf 1.0.86-1 [44.8 kB] 260s Get:90 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-quote-dev armhf 1.0.37-1 [29.5 kB] 260s Get:91 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-syn-dev armhf 2.0.77-1 [214 kB] 260s Get:92 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-derive-arbitrary-dev armhf 1.3.2-1 [12.3 kB] 260s Get:93 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-arbitrary-dev armhf 1.3.2-1 [31.4 kB] 260s Get:94 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-equivalent-dev armhf 1.0.1-1 [8240 B] 260s Get:95 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-critical-section-dev armhf 1.1.3-1 [20.5 kB] 260s Get:96 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-serde-derive-dev armhf 1.0.210-1 [50.1 kB] 260s Get:97 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-serde-dev armhf 1.0.210-2 [66.4 kB] 260s Get:98 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-portable-atomic-dev armhf 1.4.3-2 [99.7 kB] 260s Get:99 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-libc-dev armhf 0.2.155-1 [367 kB] 260s Get:100 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-getrandom-dev armhf 0.2.12-1 [36.4 kB] 260s Get:101 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-smallvec-dev armhf 1.13.2-1 [35.5 kB] 260s Get:102 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-parking-lot-core-dev armhf 0.9.10-1 [32.6 kB] 260s Get:103 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-once-cell-dev armhf 1.19.0-1 [31.7 kB] 260s Get:104 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-crunchy-dev armhf 0.2.2-1 [5336 B] 260s Get:105 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tiny-keccak-dev armhf 2.0.2-1 [20.9 kB] 260s Get:106 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-const-random-macro-dev armhf 0.1.16-2 [10.5 kB] 260s Get:107 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-const-random-dev armhf 0.1.17-2 [8588 B] 260s Get:108 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-version-check-dev armhf 0.9.5-1 [16.9 kB] 260s Get:109 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-byteorder-dev armhf 1.5.0-1 [22.4 kB] 260s Get:110 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-zerocopy-derive-dev armhf 0.7.32-2 [29.7 kB] 260s Get:111 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-zerocopy-dev armhf 0.7.32-1 [116 kB] 260s Get:112 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ahash-dev all 0.8.11-8 [37.9 kB] 260s Get:113 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-allocator-api2-dev armhf 0.2.16-1 [54.8 kB] 260s Get:114 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-compiler-builtins-dev armhf 0.1.101-1 [156 kB] 260s Get:115 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-either-dev armhf 1.13.0-1 [20.2 kB] 260s Get:116 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-crossbeam-utils-dev armhf 0.8.19-1 [41.1 kB] 260s Get:117 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-crossbeam-epoch-dev armhf 0.9.18-1 [42.3 kB] 260s Get:118 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-crossbeam-epoch+std-dev armhf 0.9.18-1 [1128 B] 260s Get:119 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-crossbeam-deque-dev armhf 0.8.5-1 [22.4 kB] 260s Get:120 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rayon-core-dev armhf 1.12.1-1 [63.7 kB] 260s Get:121 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rayon-dev armhf 1.10.0-1 [149 kB] 260s Get:122 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rustc-std-workspace-core-dev armhf 1.0.0-1 [3020 B] 260s Get:123 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-hashbrown-dev armhf 0.14.5-5 [110 kB] 260s Get:124 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-indexmap-dev armhf 2.2.6-1 [66.7 kB] 260s Get:125 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-stable-deref-trait-dev armhf 1.2.0-1 [9794 B] 260s Get:126 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-gimli-dev armhf 0.28.1-2 [209 kB] 260s Get:127 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-memmap2-dev armhf 0.9.3-1 [30.8 kB] 260s Get:128 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-crc32fast-dev armhf 1.4.2-1 [39.8 kB] 260s Get:129 http://ftpmaster.internal/ubuntu plucky/main armhf pkg-config armhf 1.8.1-3ubuntu1 [7400 B] 260s Get:130 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pkg-config-dev armhf 0.3.27-1 [21.5 kB] 260s Get:131 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-libz-sys-dev armhf 1.1.20-1 [19.8 kB] 260s Get:132 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-adler-dev armhf 1.0.2-2 [15.3 kB] 260s Get:133 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-miniz-oxide-dev armhf 0.7.1-1 [51.5 kB] 261s Get:134 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-flate2-dev armhf 1.0.27-2 [64.9 kB] 261s Get:135 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sval-derive-dev armhf 2.6.1-2 [11.0 kB] 261s Get:136 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sval-dev armhf 2.6.1-2 [28.0 kB] 261s Get:137 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sval-ref-dev armhf 2.6.1-1 [8936 B] 261s Get:138 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-erased-serde-dev armhf 0.3.31-1 [22.7 kB] 261s Get:139 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-serde-fmt-dev all 1.0.3-3 [6956 B] 261s Get:140 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-syn-1-dev armhf 1.0.109-2 [188 kB] 261s Get:141 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-no-panic-dev armhf 0.1.13-1 [11.3 kB] 261s Get:142 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-itoa-dev armhf 1.0.9-1 [13.1 kB] 261s Get:143 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ryu-dev armhf 1.0.15-1 [41.7 kB] 261s Get:144 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-serde-json-dev armhf 1.0.128-1 [128 kB] 261s Get:145 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-serde-test-dev armhf 1.0.171-1 [20.6 kB] 261s Get:146 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-value-bag-serde1-dev armhf 1.9.0-1 [7820 B] 261s Get:147 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sval-buffer-dev armhf 2.6.1-1 [16.8 kB] 261s Get:148 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sval-dynamic-dev armhf 2.6.1-1 [9542 B] 261s Get:149 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sval-fmt-dev armhf 2.6.1-1 [12.0 kB] 261s Get:150 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sval-serde-dev armhf 2.6.1-1 [13.2 kB] 261s Get:151 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-value-bag-sval2-dev armhf 1.9.0-1 [7862 B] 261s Get:152 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-value-bag-dev armhf 1.9.0-1 [37.6 kB] 261s Get:153 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-log-dev armhf 0.4.22-1 [43.0 kB] 261s Get:154 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-memchr-dev armhf 2.7.1-1 [71.6 kB] 261s Get:155 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ppv-lite86-dev armhf 0.2.16-1 [21.9 kB] 261s Get:156 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rand-core-dev armhf 0.6.4-2 [23.8 kB] 261s Get:157 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rand-chacha-dev armhf 0.3.1-2 [16.9 kB] 261s Get:158 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rand-core+getrandom-dev armhf 0.6.4-2 [1052 B] 261s Get:159 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rand-core+serde-dev armhf 0.6.4-2 [1108 B] 261s Get:160 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rand-core+std-dev armhf 0.6.4-2 [1052 B] 261s Get:161 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rand-dev armhf 0.8.5-1 [77.5 kB] 261s Get:162 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-unicode-segmentation-dev armhf 1.11.0-1 [74.2 kB] 261s Get:163 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-convert-case-dev armhf 0.6.0-2 [19.4 kB] 261s Get:164 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-semver-dev armhf 1.0.21-1 [30.3 kB] 261s Get:165 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rustc-version-dev armhf 0.4.0-1 [13.8 kB] 261s Get:166 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-derive-more-0.99-dev armhf 0.99.18-1 [49.9 kB] 261s Get:167 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-cfg-if-0.1-dev armhf 0.1.10-2 [10.2 kB] 261s Get:168 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-blobby-dev armhf 0.3.1-1 [11.3 kB] 261s Get:169 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-typenum-dev armhf 1.17.0-2 [41.2 kB] 261s Get:170 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-zeroize-derive-dev armhf 1.4.2-1 [12.7 kB] 261s Get:171 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-zeroize-dev armhf 1.8.1-1 [21.6 kB] 261s Get:172 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-generic-array-dev armhf 0.14.7-1 [16.9 kB] 261s Get:173 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-block-buffer-dev armhf 0.10.2-2 [12.2 kB] 261s Get:174 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-const-oid-dev armhf 0.9.3-1 [40.9 kB] 261s Get:175 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-crypto-common-dev armhf 0.1.6-1 [10.5 kB] 261s Get:176 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-subtle-dev armhf 2.6.1-1 [16.1 kB] 261s Get:177 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-digest-dev armhf 0.10.7-2 [20.9 kB] 261s Get:178 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-static-assertions-dev armhf 1.1.0-1 [19.0 kB] 261s Get:179 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-twox-hash-dev armhf 1.6.3-1 [21.6 kB] 261s Get:180 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ruzstd-dev armhf 0.5.0-1 [44.6 kB] 261s Get:181 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-object-dev armhf 0.32.2-1 [228 kB] 261s Get:182 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rustc-demangle-dev armhf 0.1.21-1 [27.7 kB] 261s Get:183 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-addr2line-dev armhf 0.21.0-2 [36.4 kB] 261s Get:184 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-aho-corasick-dev armhf 1.1.3-1 [146 kB] 261s Get:185 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bitflags-1-dev armhf 1.3.2-5 [25.3 kB] 261s Get:186 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-anes-dev armhf 0.1.6-1 [21.1 kB] 261s Get:187 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-anstyle-dev armhf 1.0.8-1 [16.7 kB] 261s Get:188 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-arrayvec-dev armhf 0.7.4-2 [29.9 kB] 261s Get:189 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-utf8parse-dev armhf 0.2.1-1 [15.0 kB] 261s Get:190 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-anstyle-parse-dev armhf 0.2.1-1 [17.1 kB] 261s Get:191 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-anstyle-query-dev armhf 1.0.0-1 [9768 B] 261s Get:192 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-colorchoice-dev armhf 1.0.0-1 [8336 B] 261s Get:193 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-anstream-dev armhf 0.6.7-1 [23.5 kB] 261s Get:194 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-jobserver-dev armhf 0.1.32-1 [29.1 kB] 261s Get:195 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-shlex-dev armhf 1.3.0-1 [20.1 kB] 261s Get:196 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-cc-dev armhf 1.1.14-1 [73.6 kB] 261s Get:197 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-backtrace-dev armhf 0.3.69-2 [69.9 kB] 261s Get:198 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-anyhow-dev armhf 1.0.86-1 [44.3 kB] 261s Get:199 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bytecheck-derive-dev armhf 0.6.12-1 [7086 B] 261s Get:200 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ptr-meta-derive-dev armhf 0.1.4-1 [3964 B] 261s Get:201 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ptr-meta-dev armhf 0.1.4-1 [7342 B] 261s Get:202 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-simdutf8-dev armhf 0.1.4-4 [27.2 kB] 261s Get:203 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bytemuck-derive-dev armhf 1.5.0-2 [18.7 kB] 262s Get:204 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bytemuck-dev armhf 1.14.0-1 [42.7 kB] 262s Get:205 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-atomic-dev armhf 0.6.0-1 [15.5 kB] 262s Get:206 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-md5-asm-dev armhf 0.5.0-2 [7512 B] 262s Get:207 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-md-5-dev armhf 0.10.6-1 [17.5 kB] 262s Get:208 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-cpufeatures-dev armhf 0.2.11-1 [14.9 kB] 262s Get:209 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sha1-asm-dev armhf 0.5.1-2 [8058 B] 262s Get:210 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sha1-dev armhf 0.10.6-1 [16.0 kB] 262s Get:211 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-slog-dev armhf 2.7.0-1 [44.0 kB] 262s Get:212 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-uuid-dev armhf 1.10.0-1 [44.2 kB] 262s Get:213 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bytecheck-dev armhf 0.6.12-1 [10.2 kB] 262s Get:214 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-autocfg-dev armhf 1.1.0-1 [15.1 kB] 262s Get:215 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-num-traits-dev armhf 0.2.19-2 [46.2 kB] 262s Get:216 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-funty-dev armhf 2.0.0-1 [13.8 kB] 262s Get:217 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-radium-dev armhf 1.1.0-1 [14.9 kB] 262s Get:218 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tap-dev armhf 1.0.1-1 [12.7 kB] 262s Get:219 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-traitobject-dev armhf 0.1.0-1 [4540 B] 262s Get:220 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-unsafe-any-dev armhf 0.4.2-2 [4622 B] 262s Get:221 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-typemap-dev armhf 0.3.3-2 [6724 B] 262s Get:222 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wyz-dev armhf 0.5.1-1 [19.7 kB] 262s Get:223 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bitvec-dev armhf 1.0.1-1 [179 kB] 262s Get:224 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bytes-dev armhf 1.5.0-1 [51.5 kB] 262s Get:225 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rend-dev armhf 0.4.0-1 [10.3 kB] 262s Get:226 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rkyv-derive-dev armhf 0.7.44-1 [17.5 kB] 262s Get:227 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-seahash-dev armhf 4.1.0-1 [25.1 kB] 262s Get:228 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-smol-str-dev armhf 0.2.0-1 [15.2 kB] 262s Get:229 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tinyvec-dev armhf 1.6.0-2 [37.7 kB] 262s Get:230 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tinyvec-macros-dev armhf 0.1.0-1 [3852 B] 262s Get:231 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tinyvec+tinyvec-macros-dev armhf 1.6.0-2 [1124 B] 262s Get:232 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rkyv-dev armhf 0.7.44-1 [94.4 kB] 262s Get:233 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-num-complex-dev armhf 0.4.6-2 [30.8 kB] 262s Get:234 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-approx-dev armhf 0.5.1-1 [16.0 kB] 262s Get:235 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-array-init-dev armhf 2.0.1-1 [12.3 kB] 262s Get:236 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-attributes-dev all 1.1.2-6 [6756 B] 262s Get:237 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-concurrent-queue-dev armhf 2.5.0-4 [23.9 kB] 262s Get:238 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-parking-dev armhf 2.2.0-1 [11.6 kB] 262s Get:239 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pin-project-lite-dev armhf 0.2.13-1 [30.2 kB] 262s Get:240 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-event-listener-dev all 5.3.1-8 [29.6 kB] 262s Get:241 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-event-listener-strategy-dev armhf 0.5.2-3 [12.6 kB] 262s Get:242 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-futures-core-dev armhf 0.3.30-1 [16.7 kB] 262s Get:243 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-channel-dev all 2.3.1-8 [13.1 kB] 262s Get:244 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-task-dev all 4.7.1-3 [29.4 kB] 262s Get:245 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-fastrand-dev armhf 2.1.1-1 [17.8 kB] 262s Get:246 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-futures-io-dev armhf 0.3.30-2 [11.0 kB] 262s Get:247 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-futures-lite-dev armhf 2.3.0-2 [38.6 kB] 262s Get:248 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-slab-dev armhf 0.4.9-1 [21.2 kB] 262s Get:249 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-executor-dev all 1.13.1-1 [18.7 kB] 262s Get:250 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-lock-dev all 3.4.0-4 [29.3 kB] 262s Get:251 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-atomic-waker-dev armhf 1.1.2-1 [14.3 kB] 262s Get:252 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tracing-attributes-dev armhf 0.1.27-1 [33.3 kB] 262s Get:253 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-valuable-derive-dev armhf 0.1.0-1 [5942 B] 262s Get:254 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-valuable-dev armhf 0.1.0-4 [23.5 kB] 262s Get:255 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tracing-core-dev armhf 0.1.32-1 [53.8 kB] 262s Get:256 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tracing-dev armhf 0.1.40-1 [69.5 kB] 262s Get:257 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-blocking-dev all 1.6.1-5 [17.5 kB] 262s Get:258 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-fs-dev all 2.1.2-4 [15.3 kB] 262s Get:259 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bitflags-dev armhf 2.6.0-1 [41.1 kB] 262s Get:260 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-compiler-builtins+core-dev armhf 0.1.101-1 [1090 B] 262s Get:261 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-compiler-builtins+rustc-dep-of-std-dev armhf 0.1.101-1 [1104 B] 263s Get:262 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-errno-dev armhf 0.3.8-1 [13.0 kB] 263s Get:263 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-linux-raw-sys-dev armhf 0.4.14-1 [138 kB] 263s Get:264 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rustix-dev armhf 0.38.32-1 [274 kB] 263s Get:265 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-polling-dev armhf 3.4.0-1 [47.8 kB] 263s Get:266 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-io-dev armhf 2.3.3-4 [41.0 kB] 263s Get:267 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-mio-dev armhf 1.0.2-1 [85.6 kB] 263s Get:268 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-owning-ref-dev armhf 0.4.1-1 [13.7 kB] 263s Get:269 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-scopeguard-dev armhf 1.2.0-1 [13.3 kB] 263s Get:270 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-lock-api-dev armhf 0.4.11-1 [29.0 kB] 263s Get:271 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-parking-lot-dev armhf 0.12.1-2build1 [37.8 kB] 263s Get:272 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-signal-hook-registry-dev armhf 1.4.0-1 [19.2 kB] 263s Get:273 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-socket2-dev armhf 0.5.7-1 [48.3 kB] 263s Get:274 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tokio-macros-dev armhf 2.4.0-2 [14.0 kB] 263s Get:275 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tokio-dev armhf 1.39.3-3 [561 kB] 263s Get:276 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-global-executor-dev armhf 2.4.1-5 [14.6 kB] 263s Get:277 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-net-dev all 2.0.0-4 [14.6 kB] 263s Get:278 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-signal-dev armhf 0.2.10-1 [16.0 kB] 263s Get:279 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-process-dev all 2.3.0-1 [21.2 kB] 263s Get:280 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-kv-log-macro-dev all 1.0.8-4 [7290 B] 263s Get:281 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pin-utils-dev armhf 0.1.0-1 [9340 B] 263s Get:282 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-async-std-dev all 1.12.0-22 [168 kB] 263s Get:283 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-base64-dev armhf 0.21.7-1 [65.1 kB] 263s Get:284 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bit-vec-dev armhf 0.6.3-1 [21.1 kB] 263s Get:285 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bit-set-dev armhf 0.5.2-1 [15.7 kB] 263s Get:286 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bit-set+std-dev armhf 0.5.2-1 [1084 B] 263s Get:287 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-regex-syntax-dev armhf 0.8.2-1 [200 kB] 263s Get:288 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-regex-automata-dev armhf 0.4.7-1 [424 kB] 263s Get:289 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bstr-dev armhf 1.7.0-2build1 [271 kB] 263s Get:290 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-bumpalo-dev armhf 3.16.0-1 [75.7 kB] 263s Get:291 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-cast-dev armhf 0.3.0-1 [13.1 kB] 263s Get:292 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-iana-time-zone-dev armhf 0.1.60-1 [25.1 kB] 263s Get:293 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wasm-bindgen-shared-dev armhf 0.2.87-1 [9090 B] 263s Get:294 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wasm-bindgen-backend-dev armhf 0.2.87-1 [27.0 kB] 263s Get:295 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wasm-bindgen-macro-support-dev armhf 0.2.87-1 [21.2 kB] 263s Get:296 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wasm-bindgen-macro-dev armhf 0.2.87-1 [16.6 kB] 263s Get:297 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wasm-bindgen-dev armhf 0.2.87-1 [157 kB] 263s Get:298 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wasm-bindgen-macro-support+spans-dev armhf 0.2.87-1 [1074 B] 263s Get:299 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wasm-bindgen-macro+spans-dev armhf 0.2.87-1 [1058 B] 263s Get:300 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wasm-bindgen+spans-dev armhf 0.2.87-1 [1038 B] 263s Get:301 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wasm-bindgen+default-dev armhf 0.2.87-1 [1046 B] 263s Get:302 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-js-sys-dev armhf 0.3.64-1 [71.9 kB] 263s Get:303 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pure-rust-locales-dev armhf 0.8.1-1 [112 kB] 263s Get:304 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-chrono-dev armhf 0.4.38-2 [172 kB] 263s Get:305 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-regex-dev armhf 1.10.6-1 [199 kB] 263s Get:306 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-parse-zoneinfo-dev armhf 0.3.0-1 [71.0 kB] 263s Get:307 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-siphasher-dev armhf 0.3.10-1 [12.0 kB] 263s Get:308 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-phf-shared-dev armhf 0.11.2-1 [15.6 kB] 263s Get:309 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-phf-dev armhf 0.11.2-1 [21.6 kB] 263s Get:310 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-uncased-dev armhf 0.9.6-2 [12.2 kB] 264s Get:311 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-phf-shared+uncased-dev armhf 0.11.2-1 [1028 B] 264s Get:312 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-phf+uncased-dev armhf 0.11.2-1 [1028 B] 264s Get:313 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ciborium-io-dev armhf 0.2.2-1 [8178 B] 264s Get:314 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-half-dev armhf 1.8.2-4 [34.8 kB] 264s Get:315 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ciborium-ll-dev armhf 0.2.2-1 [15.8 kB] 264s Get:316 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ciborium-dev armhf 0.2.2-2 [32.6 kB] 264s Get:317 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-clap-lex-dev armhf 0.7.2-2 [14.3 kB] 264s Get:318 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-strsim-dev armhf 0.11.1-1 [15.9 kB] 264s Get:319 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-terminal-size-dev armhf 0.3.0-2 [12.6 kB] 264s Get:320 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-unicase-dev armhf 2.6.0-1 [17.6 kB] 264s Get:321 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-unicode-width-dev armhf 0.1.13-3 [325 kB] 264s Get:322 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-clap-builder-dev armhf 4.5.15-2 [135 kB] 264s Get:323 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-heck-dev armhf 0.4.1-1 [13.3 kB] 264s Get:324 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-clap-derive-dev armhf 4.5.13-2 [29.3 kB] 264s Get:325 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-clap-dev armhf 4.5.16-1 [52.3 kB] 264s Get:326 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-csv-core-dev armhf 0.1.11-1 [25.9 kB] 264s Get:327 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-csv-dev armhf 1.3.0-1 [729 kB] 264s Get:328 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-futures-sink-dev armhf 0.3.31-1 [10.1 kB] 264s Get:329 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-futures-channel-dev armhf 0.3.30-1 [31.8 kB] 264s Get:330 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-futures-task-dev armhf 0.3.30-1 [13.5 kB] 264s Get:331 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-futures-macro-dev armhf 0.3.30-1 [13.3 kB] 264s Get:332 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-futures-util-dev armhf 0.3.30-2 [127 kB] 264s Get:333 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-num-cpus-dev armhf 1.16.0-1 [18.1 kB] 264s Get:334 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-futures-executor-dev armhf 0.3.30-1 [19.8 kB] 264s Get:335 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-futures-dev armhf 0.3.30-2 [53.2 kB] 264s Get:336 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-is-terminal-dev armhf 0.4.13-1 [8264 B] 264s Get:337 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-itertools-dev armhf 0.10.5-1 [101 kB] 264s Get:338 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-oorandom-dev armhf 11.1.3-1 [11.3 kB] 264s Get:339 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-winapi-i686-pc-windows-gnu-dev armhf 0.4.0-1 [3652 B] 264s Get:340 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-winapi-x86-64-pc-windows-gnu-dev armhf 0.4.0-1 [3660 B] 264s Get:341 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-winapi-dev armhf 0.3.9-1 [953 kB] 264s Get:342 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-dirs-sys-next-dev armhf 0.1.1-1 [12.1 kB] 264s Get:343 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-dirs-next-dev armhf 2.0.0-1 [13.1 kB] 264s Get:344 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-float-ord-dev armhf 0.3.2-1 [9400 B] 264s Get:345 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-cmake-dev armhf 0.1.45-1 [16.0 kB] 264s Get:346 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-freetype-sys-dev armhf 0.13.1-1 [11.8 kB] 264s Get:347 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-freetype-dev armhf 0.7.0-4 [20.4 kB] 264s Get:348 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-spin-dev armhf 0.9.8-4 [33.4 kB] 264s Get:349 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-lazy-static-dev armhf 1.4.0-2 [12.5 kB] 264s Get:350 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pathfinder-simd-dev armhf 0.5.2-1 [20.1 kB] 264s Get:351 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pathfinder-geometry-dev armhf 0.5.1-1 [13.2 kB] 264s Get:352 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-winapi-util-dev armhf 0.1.6-1 [14.0 kB] 264s Get:353 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-same-file-dev armhf 1.0.6-1 [11.5 kB] 264s Get:354 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-walkdir-dev armhf 2.5.0-1 [24.5 kB] 264s Get:355 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-const-cstr-dev armhf 0.3.0-1 [9070 B] 264s Get:356 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-libloading-dev armhf 0.8.5-1 [29.2 kB] 264s Get:357 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-dlib-dev armhf 0.5.2-2 [7970 B] 264s Get:358 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-yeslogic-fontconfig-sys-dev armhf 3.0.1-1 [8110 B] 264s Get:359 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-font-kit-dev armhf 0.11.0-2 [56.2 kB] 264s Get:360 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-color-quant-dev armhf 1.1.0-1 [8462 B] 264s Get:361 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-weezl-dev armhf 0.1.5-1 [30.3 kB] 264s Get:362 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-gif-dev armhf 0.11.3-1 [31.9 kB] 264s Get:363 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-jpeg-decoder-dev armhf 0.3.0-1 [717 kB] 264s Get:364 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-num-integer-dev armhf 0.1.46-1 [22.6 kB] 264s Get:365 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-humantime-dev armhf 2.1.0-1 [18.2 kB] 264s Get:366 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-termcolor-dev armhf 1.4.1-1 [19.7 kB] 264s Get:367 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-env-logger-dev armhf 0.10.2-2 [34.4 kB] 264s Get:368 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-quickcheck-dev armhf 1.0.3-3 [27.9 kB] 264s Get:369 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-num-bigint-dev armhf 0.4.6-1 [84.9 kB] 264s Get:370 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-num-rational-dev armhf 0.4.1-2 [28.6 kB] 264s Get:371 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-png-dev armhf 0.17.7-3 [63.4 kB] 264s Get:372 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-qoi-dev armhf 0.4.1-2 [56.7 kB] 264s Get:373 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tiff-dev armhf 0.9.0-1 [1413 kB] 264s Get:374 http://ftpmaster.internal/ubuntu plucky/main armhf libsharpyuv0 armhf 1.4.0-0.1 [16.3 kB] 264s Get:375 http://ftpmaster.internal/ubuntu plucky/main armhf libwebp7 armhf 1.4.0-0.1 [184 kB] 264s Get:376 http://ftpmaster.internal/ubuntu plucky/main armhf libwebpdemux2 armhf 1.4.0-0.1 [11.8 kB] 264s Get:377 http://ftpmaster.internal/ubuntu plucky/main armhf libwebpmux3 armhf 1.4.0-0.1 [22.5 kB] 264s Get:378 http://ftpmaster.internal/ubuntu plucky/main armhf libwebpdecoder3 armhf 1.4.0-0.1 [93.8 kB] 264s Get:379 http://ftpmaster.internal/ubuntu plucky/main armhf libsharpyuv-dev armhf 1.4.0-0.1 [16.8 kB] 264s Get:380 http://ftpmaster.internal/ubuntu plucky/main armhf libwebp-dev armhf 1.4.0-0.1 [316 kB] 264s Get:381 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-libwebp-sys-dev armhf 0.9.5-1build1 [1357 kB] 265s Get:382 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-webp-dev armhf 0.2.6-1 [1846 kB] 265s Get:383 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-image-dev armhf 0.24.7-2 [229 kB] 265s Get:384 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-plotters-backend-dev armhf 0.3.5-1 [15.3 kB] 265s Get:385 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-plotters-bitmap-dev armhf 0.3.3-3 [17.1 kB] 265s Get:386 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-plotters-svg-dev armhf 0.3.5-1 [9258 B] 265s Get:387 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-web-sys-dev armhf 0.3.64-2 [581 kB] 265s Get:388 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-plotters-dev armhf 0.3.5-4 [118 kB] 265s Get:389 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-smol-dev all 2.0.1-2 [205 kB] 265s Get:390 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tinytemplate-dev armhf 1.2.1-1 [26.8 kB] 265s Get:391 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-criterion-dev all 0.5.1-6 [104 kB] 265s Get:392 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-phf-generator-dev armhf 0.11.2-2 [12.3 kB] 265s Get:393 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-phf-codegen-dev armhf 0.11.2-1 [14.3 kB] 265s Get:394 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-chrono-tz-build-dev armhf 0.2.1-1 [12.1 kB] 265s Get:395 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-chrono-tz-dev armhf 0.8.6-2 [513 kB] 265s Get:396 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ctor-dev armhf 0.1.26-1 [12.0 kB] 265s Get:397 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-powerfmt-macros-dev armhf 0.1.0-1 [10.5 kB] 265s Get:398 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-powerfmt-dev armhf 0.2.0-1 [16.5 kB] 265s Get:399 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-deranged-dev armhf 0.3.11-1 [18.4 kB] 265s Get:400 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-eui48-dev armhf 1.1.0-2 [16.1 kB] 265s Get:401 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-indenter-dev armhf 0.3.3-1 [8646 B] 265s Get:402 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-eyre-dev armhf 0.6.12-1 [38.0 kB] 265s Get:403 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-eyre+default-dev armhf 0.6.12-1 [1050 B] 265s Get:404 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-fancy-regex-dev armhf 0.11.0-2 [54.7 kB] 265s Get:405 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-fnv-dev armhf 1.0.7-1 [12.8 kB] 265s Get:406 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-geo-types-dev armhf 0.7.11-2 [32.8 kB] 265s Get:407 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-ghost-dev armhf 0.1.5-1 [16.1 kB] 265s Get:408 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-hmac-dev armhf 0.12.1-1 [43.9 kB] 265s Get:409 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-indoc-dev armhf 2.0.5-1 [16.7 kB] 265s Get:410 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-inventory-dev armhf 0.3.2-1 [13.5 kB] 265s Get:411 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-memoffset-dev armhf 0.8.0-1 [10.9 kB] 265s Get:412 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-num-threads-dev armhf 0.1.7-1 [9152 B] 265s Get:413 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-postgres-derive-dev armhf 0.4.5-1 [13.4 kB] 265s Get:414 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sha2-asm-dev armhf 0.6.2-2 [14.4 kB] 265s Get:415 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-sha2-dev armhf 0.10.8-1 [25.6 kB] 265s Get:416 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-unicode-bidi-dev armhf 0.3.13-1 [39.8 kB] 265s Get:417 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-unicode-normalization-dev armhf 0.1.22-1 [104 kB] 265s Get:418 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-stringprep-dev armhf 0.1.2-1 [16.5 kB] 265s Get:419 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-postgres-protocol-dev armhf 0.6.6-2 [25.9 kB] 265s Get:420 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-time-core-dev armhf 0.1.2-1 [9134 B] 265s Get:421 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-time-macros-dev armhf 0.2.16-1 [25.1 kB] 265s Get:422 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-time-dev armhf 0.3.31-2 [101 kB] 265s Get:423 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-postgres-types-dev armhf 0.2.6-2 [30.1 kB] 265s Get:424 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rand-xorshift-dev armhf 0.3.0-2 [10.9 kB] 265s Get:425 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-quick-error-dev armhf 2.0.1-1 [15.6 kB] 265s Get:426 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-tempfile-dev armhf 3.10.1-1 [33.7 kB] 265s Get:427 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rusty-fork-dev armhf 0.3.0-1 [20.4 kB] 265s Get:428 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-wait-timeout-dev armhf 0.2.0-1 [14.2 kB] 265s Get:429 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rusty-fork+wait-timeout-dev armhf 0.3.0-1 [1132 B] 265s Get:430 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-unarray-dev armhf 0.1.4-1 [14.6 kB] 265s Get:431 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-proptest-dev armhf 1.5.0-2 [171 kB] 265s Get:432 http://ftpmaster.internal/ubuntu plucky/universe armhf llvm-19-runtime armhf 1:19.1.2-1ubuntu1 [530 kB] 266s Get:433 http://ftpmaster.internal/ubuntu plucky/universe armhf llvm-runtime armhf 1:19.0-60~exp1 [5608 B] 266s Get:434 http://ftpmaster.internal/ubuntu plucky/universe armhf llvm-19-linker-tools armhf 1:19.1.2-1ubuntu1 [1160 kB] 266s Get:435 http://ftpmaster.internal/ubuntu plucky/universe armhf libpfm4 armhf 4.13.0+git32-g0d4ed0e-1 [51.2 kB] 266s Get:436 http://ftpmaster.internal/ubuntu plucky/universe armhf llvm-19 armhf 1:19.1.2-1ubuntu1 [17.3 MB] 267s Get:437 http://ftpmaster.internal/ubuntu plucky/universe armhf llvm armhf 1:19.0-60~exp1 [4146 B] 267s Get:438 http://ftpmaster.internal/ubuntu plucky/universe armhf binutils-mingw-w64-x86-64 armhf 2.43.1-4ubuntu1+12 [2771 kB] 267s Get:439 http://ftpmaster.internal/ubuntu plucky/universe armhf binutils-mingw-w64-i686 armhf 2.43.1-4ubuntu1+12 [2446 kB] 267s Get:440 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-python3-dll-a-dev armhf 0.2.10-1 [31.6 kB] 267s Get:441 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-target-lexicon-dev armhf 0.12.14-1 [25.1 kB] 267s Get:442 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pyo3-build-config-dev armhf 0.22.2-1 [30.3 kB] 267s Get:443 http://ftpmaster.internal/ubuntu plucky/main armhf python3.12-dev armhf 3.12.7-1 [504 kB] 267s Get:444 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pyo3-ffi-dev armhf 0.22.2-1 [60.8 kB] 267s Get:445 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pyo3-macros-backend-dev armhf 0.22.2-1 [57.6 kB] 267s Get:446 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pyo3-macros-dev armhf 0.22.2-1 [10.0 kB] 267s Get:447 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rust-decimal-dev armhf 1.36.0-1 [114 kB] 267s Get:448 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-unindent-dev armhf 0.2.3-1 [9188 B] 267s Get:449 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-pyo3-dev armhf 0.22.2-4 [408 kB] 267s Get:450 http://ftpmaster.internal/ubuntu plucky/universe armhf librust-rustc-hash-dev armhf 1.1.0-1 [10.8 kB] 267s Get:451 http://ftpmaster.internal/ubuntu plucky/universe armhf pybuild-plugin-autopkgtest all 6.20240824 [1744 B] 267s Get:452 http://ftpmaster.internal/ubuntu plucky/main armhf python3-packaging all 24.1-1 [41.4 kB] 267s Get:453 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pyproject-hooks all 1.2.0-1 [10.2 kB] 267s Get:454 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-toml all 0.10.2-1 [16.5 kB] 267s Get:455 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-wheel all 0.44.0-1 [54.2 kB] 267s Get:456 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-build all 1.2.1-1 [29.7 kB] 267s Get:457 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-installer all 0.7.0+dfsg1-3 [17.4 kB] 267s Get:458 http://ftpmaster.internal/ubuntu plucky/universe armhf pybuild-plugin-pyproject all 6.20240824 [1726 B] 267s Get:459 http://ftpmaster.internal/ubuntu plucky/main armhf python3-all armhf 3.12.6-0ubuntu1 [886 B] 267s Get:460 http://ftpmaster.internal/ubuntu plucky/main armhf python3-six all 1.16.0-7 [13.1 kB] 267s Get:461 http://ftpmaster.internal/ubuntu plucky/main armhf python3-dateutil all 2.9.0-2 [80.3 kB] 267s Get:462 http://ftpmaster.internal/ubuntu plucky/main armhf python3-sortedcontainers all 2.4.0-2 [27.6 kB] 267s Get:463 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-hypothesis all 6.105.1-1 [321 kB] 267s Get:464 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-iniconfig all 1.1.1-2 [6024 B] 267s Get:465 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pluggy all 1.5.0-1 [21.0 kB] 267s Get:466 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pytest all 8.3.2-1 [251 kB] 267s Get:467 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-regex armhf 0.1.20240724-1 [265 kB] 267s Get:468 http://ftpmaster.internal/ubuntu plucky/main armhf python3-semantic-version all 2.10.0-2 [15.1 kB] 267s Get:469 http://ftpmaster.internal/ubuntu plucky/main armhf rustc armhf 1.80.1ubuntu2 [2754 B] 267s Get:470 http://ftpmaster.internal/ubuntu plucky/main armhf cargo armhf 1.80.1ubuntu2 [2242 B] 267s Get:471 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-setuptools-rust all 1.9.0+dfsg-2 [23.1 kB] 267s Get:472 http://ftpmaster.internal/ubuntu plucky-proposed/universe armhf python3-tiktoken armhf 0.8.0-1 [623 kB] 268s Fetched 247 MB in 14s (17.2 MB/s) 268s Selecting previously unselected package m4. 269s (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 ... 59522 files and directories currently installed.) 269s Preparing to unpack .../000-m4_1.4.19-4build1_armhf.deb ... 269s Unpacking m4 (1.4.19-4build1) ... 269s Selecting previously unselected package autoconf. 269s Preparing to unpack .../001-autoconf_2.72-3_all.deb ... 269s Unpacking autoconf (2.72-3) ... 269s Selecting previously unselected package autotools-dev. 269s Preparing to unpack .../002-autotools-dev_20220109.1_all.deb ... 269s Unpacking autotools-dev (20220109.1) ... 269s Selecting previously unselected package automake. 269s Preparing to unpack .../003-automake_1%3a1.16.5-1.3ubuntu1_all.deb ... 269s Unpacking automake (1:1.16.5-1.3ubuntu1) ... 269s Selecting previously unselected package autopoint. 269s Preparing to unpack .../004-autopoint_0.22.5-2_all.deb ... 269s Unpacking autopoint (0.22.5-2) ... 269s Selecting previously unselected package libc-dev-bin. 269s Preparing to unpack .../005-libc-dev-bin_2.40-1ubuntu3_armhf.deb ... 269s Unpacking libc-dev-bin (2.40-1ubuntu3) ... 269s Selecting previously unselected package linux-libc-dev:armhf. 269s Preparing to unpack .../006-linux-libc-dev_6.11.0-8.8_armhf.deb ... 269s Unpacking linux-libc-dev:armhf (6.11.0-8.8) ... 269s Selecting previously unselected package libcrypt-dev:armhf. 269s Preparing to unpack .../007-libcrypt-dev_1%3a4.4.36-4build1_armhf.deb ... 269s Unpacking libcrypt-dev:armhf (1:4.4.36-4build1) ... 269s Selecting previously unselected package rpcsvc-proto. 269s Preparing to unpack .../008-rpcsvc-proto_1.4.2-0ubuntu7_armhf.deb ... 269s Unpacking rpcsvc-proto (1.4.2-0ubuntu7) ... 269s Selecting previously unselected package libc6-dev:armhf. 269s Preparing to unpack .../009-libc6-dev_2.40-1ubuntu3_armhf.deb ... 269s Unpacking libc6-dev:armhf (2.40-1ubuntu3) ... 269s Selecting previously unselected package libisl23:armhf. 269s Preparing to unpack .../010-libisl23_0.27-1_armhf.deb ... 269s Unpacking libisl23:armhf (0.27-1) ... 269s Selecting previously unselected package libmpc3:armhf. 269s Preparing to unpack .../011-libmpc3_1.3.1-1build2_armhf.deb ... 269s Unpacking libmpc3:armhf (1.3.1-1build2) ... 269s Selecting previously unselected package cpp-14-arm-linux-gnueabihf. 269s Preparing to unpack .../012-cpp-14-arm-linux-gnueabihf_14.2.0-7ubuntu1_armhf.deb ... 269s Unpacking cpp-14-arm-linux-gnueabihf (14.2.0-7ubuntu1) ... 270s Selecting previously unselected package cpp-14. 270s Preparing to unpack .../013-cpp-14_14.2.0-7ubuntu1_armhf.deb ... 270s Unpacking cpp-14 (14.2.0-7ubuntu1) ... 270s Selecting previously unselected package cpp-arm-linux-gnueabihf. 270s Preparing to unpack .../014-cpp-arm-linux-gnueabihf_4%3a14.1.0-2ubuntu1_armhf.deb ... 270s Unpacking cpp-arm-linux-gnueabihf (4:14.1.0-2ubuntu1) ... 270s Selecting previously unselected package cpp. 270s Preparing to unpack .../015-cpp_4%3a14.1.0-2ubuntu1_armhf.deb ... 270s Unpacking cpp (4:14.1.0-2ubuntu1) ... 270s Selecting previously unselected package libcc1-0:armhf. 270s Preparing to unpack .../016-libcc1-0_14.2.0-7ubuntu1_armhf.deb ... 270s Unpacking libcc1-0:armhf (14.2.0-7ubuntu1) ... 270s Selecting previously unselected package libgomp1:armhf. 270s Preparing to unpack .../017-libgomp1_14.2.0-7ubuntu1_armhf.deb ... 270s Unpacking libgomp1:armhf (14.2.0-7ubuntu1) ... 270s Selecting previously unselected package libasan8:armhf. 270s Preparing to unpack .../018-libasan8_14.2.0-7ubuntu1_armhf.deb ... 270s Unpacking libasan8:armhf (14.2.0-7ubuntu1) ... 270s Selecting previously unselected package libubsan1:armhf. 270s Preparing to unpack .../019-libubsan1_14.2.0-7ubuntu1_armhf.deb ... 270s Unpacking libubsan1:armhf (14.2.0-7ubuntu1) ... 270s Selecting previously unselected package libgcc-14-dev:armhf. 270s Preparing to unpack .../020-libgcc-14-dev_14.2.0-7ubuntu1_armhf.deb ... 270s Unpacking libgcc-14-dev:armhf (14.2.0-7ubuntu1) ... 270s Selecting previously unselected package gcc-14-arm-linux-gnueabihf. 270s Preparing to unpack .../021-gcc-14-arm-linux-gnueabihf_14.2.0-7ubuntu1_armhf.deb ... 270s Unpacking gcc-14-arm-linux-gnueabihf (14.2.0-7ubuntu1) ... 271s Selecting previously unselected package gcc-14. 271s Preparing to unpack .../022-gcc-14_14.2.0-7ubuntu1_armhf.deb ... 271s Unpacking gcc-14 (14.2.0-7ubuntu1) ... 271s Selecting previously unselected package gcc-arm-linux-gnueabihf. 271s Preparing to unpack .../023-gcc-arm-linux-gnueabihf_4%3a14.1.0-2ubuntu1_armhf.deb ... 271s Unpacking gcc-arm-linux-gnueabihf (4:14.1.0-2ubuntu1) ... 271s Selecting previously unselected package gcc. 271s Preparing to unpack .../024-gcc_4%3a14.1.0-2ubuntu1_armhf.deb ... 271s Unpacking gcc (4:14.1.0-2ubuntu1) ... 271s Selecting previously unselected package libstdc++-14-dev:armhf. 271s Preparing to unpack .../025-libstdc++-14-dev_14.2.0-7ubuntu1_armhf.deb ... 271s Unpacking libstdc++-14-dev:armhf (14.2.0-7ubuntu1) ... 271s Selecting previously unselected package g++-14-arm-linux-gnueabihf. 271s Preparing to unpack .../026-g++-14-arm-linux-gnueabihf_14.2.0-7ubuntu1_armhf.deb ... 271s Unpacking g++-14-arm-linux-gnueabihf (14.2.0-7ubuntu1) ... 272s Selecting previously unselected package g++-14. 272s Preparing to unpack .../027-g++-14_14.2.0-7ubuntu1_armhf.deb ... 272s Unpacking g++-14 (14.2.0-7ubuntu1) ... 272s Selecting previously unselected package g++-arm-linux-gnueabihf. 272s Preparing to unpack .../028-g++-arm-linux-gnueabihf_4%3a14.1.0-2ubuntu1_armhf.deb ... 272s Unpacking g++-arm-linux-gnueabihf (4:14.1.0-2ubuntu1) ... 272s Selecting previously unselected package g++. 272s Preparing to unpack .../029-g++_4%3a14.1.0-2ubuntu1_armhf.deb ... 272s Unpacking g++ (4:14.1.0-2ubuntu1) ... 272s Selecting previously unselected package build-essential. 272s Preparing to unpack .../030-build-essential_12.10ubuntu1_armhf.deb ... 272s Unpacking build-essential (12.10ubuntu1) ... 272s Selecting previously unselected package libhttp-parser2.9:armhf. 272s Preparing to unpack .../031-libhttp-parser2.9_2.9.4-6build1_armhf.deb ... 272s Unpacking libhttp-parser2.9:armhf (2.9.4-6build1) ... 272s Selecting previously unselected package libgit2-1.7:armhf. 272s Preparing to unpack .../032-libgit2-1.7_1.7.2+ds-1ubuntu3_armhf.deb ... 272s Unpacking libgit2-1.7:armhf (1.7.2+ds-1ubuntu3) ... 272s Selecting previously unselected package libllvm18:armhf. 272s Preparing to unpack .../033-libllvm18_1%3a18.1.8-11_armhf.deb ... 272s Unpacking libllvm18:armhf (1:18.1.8-11) ... 273s Selecting previously unselected package libstd-rust-1.80:armhf. 273s Preparing to unpack .../034-libstd-rust-1.80_1.80.1+dfsg0ubuntu1-0ubuntu1_armhf.deb ... 273s Unpacking libstd-rust-1.80:armhf (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 274s Selecting previously unselected package libstd-rust-1.80-dev:armhf. 274s Preparing to unpack .../035-libstd-rust-1.80-dev_1.80.1+dfsg0ubuntu1-0ubuntu1_armhf.deb ... 274s Unpacking libstd-rust-1.80-dev:armhf (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 275s Selecting previously unselected package rustc-1.80. 275s Preparing to unpack .../036-rustc-1.80_1.80.1+dfsg0ubuntu1-0ubuntu1_armhf.deb ... 275s Unpacking rustc-1.80 (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 275s Selecting previously unselected package cargo-1.80. 275s Preparing to unpack .../037-cargo-1.80_1.80.1+dfsg0ubuntu1-0ubuntu1_armhf.deb ... 275s Unpacking cargo-1.80 (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 275s Selecting previously unselected package libjsoncpp25:armhf. 275s Preparing to unpack .../038-libjsoncpp25_1.9.5-6build1_armhf.deb ... 275s Unpacking libjsoncpp25:armhf (1.9.5-6build1) ... 275s Selecting previously unselected package librhash0:armhf. 275s Preparing to unpack .../039-librhash0_1.4.3-3build1_armhf.deb ... 275s Unpacking librhash0:armhf (1.4.3-3build1) ... 275s Selecting previously unselected package cmake-data. 275s Preparing to unpack .../040-cmake-data_3.30.3-1_all.deb ... 275s Unpacking cmake-data (3.30.3-1) ... 276s Selecting previously unselected package cmake. 276s Preparing to unpack .../041-cmake_3.30.3-1_armhf.deb ... 276s Unpacking cmake (3.30.3-1) ... 276s Selecting previously unselected package libdebhelper-perl. 276s Preparing to unpack .../042-libdebhelper-perl_13.20ubuntu1_all.deb ... 276s Unpacking libdebhelper-perl (13.20ubuntu1) ... 277s Selecting previously unselected package libtool. 277s Preparing to unpack .../043-libtool_2.4.7-7build1_all.deb ... 277s Unpacking libtool (2.4.7-7build1) ... 277s Selecting previously unselected package dh-autoreconf. 277s Preparing to unpack .../044-dh-autoreconf_20_all.deb ... 277s Unpacking dh-autoreconf (20) ... 277s Selecting previously unselected package libarchive-zip-perl. 277s Preparing to unpack .../045-libarchive-zip-perl_1.68-1_all.deb ... 277s Unpacking libarchive-zip-perl (1.68-1) ... 277s Selecting previously unselected package libfile-stripnondeterminism-perl. 277s Preparing to unpack .../046-libfile-stripnondeterminism-perl_1.14.0-1_all.deb ... 277s Unpacking libfile-stripnondeterminism-perl (1.14.0-1) ... 277s Selecting previously unselected package dh-strip-nondeterminism. 277s Preparing to unpack .../047-dh-strip-nondeterminism_1.14.0-1_all.deb ... 277s Unpacking dh-strip-nondeterminism (1.14.0-1) ... 277s Selecting previously unselected package debugedit. 277s Preparing to unpack .../048-debugedit_1%3a5.1-1_armhf.deb ... 277s Unpacking debugedit (1:5.1-1) ... 277s Selecting previously unselected package dwz. 277s Preparing to unpack .../049-dwz_0.15-1build6_armhf.deb ... 277s Unpacking dwz (0.15-1build6) ... 277s Selecting previously unselected package gettext. 277s Preparing to unpack .../050-gettext_0.22.5-2_armhf.deb ... 277s Unpacking gettext (0.22.5-2) ... 277s Selecting previously unselected package intltool-debian. 277s Preparing to unpack .../051-intltool-debian_0.35.0+20060710.6_all.deb ... 277s Unpacking intltool-debian (0.35.0+20060710.6) ... 277s Selecting previously unselected package po-debconf. 277s Preparing to unpack .../052-po-debconf_1.0.21+nmu1_all.deb ... 277s Unpacking po-debconf (1.0.21+nmu1) ... 277s Selecting previously unselected package debhelper. 277s Preparing to unpack .../053-debhelper_13.20ubuntu1_all.deb ... 277s Unpacking debhelper (13.20ubuntu1) ... 277s Selecting previously unselected package dh-python. 277s Preparing to unpack .../054-dh-python_6.20240824_all.deb ... 277s Unpacking dh-python (6.20240824) ... 277s Selecting previously unselected package fonts-dejavu-mono. 277s Preparing to unpack .../055-fonts-dejavu-mono_2.37-8_all.deb ... 277s Unpacking fonts-dejavu-mono (2.37-8) ... 277s Selecting previously unselected package fonts-dejavu-core. 277s Preparing to unpack .../056-fonts-dejavu-core_2.37-8_all.deb ... 277s Unpacking fonts-dejavu-core (2.37-8) ... 277s Selecting previously unselected package fontconfig-config. 277s Preparing to unpack .../057-fontconfig-config_2.15.0-1.1ubuntu2_armhf.deb ... 278s Unpacking fontconfig-config (2.15.0-1.1ubuntu2) ... 278s Selecting previously unselected package libbrotli-dev:armhf. 278s Preparing to unpack .../058-libbrotli-dev_1.1.0-2build2_armhf.deb ... 278s Unpacking libbrotli-dev:armhf (1.1.0-2build2) ... 278s Selecting previously unselected package libbz2-dev:armhf. 278s Preparing to unpack .../059-libbz2-dev_1.0.8-6_armhf.deb ... 278s Unpacking libbz2-dev:armhf (1.0.8-6) ... 278s Selecting previously unselected package libexpat1-dev:armhf. 278s Preparing to unpack .../060-libexpat1-dev_2.6.2-2_armhf.deb ... 278s Unpacking libexpat1-dev:armhf (2.6.2-2) ... 278s Selecting previously unselected package libfreetype6:armhf. 278s Preparing to unpack .../061-libfreetype6_2.13.3+dfsg-1_armhf.deb ... 278s Unpacking libfreetype6:armhf (2.13.3+dfsg-1) ... 278s Selecting previously unselected package libfontconfig1:armhf. 278s Preparing to unpack .../062-libfontconfig1_2.15.0-1.1ubuntu2_armhf.deb ... 278s Unpacking libfontconfig1:armhf (2.15.0-1.1ubuntu2) ... 278s Selecting previously unselected package zlib1g-dev:armhf. 278s Preparing to unpack .../063-zlib1g-dev_1%3a1.3.dfsg+really1.3.1-1ubuntu1_armhf.deb ... 278s Unpacking zlib1g-dev:armhf (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 278s Selecting previously unselected package libpng-dev:armhf. 278s Preparing to unpack .../064-libpng-dev_1.6.44-1_armhf.deb ... 278s Unpacking libpng-dev:armhf (1.6.44-1) ... 278s Selecting previously unselected package libfreetype-dev:armhf. 278s Preparing to unpack .../065-libfreetype-dev_2.13.3+dfsg-1_armhf.deb ... 278s Unpacking libfreetype-dev:armhf (2.13.3+dfsg-1) ... 278s Selecting previously unselected package uuid-dev:armhf. 278s Preparing to unpack .../066-uuid-dev_2.40.2-1ubuntu1_armhf.deb ... 278s Unpacking uuid-dev:armhf (2.40.2-1ubuntu1) ... 278s Selecting previously unselected package libpkgconf3:armhf. 278s Preparing to unpack .../067-libpkgconf3_1.8.1-3ubuntu1_armhf.deb ... 278s Unpacking libpkgconf3:armhf (1.8.1-3ubuntu1) ... 278s Selecting previously unselected package pkgconf-bin. 278s Preparing to unpack .../068-pkgconf-bin_1.8.1-3ubuntu1_armhf.deb ... 278s Unpacking pkgconf-bin (1.8.1-3ubuntu1) ... 278s Selecting previously unselected package pkgconf:armhf. 278s Preparing to unpack .../069-pkgconf_1.8.1-3ubuntu1_armhf.deb ... 278s Unpacking pkgconf:armhf (1.8.1-3ubuntu1) ... 278s Selecting previously unselected package libfontconfig-dev:armhf. 278s Preparing to unpack .../070-libfontconfig-dev_2.15.0-1.1ubuntu2_armhf.deb ... 278s Unpacking libfontconfig-dev:armhf (2.15.0-1.1ubuntu2) ... 278s Selecting previously unselected package libllvm19:armhf. 278s Preparing to unpack .../071-libllvm19_1%3a19.1.2-1ubuntu1_armhf.deb ... 278s Unpacking libllvm19:armhf (1:19.1.2-1ubuntu1) ... 279s Selecting previously unselected package libpython3.12t64:armhf. 279s Preparing to unpack .../072-libpython3.12t64_3.12.7-1_armhf.deb ... 279s Unpacking libpython3.12t64:armhf (3.12.7-1) ... 279s Selecting previously unselected package libpython3.12-dev:armhf. 279s Preparing to unpack .../073-libpython3.12-dev_3.12.7-1_armhf.deb ... 279s Unpacking libpython3.12-dev:armhf (3.12.7-1) ... 280s Selecting previously unselected package libpython3-dev:armhf. 280s Preparing to unpack .../074-libpython3-dev_3.12.6-0ubuntu1_armhf.deb ... 280s Unpacking libpython3-dev:armhf (3.12.6-0ubuntu1) ... 280s Selecting previously unselected package libpython3-all-dev:armhf. 280s Preparing to unpack .../075-libpython3-all-dev_3.12.6-0ubuntu1_armhf.deb ... 280s Unpacking libpython3-all-dev:armhf (3.12.6-0ubuntu1) ... 280s Selecting previously unselected package librust-ab-glyph-rasterizer-dev:armhf. 280s Preparing to unpack .../076-librust-ab-glyph-rasterizer-dev_0.1.7-1_armhf.deb ... 280s Unpacking librust-ab-glyph-rasterizer-dev:armhf (0.1.7-1) ... 280s Selecting previously unselected package librust-libm-dev:armhf. 280s Preparing to unpack .../077-librust-libm-dev_0.2.8-1_armhf.deb ... 280s Unpacking librust-libm-dev:armhf (0.2.8-1) ... 280s Selecting previously unselected package librust-ab-glyph-rasterizer+libm-dev:armhf. 280s Preparing to unpack .../078-librust-ab-glyph-rasterizer+libm-dev_0.1.7-1_armhf.deb ... 280s Unpacking librust-ab-glyph-rasterizer+libm-dev:armhf (0.1.7-1) ... 280s Selecting previously unselected package librust-core-maths-dev:armhf. 280s Preparing to unpack .../079-librust-core-maths-dev_0.1.0-2_armhf.deb ... 280s Unpacking librust-core-maths-dev:armhf (0.1.0-2) ... 280s Selecting previously unselected package librust-ttf-parser-dev:armhf. 280s Preparing to unpack .../080-librust-ttf-parser-dev_0.24.1-1_armhf.deb ... 280s Unpacking librust-ttf-parser-dev:armhf (0.24.1-1) ... 280s Selecting previously unselected package librust-owned-ttf-parser-dev:armhf. 280s Preparing to unpack .../081-librust-owned-ttf-parser-dev_0.24.0-1_armhf.deb ... 280s Unpacking librust-owned-ttf-parser-dev:armhf (0.24.0-1) ... 280s Selecting previously unselected package librust-ab-glyph-dev:armhf. 280s Preparing to unpack .../082-librust-ab-glyph-dev_0.2.28-1_armhf.deb ... 280s Unpacking librust-ab-glyph-dev:armhf (0.2.28-1) ... 280s Selecting previously unselected package librust-cfg-if-dev:armhf. 280s Preparing to unpack .../083-librust-cfg-if-dev_1.0.0-1_armhf.deb ... 280s Unpacking librust-cfg-if-dev:armhf (1.0.0-1) ... 280s Selecting previously unselected package librust-cpp-demangle-dev:armhf. 280s Preparing to unpack .../084-librust-cpp-demangle-dev_0.4.0-1_armhf.deb ... 280s Unpacking librust-cpp-demangle-dev:armhf (0.4.0-1) ... 280s Selecting previously unselected package librust-fallible-iterator-dev:armhf. 280s Preparing to unpack .../085-librust-fallible-iterator-dev_0.3.0-2_armhf.deb ... 280s Unpacking librust-fallible-iterator-dev:armhf (0.3.0-2) ... 280s Selecting previously unselected package librust-unicode-ident-dev:armhf. 280s Preparing to unpack .../086-librust-unicode-ident-dev_1.0.12-1_armhf.deb ... 280s Unpacking librust-unicode-ident-dev:armhf (1.0.12-1) ... 280s Selecting previously unselected package librust-proc-macro2-dev:armhf. 280s Preparing to unpack .../087-librust-proc-macro2-dev_1.0.86-1_armhf.deb ... 280s Unpacking librust-proc-macro2-dev:armhf (1.0.86-1) ... 280s Selecting previously unselected package librust-quote-dev:armhf. 280s Preparing to unpack .../088-librust-quote-dev_1.0.37-1_armhf.deb ... 280s Unpacking librust-quote-dev:armhf (1.0.37-1) ... 280s Selecting previously unselected package librust-syn-dev:armhf. 280s Preparing to unpack .../089-librust-syn-dev_2.0.77-1_armhf.deb ... 280s Unpacking librust-syn-dev:armhf (2.0.77-1) ... 280s Selecting previously unselected package librust-derive-arbitrary-dev:armhf. 280s Preparing to unpack .../090-librust-derive-arbitrary-dev_1.3.2-1_armhf.deb ... 280s Unpacking librust-derive-arbitrary-dev:armhf (1.3.2-1) ... 280s Selecting previously unselected package librust-arbitrary-dev:armhf. 280s Preparing to unpack .../091-librust-arbitrary-dev_1.3.2-1_armhf.deb ... 280s Unpacking librust-arbitrary-dev:armhf (1.3.2-1) ... 280s Selecting previously unselected package librust-equivalent-dev:armhf. 281s Preparing to unpack .../092-librust-equivalent-dev_1.0.1-1_armhf.deb ... 281s Unpacking librust-equivalent-dev:armhf (1.0.1-1) ... 281s Selecting previously unselected package librust-critical-section-dev:armhf. 281s Preparing to unpack .../093-librust-critical-section-dev_1.1.3-1_armhf.deb ... 281s Unpacking librust-critical-section-dev:armhf (1.1.3-1) ... 281s Selecting previously unselected package librust-serde-derive-dev:armhf. 281s Preparing to unpack .../094-librust-serde-derive-dev_1.0.210-1_armhf.deb ... 281s Unpacking librust-serde-derive-dev:armhf (1.0.210-1) ... 281s Selecting previously unselected package librust-serde-dev:armhf. 281s Preparing to unpack .../095-librust-serde-dev_1.0.210-2_armhf.deb ... 281s Unpacking librust-serde-dev:armhf (1.0.210-2) ... 281s Selecting previously unselected package librust-portable-atomic-dev:armhf. 281s Preparing to unpack .../096-librust-portable-atomic-dev_1.4.3-2_armhf.deb ... 281s Unpacking librust-portable-atomic-dev:armhf (1.4.3-2) ... 281s Selecting previously unselected package librust-libc-dev:armhf. 281s Preparing to unpack .../097-librust-libc-dev_0.2.155-1_armhf.deb ... 281s Unpacking librust-libc-dev:armhf (0.2.155-1) ... 281s Selecting previously unselected package librust-getrandom-dev:armhf. 281s Preparing to unpack .../098-librust-getrandom-dev_0.2.12-1_armhf.deb ... 281s Unpacking librust-getrandom-dev:armhf (0.2.12-1) ... 281s Selecting previously unselected package librust-smallvec-dev:armhf. 281s Preparing to unpack .../099-librust-smallvec-dev_1.13.2-1_armhf.deb ... 281s Unpacking librust-smallvec-dev:armhf (1.13.2-1) ... 281s Selecting previously unselected package librust-parking-lot-core-dev:armhf. 281s Preparing to unpack .../100-librust-parking-lot-core-dev_0.9.10-1_armhf.deb ... 281s Unpacking librust-parking-lot-core-dev:armhf (0.9.10-1) ... 281s Selecting previously unselected package librust-once-cell-dev:armhf. 281s Preparing to unpack .../101-librust-once-cell-dev_1.19.0-1_armhf.deb ... 281s Unpacking librust-once-cell-dev:armhf (1.19.0-1) ... 281s Selecting previously unselected package librust-crunchy-dev:armhf. 281s Preparing to unpack .../102-librust-crunchy-dev_0.2.2-1_armhf.deb ... 281s Unpacking librust-crunchy-dev:armhf (0.2.2-1) ... 281s Selecting previously unselected package librust-tiny-keccak-dev:armhf. 281s Preparing to unpack .../103-librust-tiny-keccak-dev_2.0.2-1_armhf.deb ... 281s Unpacking librust-tiny-keccak-dev:armhf (2.0.2-1) ... 281s Selecting previously unselected package librust-const-random-macro-dev:armhf. 281s Preparing to unpack .../104-librust-const-random-macro-dev_0.1.16-2_armhf.deb ... 281s Unpacking librust-const-random-macro-dev:armhf (0.1.16-2) ... 281s Selecting previously unselected package librust-const-random-dev:armhf. 281s Preparing to unpack .../105-librust-const-random-dev_0.1.17-2_armhf.deb ... 281s Unpacking librust-const-random-dev:armhf (0.1.17-2) ... 281s Selecting previously unselected package librust-version-check-dev:armhf. 281s Preparing to unpack .../106-librust-version-check-dev_0.9.5-1_armhf.deb ... 281s Unpacking librust-version-check-dev:armhf (0.9.5-1) ... 281s Selecting previously unselected package librust-byteorder-dev:armhf. 281s Preparing to unpack .../107-librust-byteorder-dev_1.5.0-1_armhf.deb ... 281s Unpacking librust-byteorder-dev:armhf (1.5.0-1) ... 281s Selecting previously unselected package librust-zerocopy-derive-dev:armhf. 281s Preparing to unpack .../108-librust-zerocopy-derive-dev_0.7.32-2_armhf.deb ... 281s Unpacking librust-zerocopy-derive-dev:armhf (0.7.32-2) ... 281s Selecting previously unselected package librust-zerocopy-dev:armhf. 281s Preparing to unpack .../109-librust-zerocopy-dev_0.7.32-1_armhf.deb ... 281s Unpacking librust-zerocopy-dev:armhf (0.7.32-1) ... 282s Selecting previously unselected package librust-ahash-dev. 282s Preparing to unpack .../110-librust-ahash-dev_0.8.11-8_all.deb ... 282s Unpacking librust-ahash-dev (0.8.11-8) ... 282s Selecting previously unselected package librust-allocator-api2-dev:armhf. 282s Preparing to unpack .../111-librust-allocator-api2-dev_0.2.16-1_armhf.deb ... 282s Unpacking librust-allocator-api2-dev:armhf (0.2.16-1) ... 282s Selecting previously unselected package librust-compiler-builtins-dev:armhf. 282s Preparing to unpack .../112-librust-compiler-builtins-dev_0.1.101-1_armhf.deb ... 282s Unpacking librust-compiler-builtins-dev:armhf (0.1.101-1) ... 282s Selecting previously unselected package librust-either-dev:armhf. 282s Preparing to unpack .../113-librust-either-dev_1.13.0-1_armhf.deb ... 282s Unpacking librust-either-dev:armhf (1.13.0-1) ... 282s Selecting previously unselected package librust-crossbeam-utils-dev:armhf. 282s Preparing to unpack .../114-librust-crossbeam-utils-dev_0.8.19-1_armhf.deb ... 282s Unpacking librust-crossbeam-utils-dev:armhf (0.8.19-1) ... 282s Selecting previously unselected package librust-crossbeam-epoch-dev:armhf. 282s Preparing to unpack .../115-librust-crossbeam-epoch-dev_0.9.18-1_armhf.deb ... 282s Unpacking librust-crossbeam-epoch-dev:armhf (0.9.18-1) ... 282s Selecting previously unselected package librust-crossbeam-epoch+std-dev:armhf. 282s Preparing to unpack .../116-librust-crossbeam-epoch+std-dev_0.9.18-1_armhf.deb ... 282s Unpacking librust-crossbeam-epoch+std-dev:armhf (0.9.18-1) ... 282s Selecting previously unselected package librust-crossbeam-deque-dev:armhf. 282s Preparing to unpack .../117-librust-crossbeam-deque-dev_0.8.5-1_armhf.deb ... 282s Unpacking librust-crossbeam-deque-dev:armhf (0.8.5-1) ... 282s Selecting previously unselected package librust-rayon-core-dev:armhf. 282s Preparing to unpack .../118-librust-rayon-core-dev_1.12.1-1_armhf.deb ... 282s Unpacking librust-rayon-core-dev:armhf (1.12.1-1) ... 282s Selecting previously unselected package librust-rayon-dev:armhf. 282s Preparing to unpack .../119-librust-rayon-dev_1.10.0-1_armhf.deb ... 282s Unpacking librust-rayon-dev:armhf (1.10.0-1) ... 282s Selecting previously unselected package librust-rustc-std-workspace-core-dev:armhf. 282s Preparing to unpack .../120-librust-rustc-std-workspace-core-dev_1.0.0-1_armhf.deb ... 282s Unpacking librust-rustc-std-workspace-core-dev:armhf (1.0.0-1) ... 282s Selecting previously unselected package librust-hashbrown-dev:armhf. 282s Preparing to unpack .../121-librust-hashbrown-dev_0.14.5-5_armhf.deb ... 282s Unpacking librust-hashbrown-dev:armhf (0.14.5-5) ... 282s Selecting previously unselected package librust-indexmap-dev:armhf. 282s Preparing to unpack .../122-librust-indexmap-dev_2.2.6-1_armhf.deb ... 282s Unpacking librust-indexmap-dev:armhf (2.2.6-1) ... 282s Selecting previously unselected package librust-stable-deref-trait-dev:armhf. 282s Preparing to unpack .../123-librust-stable-deref-trait-dev_1.2.0-1_armhf.deb ... 282s Unpacking librust-stable-deref-trait-dev:armhf (1.2.0-1) ... 282s Selecting previously unselected package librust-gimli-dev:armhf. 282s Preparing to unpack .../124-librust-gimli-dev_0.28.1-2_armhf.deb ... 282s Unpacking librust-gimli-dev:armhf (0.28.1-2) ... 282s Selecting previously unselected package librust-memmap2-dev:armhf. 282s Preparing to unpack .../125-librust-memmap2-dev_0.9.3-1_armhf.deb ... 282s Unpacking librust-memmap2-dev:armhf (0.9.3-1) ... 282s Selecting previously unselected package librust-crc32fast-dev:armhf. 282s Preparing to unpack .../126-librust-crc32fast-dev_1.4.2-1_armhf.deb ... 282s Unpacking librust-crc32fast-dev:armhf (1.4.2-1) ... 282s Selecting previously unselected package pkg-config:armhf. 282s Preparing to unpack .../127-pkg-config_1.8.1-3ubuntu1_armhf.deb ... 282s Unpacking pkg-config:armhf (1.8.1-3ubuntu1) ... 282s Selecting previously unselected package librust-pkg-config-dev:armhf. 282s Preparing to unpack .../128-librust-pkg-config-dev_0.3.27-1_armhf.deb ... 282s Unpacking librust-pkg-config-dev:armhf (0.3.27-1) ... 282s Selecting previously unselected package librust-libz-sys-dev:armhf. 282s Preparing to unpack .../129-librust-libz-sys-dev_1.1.20-1_armhf.deb ... 283s Unpacking librust-libz-sys-dev:armhf (1.1.20-1) ... 283s Selecting previously unselected package librust-adler-dev:armhf. 283s Preparing to unpack .../130-librust-adler-dev_1.0.2-2_armhf.deb ... 283s Unpacking librust-adler-dev:armhf (1.0.2-2) ... 283s Selecting previously unselected package librust-miniz-oxide-dev:armhf. 283s Preparing to unpack .../131-librust-miniz-oxide-dev_0.7.1-1_armhf.deb ... 283s Unpacking librust-miniz-oxide-dev:armhf (0.7.1-1) ... 283s Selecting previously unselected package librust-flate2-dev:armhf. 283s Preparing to unpack .../132-librust-flate2-dev_1.0.27-2_armhf.deb ... 283s Unpacking librust-flate2-dev:armhf (1.0.27-2) ... 283s Selecting previously unselected package librust-sval-derive-dev:armhf. 283s Preparing to unpack .../133-librust-sval-derive-dev_2.6.1-2_armhf.deb ... 283s Unpacking librust-sval-derive-dev:armhf (2.6.1-2) ... 283s Selecting previously unselected package librust-sval-dev:armhf. 283s Preparing to unpack .../134-librust-sval-dev_2.6.1-2_armhf.deb ... 283s Unpacking librust-sval-dev:armhf (2.6.1-2) ... 283s Selecting previously unselected package librust-sval-ref-dev:armhf. 283s Preparing to unpack .../135-librust-sval-ref-dev_2.6.1-1_armhf.deb ... 283s Unpacking librust-sval-ref-dev:armhf (2.6.1-1) ... 283s Selecting previously unselected package librust-erased-serde-dev:armhf. 283s Preparing to unpack .../136-librust-erased-serde-dev_0.3.31-1_armhf.deb ... 283s Unpacking librust-erased-serde-dev:armhf (0.3.31-1) ... 283s Selecting previously unselected package librust-serde-fmt-dev. 283s Preparing to unpack .../137-librust-serde-fmt-dev_1.0.3-3_all.deb ... 283s Unpacking librust-serde-fmt-dev (1.0.3-3) ... 283s Selecting previously unselected package librust-syn-1-dev:armhf. 283s Preparing to unpack .../138-librust-syn-1-dev_1.0.109-2_armhf.deb ... 283s Unpacking librust-syn-1-dev:armhf (1.0.109-2) ... 283s Selecting previously unselected package librust-no-panic-dev:armhf. 283s Preparing to unpack .../139-librust-no-panic-dev_0.1.13-1_armhf.deb ... 283s Unpacking librust-no-panic-dev:armhf (0.1.13-1) ... 283s Selecting previously unselected package librust-itoa-dev:armhf. 283s Preparing to unpack .../140-librust-itoa-dev_1.0.9-1_armhf.deb ... 283s Unpacking librust-itoa-dev:armhf (1.0.9-1) ... 283s Selecting previously unselected package librust-ryu-dev:armhf. 283s Preparing to unpack .../141-librust-ryu-dev_1.0.15-1_armhf.deb ... 283s Unpacking librust-ryu-dev:armhf (1.0.15-1) ... 283s Selecting previously unselected package librust-serde-json-dev:armhf. 283s Preparing to unpack .../142-librust-serde-json-dev_1.0.128-1_armhf.deb ... 283s Unpacking librust-serde-json-dev:armhf (1.0.128-1) ... 283s Selecting previously unselected package librust-serde-test-dev:armhf. 283s Preparing to unpack .../143-librust-serde-test-dev_1.0.171-1_armhf.deb ... 283s Unpacking librust-serde-test-dev:armhf (1.0.171-1) ... 283s Selecting previously unselected package librust-value-bag-serde1-dev:armhf. 283s Preparing to unpack .../144-librust-value-bag-serde1-dev_1.9.0-1_armhf.deb ... 283s Unpacking librust-value-bag-serde1-dev:armhf (1.9.0-1) ... 283s Selecting previously unselected package librust-sval-buffer-dev:armhf. 283s Preparing to unpack .../145-librust-sval-buffer-dev_2.6.1-1_armhf.deb ... 283s Unpacking librust-sval-buffer-dev:armhf (2.6.1-1) ... 283s Selecting previously unselected package librust-sval-dynamic-dev:armhf. 283s Preparing to unpack .../146-librust-sval-dynamic-dev_2.6.1-1_armhf.deb ... 283s Unpacking librust-sval-dynamic-dev:armhf (2.6.1-1) ... 283s Selecting previously unselected package librust-sval-fmt-dev:armhf. 283s Preparing to unpack .../147-librust-sval-fmt-dev_2.6.1-1_armhf.deb ... 283s Unpacking librust-sval-fmt-dev:armhf (2.6.1-1) ... 283s Selecting previously unselected package librust-sval-serde-dev:armhf. 283s Preparing to unpack .../148-librust-sval-serde-dev_2.6.1-1_armhf.deb ... 283s Unpacking librust-sval-serde-dev:armhf (2.6.1-1) ... 284s Selecting previously unselected package librust-value-bag-sval2-dev:armhf. 284s Preparing to unpack .../149-librust-value-bag-sval2-dev_1.9.0-1_armhf.deb ... 284s Unpacking librust-value-bag-sval2-dev:armhf (1.9.0-1) ... 284s Selecting previously unselected package librust-value-bag-dev:armhf. 284s Preparing to unpack .../150-librust-value-bag-dev_1.9.0-1_armhf.deb ... 284s Unpacking librust-value-bag-dev:armhf (1.9.0-1) ... 284s Selecting previously unselected package librust-log-dev:armhf. 284s Preparing to unpack .../151-librust-log-dev_0.4.22-1_armhf.deb ... 284s Unpacking librust-log-dev:armhf (0.4.22-1) ... 284s Selecting previously unselected package librust-memchr-dev:armhf. 284s Preparing to unpack .../152-librust-memchr-dev_2.7.1-1_armhf.deb ... 284s Unpacking librust-memchr-dev:armhf (2.7.1-1) ... 284s Selecting previously unselected package librust-ppv-lite86-dev:armhf. 284s Preparing to unpack .../153-librust-ppv-lite86-dev_0.2.16-1_armhf.deb ... 284s Unpacking librust-ppv-lite86-dev:armhf (0.2.16-1) ... 284s Selecting previously unselected package librust-rand-core-dev:armhf. 284s Preparing to unpack .../154-librust-rand-core-dev_0.6.4-2_armhf.deb ... 284s Unpacking librust-rand-core-dev:armhf (0.6.4-2) ... 284s Selecting previously unselected package librust-rand-chacha-dev:armhf. 284s Preparing to unpack .../155-librust-rand-chacha-dev_0.3.1-2_armhf.deb ... 284s Unpacking librust-rand-chacha-dev:armhf (0.3.1-2) ... 284s Selecting previously unselected package librust-rand-core+getrandom-dev:armhf. 284s Preparing to unpack .../156-librust-rand-core+getrandom-dev_0.6.4-2_armhf.deb ... 284s Unpacking librust-rand-core+getrandom-dev:armhf (0.6.4-2) ... 284s Selecting previously unselected package librust-rand-core+serde-dev:armhf. 284s Preparing to unpack .../157-librust-rand-core+serde-dev_0.6.4-2_armhf.deb ... 284s Unpacking librust-rand-core+serde-dev:armhf (0.6.4-2) ... 284s Selecting previously unselected package librust-rand-core+std-dev:armhf. 284s Preparing to unpack .../158-librust-rand-core+std-dev_0.6.4-2_armhf.deb ... 284s Unpacking librust-rand-core+std-dev:armhf (0.6.4-2) ... 284s Selecting previously unselected package librust-rand-dev:armhf. 284s Preparing to unpack .../159-librust-rand-dev_0.8.5-1_armhf.deb ... 284s Unpacking librust-rand-dev:armhf (0.8.5-1) ... 284s Selecting previously unselected package librust-unicode-segmentation-dev:armhf. 284s Preparing to unpack .../160-librust-unicode-segmentation-dev_1.11.0-1_armhf.deb ... 284s Unpacking librust-unicode-segmentation-dev:armhf (1.11.0-1) ... 284s Selecting previously unselected package librust-convert-case-dev:armhf. 284s Preparing to unpack .../161-librust-convert-case-dev_0.6.0-2_armhf.deb ... 284s Unpacking librust-convert-case-dev:armhf (0.6.0-2) ... 284s Selecting previously unselected package librust-semver-dev:armhf. 284s Preparing to unpack .../162-librust-semver-dev_1.0.21-1_armhf.deb ... 284s Unpacking librust-semver-dev:armhf (1.0.21-1) ... 284s Selecting previously unselected package librust-rustc-version-dev:armhf. 284s Preparing to unpack .../163-librust-rustc-version-dev_0.4.0-1_armhf.deb ... 284s Unpacking librust-rustc-version-dev:armhf (0.4.0-1) ... 284s Selecting previously unselected package librust-derive-more-0.99-dev:armhf. 284s Preparing to unpack .../164-librust-derive-more-0.99-dev_0.99.18-1_armhf.deb ... 284s Unpacking librust-derive-more-0.99-dev:armhf (0.99.18-1) ... 284s Selecting previously unselected package librust-cfg-if-0.1-dev:armhf. 284s Preparing to unpack .../165-librust-cfg-if-0.1-dev_0.1.10-2_armhf.deb ... 284s Unpacking librust-cfg-if-0.1-dev:armhf (0.1.10-2) ... 284s Selecting previously unselected package librust-blobby-dev:armhf. 284s Preparing to unpack .../166-librust-blobby-dev_0.3.1-1_armhf.deb ... 284s Unpacking librust-blobby-dev:armhf (0.3.1-1) ... 284s Selecting previously unselected package librust-typenum-dev:armhf. 284s Preparing to unpack .../167-librust-typenum-dev_1.17.0-2_armhf.deb ... 284s Unpacking librust-typenum-dev:armhf (1.17.0-2) ... 284s Selecting previously unselected package librust-zeroize-derive-dev:armhf. 284s Preparing to unpack .../168-librust-zeroize-derive-dev_1.4.2-1_armhf.deb ... 284s Unpacking librust-zeroize-derive-dev:armhf (1.4.2-1) ... 285s Selecting previously unselected package librust-zeroize-dev:armhf. 285s Preparing to unpack .../169-librust-zeroize-dev_1.8.1-1_armhf.deb ... 285s Unpacking librust-zeroize-dev:armhf (1.8.1-1) ... 285s Selecting previously unselected package librust-generic-array-dev:armhf. 285s Preparing to unpack .../170-librust-generic-array-dev_0.14.7-1_armhf.deb ... 285s Unpacking librust-generic-array-dev:armhf (0.14.7-1) ... 285s Selecting previously unselected package librust-block-buffer-dev:armhf. 285s Preparing to unpack .../171-librust-block-buffer-dev_0.10.2-2_armhf.deb ... 285s Unpacking librust-block-buffer-dev:armhf (0.10.2-2) ... 285s Selecting previously unselected package librust-const-oid-dev:armhf. 285s Preparing to unpack .../172-librust-const-oid-dev_0.9.3-1_armhf.deb ... 285s Unpacking librust-const-oid-dev:armhf (0.9.3-1) ... 285s Selecting previously unselected package librust-crypto-common-dev:armhf. 285s Preparing to unpack .../173-librust-crypto-common-dev_0.1.6-1_armhf.deb ... 285s Unpacking librust-crypto-common-dev:armhf (0.1.6-1) ... 285s Selecting previously unselected package librust-subtle-dev:armhf. 285s Preparing to unpack .../174-librust-subtle-dev_2.6.1-1_armhf.deb ... 285s Unpacking librust-subtle-dev:armhf (2.6.1-1) ... 285s Selecting previously unselected package librust-digest-dev:armhf. 285s Preparing to unpack .../175-librust-digest-dev_0.10.7-2_armhf.deb ... 285s Unpacking librust-digest-dev:armhf (0.10.7-2) ... 285s Selecting previously unselected package librust-static-assertions-dev:armhf. 285s Preparing to unpack .../176-librust-static-assertions-dev_1.1.0-1_armhf.deb ... 285s Unpacking librust-static-assertions-dev:armhf (1.1.0-1) ... 285s Selecting previously unselected package librust-twox-hash-dev:armhf. 285s Preparing to unpack .../177-librust-twox-hash-dev_1.6.3-1_armhf.deb ... 285s Unpacking librust-twox-hash-dev:armhf (1.6.3-1) ... 285s Selecting previously unselected package librust-ruzstd-dev:armhf. 285s Preparing to unpack .../178-librust-ruzstd-dev_0.5.0-1_armhf.deb ... 285s Unpacking librust-ruzstd-dev:armhf (0.5.0-1) ... 285s Selecting previously unselected package librust-object-dev:armhf. 285s Preparing to unpack .../179-librust-object-dev_0.32.2-1_armhf.deb ... 285s Unpacking librust-object-dev:armhf (0.32.2-1) ... 285s Selecting previously unselected package librust-rustc-demangle-dev:armhf. 285s Preparing to unpack .../180-librust-rustc-demangle-dev_0.1.21-1_armhf.deb ... 285s Unpacking librust-rustc-demangle-dev:armhf (0.1.21-1) ... 285s Selecting previously unselected package librust-addr2line-dev:armhf. 285s Preparing to unpack .../181-librust-addr2line-dev_0.21.0-2_armhf.deb ... 285s Unpacking librust-addr2line-dev:armhf (0.21.0-2) ... 285s Selecting previously unselected package librust-aho-corasick-dev:armhf. 285s Preparing to unpack .../182-librust-aho-corasick-dev_1.1.3-1_armhf.deb ... 285s Unpacking librust-aho-corasick-dev:armhf (1.1.3-1) ... 285s Selecting previously unselected package librust-bitflags-1-dev:armhf. 285s Preparing to unpack .../183-librust-bitflags-1-dev_1.3.2-5_armhf.deb ... 285s Unpacking librust-bitflags-1-dev:armhf (1.3.2-5) ... 285s Selecting previously unselected package librust-anes-dev:armhf. 285s Preparing to unpack .../184-librust-anes-dev_0.1.6-1_armhf.deb ... 285s Unpacking librust-anes-dev:armhf (0.1.6-1) ... 285s Selecting previously unselected package librust-anstyle-dev:armhf. 285s Preparing to unpack .../185-librust-anstyle-dev_1.0.8-1_armhf.deb ... 285s Unpacking librust-anstyle-dev:armhf (1.0.8-1) ... 285s Selecting previously unselected package librust-arrayvec-dev:armhf. 285s Preparing to unpack .../186-librust-arrayvec-dev_0.7.4-2_armhf.deb ... 285s Unpacking librust-arrayvec-dev:armhf (0.7.4-2) ... 285s Selecting previously unselected package librust-utf8parse-dev:armhf. 285s Preparing to unpack .../187-librust-utf8parse-dev_0.2.1-1_armhf.deb ... 285s Unpacking librust-utf8parse-dev:armhf (0.2.1-1) ... 285s Selecting previously unselected package librust-anstyle-parse-dev:armhf. 285s Preparing to unpack .../188-librust-anstyle-parse-dev_0.2.1-1_armhf.deb ... 285s Unpacking librust-anstyle-parse-dev:armhf (0.2.1-1) ... 286s Selecting previously unselected package librust-anstyle-query-dev:armhf. 286s Preparing to unpack .../189-librust-anstyle-query-dev_1.0.0-1_armhf.deb ... 286s Unpacking librust-anstyle-query-dev:armhf (1.0.0-1) ... 286s Selecting previously unselected package librust-colorchoice-dev:armhf. 286s Preparing to unpack .../190-librust-colorchoice-dev_1.0.0-1_armhf.deb ... 286s Unpacking librust-colorchoice-dev:armhf (1.0.0-1) ... 286s Selecting previously unselected package librust-anstream-dev:armhf. 286s Preparing to unpack .../191-librust-anstream-dev_0.6.7-1_armhf.deb ... 286s Unpacking librust-anstream-dev:armhf (0.6.7-1) ... 286s Selecting previously unselected package librust-jobserver-dev:armhf. 286s Preparing to unpack .../192-librust-jobserver-dev_0.1.32-1_armhf.deb ... 286s Unpacking librust-jobserver-dev:armhf (0.1.32-1) ... 286s Selecting previously unselected package librust-shlex-dev:armhf. 286s Preparing to unpack .../193-librust-shlex-dev_1.3.0-1_armhf.deb ... 286s Unpacking librust-shlex-dev:armhf (1.3.0-1) ... 286s Selecting previously unselected package librust-cc-dev:armhf. 286s Preparing to unpack .../194-librust-cc-dev_1.1.14-1_armhf.deb ... 286s Unpacking librust-cc-dev:armhf (1.1.14-1) ... 286s Selecting previously unselected package librust-backtrace-dev:armhf. 286s Preparing to unpack .../195-librust-backtrace-dev_0.3.69-2_armhf.deb ... 286s Unpacking librust-backtrace-dev:armhf (0.3.69-2) ... 286s Selecting previously unselected package librust-anyhow-dev:armhf. 286s Preparing to unpack .../196-librust-anyhow-dev_1.0.86-1_armhf.deb ... 286s Unpacking librust-anyhow-dev:armhf (1.0.86-1) ... 286s Selecting previously unselected package librust-bytecheck-derive-dev:armhf. 286s Preparing to unpack .../197-librust-bytecheck-derive-dev_0.6.12-1_armhf.deb ... 286s Unpacking librust-bytecheck-derive-dev:armhf (0.6.12-1) ... 286s Selecting previously unselected package librust-ptr-meta-derive-dev:armhf. 286s Preparing to unpack .../198-librust-ptr-meta-derive-dev_0.1.4-1_armhf.deb ... 286s Unpacking librust-ptr-meta-derive-dev:armhf (0.1.4-1) ... 286s Selecting previously unselected package librust-ptr-meta-dev:armhf. 286s Preparing to unpack .../199-librust-ptr-meta-dev_0.1.4-1_armhf.deb ... 286s Unpacking librust-ptr-meta-dev:armhf (0.1.4-1) ... 286s Selecting previously unselected package librust-simdutf8-dev:armhf. 286s Preparing to unpack .../200-librust-simdutf8-dev_0.1.4-4_armhf.deb ... 286s Unpacking librust-simdutf8-dev:armhf (0.1.4-4) ... 286s Selecting previously unselected package librust-bytemuck-derive-dev:armhf. 286s Preparing to unpack .../201-librust-bytemuck-derive-dev_1.5.0-2_armhf.deb ... 286s Unpacking librust-bytemuck-derive-dev:armhf (1.5.0-2) ... 286s Selecting previously unselected package librust-bytemuck-dev:armhf. 286s Preparing to unpack .../202-librust-bytemuck-dev_1.14.0-1_armhf.deb ... 286s Unpacking librust-bytemuck-dev:armhf (1.14.0-1) ... 286s Selecting previously unselected package librust-atomic-dev:armhf. 286s Preparing to unpack .../203-librust-atomic-dev_0.6.0-1_armhf.deb ... 286s Unpacking librust-atomic-dev:armhf (0.6.0-1) ... 286s Selecting previously unselected package librust-md5-asm-dev:armhf. 286s Preparing to unpack .../204-librust-md5-asm-dev_0.5.0-2_armhf.deb ... 286s Unpacking librust-md5-asm-dev:armhf (0.5.0-2) ... 286s Selecting previously unselected package librust-md-5-dev:armhf. 286s Preparing to unpack .../205-librust-md-5-dev_0.10.6-1_armhf.deb ... 286s Unpacking librust-md-5-dev:armhf (0.10.6-1) ... 286s Selecting previously unselected package librust-cpufeatures-dev:armhf. 286s Preparing to unpack .../206-librust-cpufeatures-dev_0.2.11-1_armhf.deb ... 286s Unpacking librust-cpufeatures-dev:armhf (0.2.11-1) ... 286s Selecting previously unselected package librust-sha1-asm-dev:armhf. 286s Preparing to unpack .../207-librust-sha1-asm-dev_0.5.1-2_armhf.deb ... 286s Unpacking librust-sha1-asm-dev:armhf (0.5.1-2) ... 286s Selecting previously unselected package librust-sha1-dev:armhf. 286s Preparing to unpack .../208-librust-sha1-dev_0.10.6-1_armhf.deb ... 286s Unpacking librust-sha1-dev:armhf (0.10.6-1) ... 286s Selecting previously unselected package librust-slog-dev:armhf. 286s Preparing to unpack .../209-librust-slog-dev_2.7.0-1_armhf.deb ... 286s Unpacking librust-slog-dev:armhf (2.7.0-1) ... 286s Selecting previously unselected package librust-uuid-dev:armhf. 287s Preparing to unpack .../210-librust-uuid-dev_1.10.0-1_armhf.deb ... 287s Unpacking librust-uuid-dev:armhf (1.10.0-1) ... 287s Selecting previously unselected package librust-bytecheck-dev:armhf. 287s Preparing to unpack .../211-librust-bytecheck-dev_0.6.12-1_armhf.deb ... 287s Unpacking librust-bytecheck-dev:armhf (0.6.12-1) ... 287s Selecting previously unselected package librust-autocfg-dev:armhf. 287s Preparing to unpack .../212-librust-autocfg-dev_1.1.0-1_armhf.deb ... 287s Unpacking librust-autocfg-dev:armhf (1.1.0-1) ... 287s Selecting previously unselected package librust-num-traits-dev:armhf. 287s Preparing to unpack .../213-librust-num-traits-dev_0.2.19-2_armhf.deb ... 287s Unpacking librust-num-traits-dev:armhf (0.2.19-2) ... 287s Selecting previously unselected package librust-funty-dev:armhf. 287s Preparing to unpack .../214-librust-funty-dev_2.0.0-1_armhf.deb ... 287s Unpacking librust-funty-dev:armhf (2.0.0-1) ... 287s Selecting previously unselected package librust-radium-dev:armhf. 287s Preparing to unpack .../215-librust-radium-dev_1.1.0-1_armhf.deb ... 287s Unpacking librust-radium-dev:armhf (1.1.0-1) ... 287s Selecting previously unselected package librust-tap-dev:armhf. 287s Preparing to unpack .../216-librust-tap-dev_1.0.1-1_armhf.deb ... 287s Unpacking librust-tap-dev:armhf (1.0.1-1) ... 287s Selecting previously unselected package librust-traitobject-dev:armhf. 287s Preparing to unpack .../217-librust-traitobject-dev_0.1.0-1_armhf.deb ... 287s Unpacking librust-traitobject-dev:armhf (0.1.0-1) ... 287s Selecting previously unselected package librust-unsafe-any-dev:armhf. 287s Preparing to unpack .../218-librust-unsafe-any-dev_0.4.2-2_armhf.deb ... 287s Unpacking librust-unsafe-any-dev:armhf (0.4.2-2) ... 287s Selecting previously unselected package librust-typemap-dev:armhf. 287s Preparing to unpack .../219-librust-typemap-dev_0.3.3-2_armhf.deb ... 287s Unpacking librust-typemap-dev:armhf (0.3.3-2) ... 287s Selecting previously unselected package librust-wyz-dev:armhf. 287s Preparing to unpack .../220-librust-wyz-dev_0.5.1-1_armhf.deb ... 287s Unpacking librust-wyz-dev:armhf (0.5.1-1) ... 287s Selecting previously unselected package librust-bitvec-dev:armhf. 287s Preparing to unpack .../221-librust-bitvec-dev_1.0.1-1_armhf.deb ... 287s Unpacking librust-bitvec-dev:armhf (1.0.1-1) ... 287s Selecting previously unselected package librust-bytes-dev:armhf. 287s Preparing to unpack .../222-librust-bytes-dev_1.5.0-1_armhf.deb ... 287s Unpacking librust-bytes-dev:armhf (1.5.0-1) ... 287s Selecting previously unselected package librust-rend-dev:armhf. 287s Preparing to unpack .../223-librust-rend-dev_0.4.0-1_armhf.deb ... 287s Unpacking librust-rend-dev:armhf (0.4.0-1) ... 287s Selecting previously unselected package librust-rkyv-derive-dev:armhf. 287s Preparing to unpack .../224-librust-rkyv-derive-dev_0.7.44-1_armhf.deb ... 287s Unpacking librust-rkyv-derive-dev:armhf (0.7.44-1) ... 287s Selecting previously unselected package librust-seahash-dev:armhf. 287s Preparing to unpack .../225-librust-seahash-dev_4.1.0-1_armhf.deb ... 287s Unpacking librust-seahash-dev:armhf (4.1.0-1) ... 287s Selecting previously unselected package librust-smol-str-dev:armhf. 287s Preparing to unpack .../226-librust-smol-str-dev_0.2.0-1_armhf.deb ... 287s Unpacking librust-smol-str-dev:armhf (0.2.0-1) ... 288s Selecting previously unselected package librust-tinyvec-dev:armhf. 288s Preparing to unpack .../227-librust-tinyvec-dev_1.6.0-2_armhf.deb ... 288s Unpacking librust-tinyvec-dev:armhf (1.6.0-2) ... 288s Selecting previously unselected package librust-tinyvec-macros-dev:armhf. 288s Preparing to unpack .../228-librust-tinyvec-macros-dev_0.1.0-1_armhf.deb ... 288s Unpacking librust-tinyvec-macros-dev:armhf (0.1.0-1) ... 288s Selecting previously unselected package librust-tinyvec+tinyvec-macros-dev:armhf. 288s Preparing to unpack .../229-librust-tinyvec+tinyvec-macros-dev_1.6.0-2_armhf.deb ... 288s Unpacking librust-tinyvec+tinyvec-macros-dev:armhf (1.6.0-2) ... 288s Selecting previously unselected package librust-rkyv-dev:armhf. 288s Preparing to unpack .../230-librust-rkyv-dev_0.7.44-1_armhf.deb ... 288s Unpacking librust-rkyv-dev:armhf (0.7.44-1) ... 288s Selecting previously unselected package librust-num-complex-dev:armhf. 288s Preparing to unpack .../231-librust-num-complex-dev_0.4.6-2_armhf.deb ... 288s Unpacking librust-num-complex-dev:armhf (0.4.6-2) ... 288s Selecting previously unselected package librust-approx-dev:armhf. 288s Preparing to unpack .../232-librust-approx-dev_0.5.1-1_armhf.deb ... 288s Unpacking librust-approx-dev:armhf (0.5.1-1) ... 288s Selecting previously unselected package librust-array-init-dev:armhf. 288s Preparing to unpack .../233-librust-array-init-dev_2.0.1-1_armhf.deb ... 288s Unpacking librust-array-init-dev:armhf (2.0.1-1) ... 288s Selecting previously unselected package librust-async-attributes-dev. 288s Preparing to unpack .../234-librust-async-attributes-dev_1.1.2-6_all.deb ... 288s Unpacking librust-async-attributes-dev (1.1.2-6) ... 288s Selecting previously unselected package librust-concurrent-queue-dev:armhf. 288s Preparing to unpack .../235-librust-concurrent-queue-dev_2.5.0-4_armhf.deb ... 288s Unpacking librust-concurrent-queue-dev:armhf (2.5.0-4) ... 288s Selecting previously unselected package librust-parking-dev:armhf. 288s Preparing to unpack .../236-librust-parking-dev_2.2.0-1_armhf.deb ... 288s Unpacking librust-parking-dev:armhf (2.2.0-1) ... 288s Selecting previously unselected package librust-pin-project-lite-dev:armhf. 288s Preparing to unpack .../237-librust-pin-project-lite-dev_0.2.13-1_armhf.deb ... 288s Unpacking librust-pin-project-lite-dev:armhf (0.2.13-1) ... 288s Selecting previously unselected package librust-event-listener-dev. 288s Preparing to unpack .../238-librust-event-listener-dev_5.3.1-8_all.deb ... 288s Unpacking librust-event-listener-dev (5.3.1-8) ... 288s Selecting previously unselected package librust-event-listener-strategy-dev:armhf. 288s Preparing to unpack .../239-librust-event-listener-strategy-dev_0.5.2-3_armhf.deb ... 288s Unpacking librust-event-listener-strategy-dev:armhf (0.5.2-3) ... 288s Selecting previously unselected package librust-futures-core-dev:armhf. 288s Preparing to unpack .../240-librust-futures-core-dev_0.3.30-1_armhf.deb ... 288s Unpacking librust-futures-core-dev:armhf (0.3.30-1) ... 288s Selecting previously unselected package librust-async-channel-dev. 288s Preparing to unpack .../241-librust-async-channel-dev_2.3.1-8_all.deb ... 288s Unpacking librust-async-channel-dev (2.3.1-8) ... 288s Selecting previously unselected package librust-async-task-dev. 288s Preparing to unpack .../242-librust-async-task-dev_4.7.1-3_all.deb ... 288s Unpacking librust-async-task-dev (4.7.1-3) ... 289s Selecting previously unselected package librust-fastrand-dev:armhf. 289s Preparing to unpack .../243-librust-fastrand-dev_2.1.1-1_armhf.deb ... 289s Unpacking librust-fastrand-dev:armhf (2.1.1-1) ... 289s Selecting previously unselected package librust-futures-io-dev:armhf. 289s Preparing to unpack .../244-librust-futures-io-dev_0.3.30-2_armhf.deb ... 289s Unpacking librust-futures-io-dev:armhf (0.3.30-2) ... 289s Selecting previously unselected package librust-futures-lite-dev:armhf. 289s Preparing to unpack .../245-librust-futures-lite-dev_2.3.0-2_armhf.deb ... 289s Unpacking librust-futures-lite-dev:armhf (2.3.0-2) ... 289s Selecting previously unselected package librust-slab-dev:armhf. 289s Preparing to unpack .../246-librust-slab-dev_0.4.9-1_armhf.deb ... 289s Unpacking librust-slab-dev:armhf (0.4.9-1) ... 289s Selecting previously unselected package librust-async-executor-dev. 289s Preparing to unpack .../247-librust-async-executor-dev_1.13.1-1_all.deb ... 289s Unpacking librust-async-executor-dev (1.13.1-1) ... 289s Selecting previously unselected package librust-async-lock-dev. 289s Preparing to unpack .../248-librust-async-lock-dev_3.4.0-4_all.deb ... 289s Unpacking librust-async-lock-dev (3.4.0-4) ... 289s Selecting previously unselected package librust-atomic-waker-dev:armhf. 289s Preparing to unpack .../249-librust-atomic-waker-dev_1.1.2-1_armhf.deb ... 289s Unpacking librust-atomic-waker-dev:armhf (1.1.2-1) ... 289s Selecting previously unselected package librust-tracing-attributes-dev:armhf. 289s Preparing to unpack .../250-librust-tracing-attributes-dev_0.1.27-1_armhf.deb ... 289s Unpacking librust-tracing-attributes-dev:armhf (0.1.27-1) ... 289s Selecting previously unselected package librust-valuable-derive-dev:armhf. 289s Preparing to unpack .../251-librust-valuable-derive-dev_0.1.0-1_armhf.deb ... 289s Unpacking librust-valuable-derive-dev:armhf (0.1.0-1) ... 289s Selecting previously unselected package librust-valuable-dev:armhf. 289s Preparing to unpack .../252-librust-valuable-dev_0.1.0-4_armhf.deb ... 289s Unpacking librust-valuable-dev:armhf (0.1.0-4) ... 289s Selecting previously unselected package librust-tracing-core-dev:armhf. 289s Preparing to unpack .../253-librust-tracing-core-dev_0.1.32-1_armhf.deb ... 289s Unpacking librust-tracing-core-dev:armhf (0.1.32-1) ... 289s Selecting previously unselected package librust-tracing-dev:armhf. 289s Preparing to unpack .../254-librust-tracing-dev_0.1.40-1_armhf.deb ... 289s Unpacking librust-tracing-dev:armhf (0.1.40-1) ... 289s Selecting previously unselected package librust-blocking-dev. 289s Preparing to unpack .../255-librust-blocking-dev_1.6.1-5_all.deb ... 289s Unpacking librust-blocking-dev (1.6.1-5) ... 289s Selecting previously unselected package librust-async-fs-dev. 289s Preparing to unpack .../256-librust-async-fs-dev_2.1.2-4_all.deb ... 289s Unpacking librust-async-fs-dev (2.1.2-4) ... 289s Selecting previously unselected package librust-bitflags-dev:armhf. 289s Preparing to unpack .../257-librust-bitflags-dev_2.6.0-1_armhf.deb ... 289s Unpacking librust-bitflags-dev:armhf (2.6.0-1) ... 289s Selecting previously unselected package librust-compiler-builtins+core-dev:armhf. 289s Preparing to unpack .../258-librust-compiler-builtins+core-dev_0.1.101-1_armhf.deb ... 289s Unpacking librust-compiler-builtins+core-dev:armhf (0.1.101-1) ... 289s Selecting previously unselected package librust-compiler-builtins+rustc-dep-of-std-dev:armhf. 289s Preparing to unpack .../259-librust-compiler-builtins+rustc-dep-of-std-dev_0.1.101-1_armhf.deb ... 289s Unpacking librust-compiler-builtins+rustc-dep-of-std-dev:armhf (0.1.101-1) ... 289s Selecting previously unselected package librust-errno-dev:armhf. 289s Preparing to unpack .../260-librust-errno-dev_0.3.8-1_armhf.deb ... 289s Unpacking librust-errno-dev:armhf (0.3.8-1) ... 289s Selecting previously unselected package librust-linux-raw-sys-dev:armhf. 289s Preparing to unpack .../261-librust-linux-raw-sys-dev_0.4.14-1_armhf.deb ... 289s Unpacking librust-linux-raw-sys-dev:armhf (0.4.14-1) ... 290s Selecting previously unselected package librust-rustix-dev:armhf. 290s Preparing to unpack .../262-librust-rustix-dev_0.38.32-1_armhf.deb ... 290s Unpacking librust-rustix-dev:armhf (0.38.32-1) ... 290s Selecting previously unselected package librust-polling-dev:armhf. 290s Preparing to unpack .../263-librust-polling-dev_3.4.0-1_armhf.deb ... 290s Unpacking librust-polling-dev:armhf (3.4.0-1) ... 290s Selecting previously unselected package librust-async-io-dev:armhf. 290s Preparing to unpack .../264-librust-async-io-dev_2.3.3-4_armhf.deb ... 290s Unpacking librust-async-io-dev:armhf (2.3.3-4) ... 290s Selecting previously unselected package librust-mio-dev:armhf. 290s Preparing to unpack .../265-librust-mio-dev_1.0.2-1_armhf.deb ... 290s Unpacking librust-mio-dev:armhf (1.0.2-1) ... 290s Selecting previously unselected package librust-owning-ref-dev:armhf. 290s Preparing to unpack .../266-librust-owning-ref-dev_0.4.1-1_armhf.deb ... 290s Unpacking librust-owning-ref-dev:armhf (0.4.1-1) ... 290s Selecting previously unselected package librust-scopeguard-dev:armhf. 290s Preparing to unpack .../267-librust-scopeguard-dev_1.2.0-1_armhf.deb ... 290s Unpacking librust-scopeguard-dev:armhf (1.2.0-1) ... 290s Selecting previously unselected package librust-lock-api-dev:armhf. 290s Preparing to unpack .../268-librust-lock-api-dev_0.4.11-1_armhf.deb ... 290s Unpacking librust-lock-api-dev:armhf (0.4.11-1) ... 290s Selecting previously unselected package librust-parking-lot-dev:armhf. 290s Preparing to unpack .../269-librust-parking-lot-dev_0.12.1-2build1_armhf.deb ... 290s Unpacking librust-parking-lot-dev:armhf (0.12.1-2build1) ... 290s Selecting previously unselected package librust-signal-hook-registry-dev:armhf. 290s Preparing to unpack .../270-librust-signal-hook-registry-dev_1.4.0-1_armhf.deb ... 290s Unpacking librust-signal-hook-registry-dev:armhf (1.4.0-1) ... 290s Selecting previously unselected package librust-socket2-dev:armhf. 290s Preparing to unpack .../271-librust-socket2-dev_0.5.7-1_armhf.deb ... 290s Unpacking librust-socket2-dev:armhf (0.5.7-1) ... 290s Selecting previously unselected package librust-tokio-macros-dev:armhf. 290s Preparing to unpack .../272-librust-tokio-macros-dev_2.4.0-2_armhf.deb ... 290s Unpacking librust-tokio-macros-dev:armhf (2.4.0-2) ... 290s Selecting previously unselected package librust-tokio-dev:armhf. 290s Preparing to unpack .../273-librust-tokio-dev_1.39.3-3_armhf.deb ... 290s Unpacking librust-tokio-dev:armhf (1.39.3-3) ... 290s Selecting previously unselected package librust-async-global-executor-dev:armhf. 290s Preparing to unpack .../274-librust-async-global-executor-dev_2.4.1-5_armhf.deb ... 290s Unpacking librust-async-global-executor-dev:armhf (2.4.1-5) ... 290s Selecting previously unselected package librust-async-net-dev. 290s Preparing to unpack .../275-librust-async-net-dev_2.0.0-4_all.deb ... 290s Unpacking librust-async-net-dev (2.0.0-4) ... 290s Selecting previously unselected package librust-async-signal-dev:armhf. 290s Preparing to unpack .../276-librust-async-signal-dev_0.2.10-1_armhf.deb ... 290s Unpacking librust-async-signal-dev:armhf (0.2.10-1) ... 290s Selecting previously unselected package librust-async-process-dev. 290s Preparing to unpack .../277-librust-async-process-dev_2.3.0-1_all.deb ... 290s Unpacking librust-async-process-dev (2.3.0-1) ... 290s Selecting previously unselected package librust-kv-log-macro-dev. 290s Preparing to unpack .../278-librust-kv-log-macro-dev_1.0.8-4_all.deb ... 290s Unpacking librust-kv-log-macro-dev (1.0.8-4) ... 291s Selecting previously unselected package librust-pin-utils-dev:armhf. 291s Preparing to unpack .../279-librust-pin-utils-dev_0.1.0-1_armhf.deb ... 291s Unpacking librust-pin-utils-dev:armhf (0.1.0-1) ... 291s Selecting previously unselected package librust-async-std-dev. 291s Preparing to unpack .../280-librust-async-std-dev_1.12.0-22_all.deb ... 291s Unpacking librust-async-std-dev (1.12.0-22) ... 291s Selecting previously unselected package librust-base64-dev:armhf. 291s Preparing to unpack .../281-librust-base64-dev_0.21.7-1_armhf.deb ... 291s Unpacking librust-base64-dev:armhf (0.21.7-1) ... 291s Selecting previously unselected package librust-bit-vec-dev:armhf. 291s Preparing to unpack .../282-librust-bit-vec-dev_0.6.3-1_armhf.deb ... 291s Unpacking librust-bit-vec-dev:armhf (0.6.3-1) ... 291s Selecting previously unselected package librust-bit-set-dev:armhf. 291s Preparing to unpack .../283-librust-bit-set-dev_0.5.2-1_armhf.deb ... 291s Unpacking librust-bit-set-dev:armhf (0.5.2-1) ... 291s Selecting previously unselected package librust-bit-set+std-dev:armhf. 291s Preparing to unpack .../284-librust-bit-set+std-dev_0.5.2-1_armhf.deb ... 291s Unpacking librust-bit-set+std-dev:armhf (0.5.2-1) ... 291s Selecting previously unselected package librust-regex-syntax-dev:armhf. 291s Preparing to unpack .../285-librust-regex-syntax-dev_0.8.2-1_armhf.deb ... 291s Unpacking librust-regex-syntax-dev:armhf (0.8.2-1) ... 291s Selecting previously unselected package librust-regex-automata-dev:armhf. 291s Preparing to unpack .../286-librust-regex-automata-dev_0.4.7-1_armhf.deb ... 291s Unpacking librust-regex-automata-dev:armhf (0.4.7-1) ... 291s Selecting previously unselected package librust-bstr-dev:armhf. 291s Preparing to unpack .../287-librust-bstr-dev_1.7.0-2build1_armhf.deb ... 291s Unpacking librust-bstr-dev:armhf (1.7.0-2build1) ... 291s Selecting previously unselected package librust-bumpalo-dev:armhf. 291s Preparing to unpack .../288-librust-bumpalo-dev_3.16.0-1_armhf.deb ... 291s Unpacking librust-bumpalo-dev:armhf (3.16.0-1) ... 291s Selecting previously unselected package librust-cast-dev:armhf. 291s Preparing to unpack .../289-librust-cast-dev_0.3.0-1_armhf.deb ... 291s Unpacking librust-cast-dev:armhf (0.3.0-1) ... 291s Selecting previously unselected package librust-iana-time-zone-dev:armhf. 291s Preparing to unpack .../290-librust-iana-time-zone-dev_0.1.60-1_armhf.deb ... 291s Unpacking librust-iana-time-zone-dev:armhf (0.1.60-1) ... 291s Selecting previously unselected package librust-wasm-bindgen-shared-dev:armhf. 291s Preparing to unpack .../291-librust-wasm-bindgen-shared-dev_0.2.87-1_armhf.deb ... 291s Unpacking librust-wasm-bindgen-shared-dev:armhf (0.2.87-1) ... 291s Selecting previously unselected package librust-wasm-bindgen-backend-dev:armhf. 291s Preparing to unpack .../292-librust-wasm-bindgen-backend-dev_0.2.87-1_armhf.deb ... 291s Unpacking librust-wasm-bindgen-backend-dev:armhf (0.2.87-1) ... 291s Selecting previously unselected package librust-wasm-bindgen-macro-support-dev:armhf. 291s Preparing to unpack .../293-librust-wasm-bindgen-macro-support-dev_0.2.87-1_armhf.deb ... 291s Unpacking librust-wasm-bindgen-macro-support-dev:armhf (0.2.87-1) ... 291s Selecting previously unselected package librust-wasm-bindgen-macro-dev:armhf. 291s Preparing to unpack .../294-librust-wasm-bindgen-macro-dev_0.2.87-1_armhf.deb ... 291s Unpacking librust-wasm-bindgen-macro-dev:armhf (0.2.87-1) ... 291s Selecting previously unselected package librust-wasm-bindgen-dev:armhf. 291s Preparing to unpack .../295-librust-wasm-bindgen-dev_0.2.87-1_armhf.deb ... 291s Unpacking librust-wasm-bindgen-dev:armhf (0.2.87-1) ... 291s Selecting previously unselected package librust-wasm-bindgen-macro-support+spans-dev:armhf. 291s Preparing to unpack .../296-librust-wasm-bindgen-macro-support+spans-dev_0.2.87-1_armhf.deb ... 291s Unpacking librust-wasm-bindgen-macro-support+spans-dev:armhf (0.2.87-1) ... 291s Selecting previously unselected package librust-wasm-bindgen-macro+spans-dev:armhf. 291s Preparing to unpack .../297-librust-wasm-bindgen-macro+spans-dev_0.2.87-1_armhf.deb ... 291s Unpacking librust-wasm-bindgen-macro+spans-dev:armhf (0.2.87-1) ... 291s Selecting previously unselected package librust-wasm-bindgen+spans-dev:armhf. 291s Preparing to unpack .../298-librust-wasm-bindgen+spans-dev_0.2.87-1_armhf.deb ... 291s Unpacking librust-wasm-bindgen+spans-dev:armhf (0.2.87-1) ... 291s Selecting previously unselected package librust-wasm-bindgen+default-dev:armhf. 291s Preparing to unpack .../299-librust-wasm-bindgen+default-dev_0.2.87-1_armhf.deb ... 291s Unpacking librust-wasm-bindgen+default-dev:armhf (0.2.87-1) ... 291s Selecting previously unselected package librust-js-sys-dev:armhf. 291s Preparing to unpack .../300-librust-js-sys-dev_0.3.64-1_armhf.deb ... 291s Unpacking librust-js-sys-dev:armhf (0.3.64-1) ... 292s Selecting previously unselected package librust-pure-rust-locales-dev:armhf. 292s Preparing to unpack .../301-librust-pure-rust-locales-dev_0.8.1-1_armhf.deb ... 292s Unpacking librust-pure-rust-locales-dev:armhf (0.8.1-1) ... 292s Selecting previously unselected package librust-chrono-dev:armhf. 292s Preparing to unpack .../302-librust-chrono-dev_0.4.38-2_armhf.deb ... 292s Unpacking librust-chrono-dev:armhf (0.4.38-2) ... 292s Selecting previously unselected package librust-regex-dev:armhf. 292s Preparing to unpack .../303-librust-regex-dev_1.10.6-1_armhf.deb ... 292s Unpacking librust-regex-dev:armhf (1.10.6-1) ... 292s Selecting previously unselected package librust-parse-zoneinfo-dev:armhf. 292s Preparing to unpack .../304-librust-parse-zoneinfo-dev_0.3.0-1_armhf.deb ... 292s Unpacking librust-parse-zoneinfo-dev:armhf (0.3.0-1) ... 292s Selecting previously unselected package librust-siphasher-dev:armhf. 292s Preparing to unpack .../305-librust-siphasher-dev_0.3.10-1_armhf.deb ... 292s Unpacking librust-siphasher-dev:armhf (0.3.10-1) ... 292s Selecting previously unselected package librust-phf-shared-dev:armhf. 292s Preparing to unpack .../306-librust-phf-shared-dev_0.11.2-1_armhf.deb ... 292s Unpacking librust-phf-shared-dev:armhf (0.11.2-1) ... 292s Selecting previously unselected package librust-phf-dev:armhf. 292s Preparing to unpack .../307-librust-phf-dev_0.11.2-1_armhf.deb ... 292s Unpacking librust-phf-dev:armhf (0.11.2-1) ... 292s Selecting previously unselected package librust-uncased-dev:armhf. 292s Preparing to unpack .../308-librust-uncased-dev_0.9.6-2_armhf.deb ... 292s Unpacking librust-uncased-dev:armhf (0.9.6-2) ... 292s Selecting previously unselected package librust-phf-shared+uncased-dev:armhf. 292s Preparing to unpack .../309-librust-phf-shared+uncased-dev_0.11.2-1_armhf.deb ... 292s Unpacking librust-phf-shared+uncased-dev:armhf (0.11.2-1) ... 292s Selecting previously unselected package librust-phf+uncased-dev:armhf. 292s Preparing to unpack .../310-librust-phf+uncased-dev_0.11.2-1_armhf.deb ... 292s Unpacking librust-phf+uncased-dev:armhf (0.11.2-1) ... 292s Selecting previously unselected package librust-ciborium-io-dev:armhf. 292s Preparing to unpack .../311-librust-ciborium-io-dev_0.2.2-1_armhf.deb ... 292s Unpacking librust-ciborium-io-dev:armhf (0.2.2-1) ... 292s Selecting previously unselected package librust-half-dev:armhf. 292s Preparing to unpack .../312-librust-half-dev_1.8.2-4_armhf.deb ... 292s Unpacking librust-half-dev:armhf (1.8.2-4) ... 292s Selecting previously unselected package librust-ciborium-ll-dev:armhf. 292s Preparing to unpack .../313-librust-ciborium-ll-dev_0.2.2-1_armhf.deb ... 292s Unpacking librust-ciborium-ll-dev:armhf (0.2.2-1) ... 292s Selecting previously unselected package librust-ciborium-dev:armhf. 292s Preparing to unpack .../314-librust-ciborium-dev_0.2.2-2_armhf.deb ... 292s Unpacking librust-ciborium-dev:armhf (0.2.2-2) ... 292s Selecting previously unselected package librust-clap-lex-dev:armhf. 292s Preparing to unpack .../315-librust-clap-lex-dev_0.7.2-2_armhf.deb ... 292s Unpacking librust-clap-lex-dev:armhf (0.7.2-2) ... 292s Selecting previously unselected package librust-strsim-dev:armhf. 292s Preparing to unpack .../316-librust-strsim-dev_0.11.1-1_armhf.deb ... 292s Unpacking librust-strsim-dev:armhf (0.11.1-1) ... 292s Selecting previously unselected package librust-terminal-size-dev:armhf. 292s Preparing to unpack .../317-librust-terminal-size-dev_0.3.0-2_armhf.deb ... 292s Unpacking librust-terminal-size-dev:armhf (0.3.0-2) ... 292s Selecting previously unselected package librust-unicase-dev:armhf. 292s Preparing to unpack .../318-librust-unicase-dev_2.6.0-1_armhf.deb ... 292s Unpacking librust-unicase-dev:armhf (2.6.0-1) ... 292s Selecting previously unselected package librust-unicode-width-dev:armhf. 292s Preparing to unpack .../319-librust-unicode-width-dev_0.1.13-3_armhf.deb ... 292s Unpacking librust-unicode-width-dev:armhf (0.1.13-3) ... 292s Selecting previously unselected package librust-clap-builder-dev:armhf. 292s Preparing to unpack .../320-librust-clap-builder-dev_4.5.15-2_armhf.deb ... 292s Unpacking librust-clap-builder-dev:armhf (4.5.15-2) ... 292s Selecting previously unselected package librust-heck-dev:armhf. 292s Preparing to unpack .../321-librust-heck-dev_0.4.1-1_armhf.deb ... 292s Unpacking librust-heck-dev:armhf (0.4.1-1) ... 292s Selecting previously unselected package librust-clap-derive-dev:armhf. 292s Preparing to unpack .../322-librust-clap-derive-dev_4.5.13-2_armhf.deb ... 292s Unpacking librust-clap-derive-dev:armhf (4.5.13-2) ... 293s Selecting previously unselected package librust-clap-dev:armhf. 293s Preparing to unpack .../323-librust-clap-dev_4.5.16-1_armhf.deb ... 293s Unpacking librust-clap-dev:armhf (4.5.16-1) ... 293s Selecting previously unselected package librust-csv-core-dev:armhf. 293s Preparing to unpack .../324-librust-csv-core-dev_0.1.11-1_armhf.deb ... 293s Unpacking librust-csv-core-dev:armhf (0.1.11-1) ... 293s Selecting previously unselected package librust-csv-dev:armhf. 293s Preparing to unpack .../325-librust-csv-dev_1.3.0-1_armhf.deb ... 293s Unpacking librust-csv-dev:armhf (1.3.0-1) ... 293s Selecting previously unselected package librust-futures-sink-dev:armhf. 293s Preparing to unpack .../326-librust-futures-sink-dev_0.3.31-1_armhf.deb ... 293s Unpacking librust-futures-sink-dev:armhf (0.3.31-1) ... 293s Selecting previously unselected package librust-futures-channel-dev:armhf. 293s Preparing to unpack .../327-librust-futures-channel-dev_0.3.30-1_armhf.deb ... 293s Unpacking librust-futures-channel-dev:armhf (0.3.30-1) ... 293s Selecting previously unselected package librust-futures-task-dev:armhf. 293s Preparing to unpack .../328-librust-futures-task-dev_0.3.30-1_armhf.deb ... 293s Unpacking librust-futures-task-dev:armhf (0.3.30-1) ... 293s Selecting previously unselected package librust-futures-macro-dev:armhf. 293s Preparing to unpack .../329-librust-futures-macro-dev_0.3.30-1_armhf.deb ... 293s Unpacking librust-futures-macro-dev:armhf (0.3.30-1) ... 293s Selecting previously unselected package librust-futures-util-dev:armhf. 293s Preparing to unpack .../330-librust-futures-util-dev_0.3.30-2_armhf.deb ... 293s Unpacking librust-futures-util-dev:armhf (0.3.30-2) ... 293s Selecting previously unselected package librust-num-cpus-dev:armhf. 293s Preparing to unpack .../331-librust-num-cpus-dev_1.16.0-1_armhf.deb ... 293s Unpacking librust-num-cpus-dev:armhf (1.16.0-1) ... 293s Selecting previously unselected package librust-futures-executor-dev:armhf. 293s Preparing to unpack .../332-librust-futures-executor-dev_0.3.30-1_armhf.deb ... 293s Unpacking librust-futures-executor-dev:armhf (0.3.30-1) ... 293s Selecting previously unselected package librust-futures-dev:armhf. 293s Preparing to unpack .../333-librust-futures-dev_0.3.30-2_armhf.deb ... 293s Unpacking librust-futures-dev:armhf (0.3.30-2) ... 293s Selecting previously unselected package librust-is-terminal-dev:armhf. 293s Preparing to unpack .../334-librust-is-terminal-dev_0.4.13-1_armhf.deb ... 293s Unpacking librust-is-terminal-dev:armhf (0.4.13-1) ... 293s Selecting previously unselected package librust-itertools-dev:armhf. 293s Preparing to unpack .../335-librust-itertools-dev_0.10.5-1_armhf.deb ... 293s Unpacking librust-itertools-dev:armhf (0.10.5-1) ... 293s Selecting previously unselected package librust-oorandom-dev:armhf. 293s Preparing to unpack .../336-librust-oorandom-dev_11.1.3-1_armhf.deb ... 293s Unpacking librust-oorandom-dev:armhf (11.1.3-1) ... 293s Selecting previously unselected package librust-winapi-i686-pc-windows-gnu-dev:armhf. 293s Preparing to unpack .../337-librust-winapi-i686-pc-windows-gnu-dev_0.4.0-1_armhf.deb ... 293s Unpacking librust-winapi-i686-pc-windows-gnu-dev:armhf (0.4.0-1) ... 293s Selecting previously unselected package librust-winapi-x86-64-pc-windows-gnu-dev:armhf. 293s Preparing to unpack .../338-librust-winapi-x86-64-pc-windows-gnu-dev_0.4.0-1_armhf.deb ... 293s Unpacking librust-winapi-x86-64-pc-windows-gnu-dev:armhf (0.4.0-1) ... 293s Selecting previously unselected package librust-winapi-dev:armhf. 293s Preparing to unpack .../339-librust-winapi-dev_0.3.9-1_armhf.deb ... 293s Unpacking librust-winapi-dev:armhf (0.3.9-1) ... 293s Selecting previously unselected package librust-dirs-sys-next-dev:armhf. 293s Preparing to unpack .../340-librust-dirs-sys-next-dev_0.1.1-1_armhf.deb ... 293s Unpacking librust-dirs-sys-next-dev:armhf (0.1.1-1) ... 293s Selecting previously unselected package librust-dirs-next-dev:armhf. 294s Preparing to unpack .../341-librust-dirs-next-dev_2.0.0-1_armhf.deb ... 294s Unpacking librust-dirs-next-dev:armhf (2.0.0-1) ... 294s Selecting previously unselected package librust-float-ord-dev:armhf. 294s Preparing to unpack .../342-librust-float-ord-dev_0.3.2-1_armhf.deb ... 294s Unpacking librust-float-ord-dev:armhf (0.3.2-1) ... 294s Selecting previously unselected package librust-cmake-dev:armhf. 294s Preparing to unpack .../343-librust-cmake-dev_0.1.45-1_armhf.deb ... 294s Unpacking librust-cmake-dev:armhf (0.1.45-1) ... 294s Selecting previously unselected package librust-freetype-sys-dev:armhf. 294s Preparing to unpack .../344-librust-freetype-sys-dev_0.13.1-1_armhf.deb ... 294s Unpacking librust-freetype-sys-dev:armhf (0.13.1-1) ... 294s Selecting previously unselected package librust-freetype-dev:armhf. 294s Preparing to unpack .../345-librust-freetype-dev_0.7.0-4_armhf.deb ... 294s Unpacking librust-freetype-dev:armhf (0.7.0-4) ... 294s Selecting previously unselected package librust-spin-dev:armhf. 294s Preparing to unpack .../346-librust-spin-dev_0.9.8-4_armhf.deb ... 294s Unpacking librust-spin-dev:armhf (0.9.8-4) ... 294s Selecting previously unselected package librust-lazy-static-dev:armhf. 294s Preparing to unpack .../347-librust-lazy-static-dev_1.4.0-2_armhf.deb ... 294s Unpacking librust-lazy-static-dev:armhf (1.4.0-2) ... 294s Selecting previously unselected package librust-pathfinder-simd-dev:armhf. 294s Preparing to unpack .../348-librust-pathfinder-simd-dev_0.5.2-1_armhf.deb ... 294s Unpacking librust-pathfinder-simd-dev:armhf (0.5.2-1) ... 294s Selecting previously unselected package librust-pathfinder-geometry-dev:armhf. 294s Preparing to unpack .../349-librust-pathfinder-geometry-dev_0.5.1-1_armhf.deb ... 294s Unpacking librust-pathfinder-geometry-dev:armhf (0.5.1-1) ... 294s Selecting previously unselected package librust-winapi-util-dev:armhf. 294s Preparing to unpack .../350-librust-winapi-util-dev_0.1.6-1_armhf.deb ... 294s Unpacking librust-winapi-util-dev:armhf (0.1.6-1) ... 294s Selecting previously unselected package librust-same-file-dev:armhf. 294s Preparing to unpack .../351-librust-same-file-dev_1.0.6-1_armhf.deb ... 294s Unpacking librust-same-file-dev:armhf (1.0.6-1) ... 294s Selecting previously unselected package librust-walkdir-dev:armhf. 294s Preparing to unpack .../352-librust-walkdir-dev_2.5.0-1_armhf.deb ... 294s Unpacking librust-walkdir-dev:armhf (2.5.0-1) ... 294s Selecting previously unselected package librust-const-cstr-dev:armhf. 294s Preparing to unpack .../353-librust-const-cstr-dev_0.3.0-1_armhf.deb ... 294s Unpacking librust-const-cstr-dev:armhf (0.3.0-1) ... 294s Selecting previously unselected package librust-libloading-dev:armhf. 294s Preparing to unpack .../354-librust-libloading-dev_0.8.5-1_armhf.deb ... 294s Unpacking librust-libloading-dev:armhf (0.8.5-1) ... 294s Selecting previously unselected package librust-dlib-dev:armhf. 294s Preparing to unpack .../355-librust-dlib-dev_0.5.2-2_armhf.deb ... 294s Unpacking librust-dlib-dev:armhf (0.5.2-2) ... 294s Selecting previously unselected package librust-yeslogic-fontconfig-sys-dev:armhf. 294s Preparing to unpack .../356-librust-yeslogic-fontconfig-sys-dev_3.0.1-1_armhf.deb ... 294s Unpacking librust-yeslogic-fontconfig-sys-dev:armhf (3.0.1-1) ... 294s Selecting previously unselected package librust-font-kit-dev:armhf. 294s Preparing to unpack .../357-librust-font-kit-dev_0.11.0-2_armhf.deb ... 294s Unpacking librust-font-kit-dev:armhf (0.11.0-2) ... 294s Selecting previously unselected package librust-color-quant-dev:armhf. 294s Preparing to unpack .../358-librust-color-quant-dev_1.1.0-1_armhf.deb ... 294s Unpacking librust-color-quant-dev:armhf (1.1.0-1) ... 294s Selecting previously unselected package librust-weezl-dev:armhf. 294s Preparing to unpack .../359-librust-weezl-dev_0.1.5-1_armhf.deb ... 294s Unpacking librust-weezl-dev:armhf (0.1.5-1) ... 294s Selecting previously unselected package librust-gif-dev:armhf. 294s Preparing to unpack .../360-librust-gif-dev_0.11.3-1_armhf.deb ... 294s Unpacking librust-gif-dev:armhf (0.11.3-1) ... 294s Selecting previously unselected package librust-jpeg-decoder-dev:armhf. 294s Preparing to unpack .../361-librust-jpeg-decoder-dev_0.3.0-1_armhf.deb ... 294s Unpacking librust-jpeg-decoder-dev:armhf (0.3.0-1) ... 294s Selecting previously unselected package librust-num-integer-dev:armhf. 294s Preparing to unpack .../362-librust-num-integer-dev_0.1.46-1_armhf.deb ... 294s Unpacking librust-num-integer-dev:armhf (0.1.46-1) ... 294s Selecting previously unselected package librust-humantime-dev:armhf. 295s Preparing to unpack .../363-librust-humantime-dev_2.1.0-1_armhf.deb ... 295s Unpacking librust-humantime-dev:armhf (2.1.0-1) ... 295s Selecting previously unselected package librust-termcolor-dev:armhf. 295s Preparing to unpack .../364-librust-termcolor-dev_1.4.1-1_armhf.deb ... 295s Unpacking librust-termcolor-dev:armhf (1.4.1-1) ... 295s Selecting previously unselected package librust-env-logger-dev:armhf. 295s Preparing to unpack .../365-librust-env-logger-dev_0.10.2-2_armhf.deb ... 295s Unpacking librust-env-logger-dev:armhf (0.10.2-2) ... 295s Selecting previously unselected package librust-quickcheck-dev:armhf. 295s Preparing to unpack .../366-librust-quickcheck-dev_1.0.3-3_armhf.deb ... 295s Unpacking librust-quickcheck-dev:armhf (1.0.3-3) ... 295s Selecting previously unselected package librust-num-bigint-dev:armhf. 295s Preparing to unpack .../367-librust-num-bigint-dev_0.4.6-1_armhf.deb ... 295s Unpacking librust-num-bigint-dev:armhf (0.4.6-1) ... 295s Selecting previously unselected package librust-num-rational-dev:armhf. 295s Preparing to unpack .../368-librust-num-rational-dev_0.4.1-2_armhf.deb ... 295s Unpacking librust-num-rational-dev:armhf (0.4.1-2) ... 295s Selecting previously unselected package librust-png-dev:armhf. 295s Preparing to unpack .../369-librust-png-dev_0.17.7-3_armhf.deb ... 295s Unpacking librust-png-dev:armhf (0.17.7-3) ... 295s Selecting previously unselected package librust-qoi-dev:armhf. 295s Preparing to unpack .../370-librust-qoi-dev_0.4.1-2_armhf.deb ... 295s Unpacking librust-qoi-dev:armhf (0.4.1-2) ... 295s Selecting previously unselected package librust-tiff-dev:armhf. 295s Preparing to unpack .../371-librust-tiff-dev_0.9.0-1_armhf.deb ... 295s Unpacking librust-tiff-dev:armhf (0.9.0-1) ... 295s Selecting previously unselected package libsharpyuv0:armhf. 295s Preparing to unpack .../372-libsharpyuv0_1.4.0-0.1_armhf.deb ... 295s Unpacking libsharpyuv0:armhf (1.4.0-0.1) ... 295s Selecting previously unselected package libwebp7:armhf. 295s Preparing to unpack .../373-libwebp7_1.4.0-0.1_armhf.deb ... 295s Unpacking libwebp7:armhf (1.4.0-0.1) ... 295s Selecting previously unselected package libwebpdemux2:armhf. 295s Preparing to unpack .../374-libwebpdemux2_1.4.0-0.1_armhf.deb ... 295s Unpacking libwebpdemux2:armhf (1.4.0-0.1) ... 295s Selecting previously unselected package libwebpmux3:armhf. 295s Preparing to unpack .../375-libwebpmux3_1.4.0-0.1_armhf.deb ... 295s Unpacking libwebpmux3:armhf (1.4.0-0.1) ... 295s Selecting previously unselected package libwebpdecoder3:armhf. 295s Preparing to unpack .../376-libwebpdecoder3_1.4.0-0.1_armhf.deb ... 295s Unpacking libwebpdecoder3:armhf (1.4.0-0.1) ... 295s Selecting previously unselected package libsharpyuv-dev:armhf. 295s Preparing to unpack .../377-libsharpyuv-dev_1.4.0-0.1_armhf.deb ... 295s Unpacking libsharpyuv-dev:armhf (1.4.0-0.1) ... 295s Selecting previously unselected package libwebp-dev:armhf. 295s Preparing to unpack .../378-libwebp-dev_1.4.0-0.1_armhf.deb ... 295s Unpacking libwebp-dev:armhf (1.4.0-0.1) ... 295s Selecting previously unselected package librust-libwebp-sys-dev:armhf. 295s Preparing to unpack .../379-librust-libwebp-sys-dev_0.9.5-1build1_armhf.deb ... 295s Unpacking librust-libwebp-sys-dev:armhf (0.9.5-1build1) ... 295s Selecting previously unselected package librust-webp-dev:armhf. 295s Preparing to unpack .../380-librust-webp-dev_0.2.6-1_armhf.deb ... 295s Unpacking librust-webp-dev:armhf (0.2.6-1) ... 295s Selecting previously unselected package librust-image-dev:armhf. 295s Preparing to unpack .../381-librust-image-dev_0.24.7-2_armhf.deb ... 295s Unpacking librust-image-dev:armhf (0.24.7-2) ... 295s Selecting previously unselected package librust-plotters-backend-dev:armhf. 295s Preparing to unpack .../382-librust-plotters-backend-dev_0.3.5-1_armhf.deb ... 295s Unpacking librust-plotters-backend-dev:armhf (0.3.5-1) ... 295s Selecting previously unselected package librust-plotters-bitmap-dev:armhf. 296s Preparing to unpack .../383-librust-plotters-bitmap-dev_0.3.3-3_armhf.deb ... 296s Unpacking librust-plotters-bitmap-dev:armhf (0.3.3-3) ... 296s Selecting previously unselected package librust-plotters-svg-dev:armhf. 296s Preparing to unpack .../384-librust-plotters-svg-dev_0.3.5-1_armhf.deb ... 296s Unpacking librust-plotters-svg-dev:armhf (0.3.5-1) ... 296s Selecting previously unselected package librust-web-sys-dev:armhf. 296s Preparing to unpack .../385-librust-web-sys-dev_0.3.64-2_armhf.deb ... 296s Unpacking librust-web-sys-dev:armhf (0.3.64-2) ... 296s Selecting previously unselected package librust-plotters-dev:armhf. 296s Preparing to unpack .../386-librust-plotters-dev_0.3.5-4_armhf.deb ... 296s Unpacking librust-plotters-dev:armhf (0.3.5-4) ... 296s Selecting previously unselected package librust-smol-dev. 296s Preparing to unpack .../387-librust-smol-dev_2.0.1-2_all.deb ... 296s Unpacking librust-smol-dev (2.0.1-2) ... 296s Selecting previously unselected package librust-tinytemplate-dev:armhf. 296s Preparing to unpack .../388-librust-tinytemplate-dev_1.2.1-1_armhf.deb ... 296s Unpacking librust-tinytemplate-dev:armhf (1.2.1-1) ... 296s Selecting previously unselected package librust-criterion-dev. 296s Preparing to unpack .../389-librust-criterion-dev_0.5.1-6_all.deb ... 296s Unpacking librust-criterion-dev (0.5.1-6) ... 296s Selecting previously unselected package librust-phf-generator-dev:armhf. 296s Preparing to unpack .../390-librust-phf-generator-dev_0.11.2-2_armhf.deb ... 296s Unpacking librust-phf-generator-dev:armhf (0.11.2-2) ... 296s Selecting previously unselected package librust-phf-codegen-dev:armhf. 296s Preparing to unpack .../391-librust-phf-codegen-dev_0.11.2-1_armhf.deb ... 296s Unpacking librust-phf-codegen-dev:armhf (0.11.2-1) ... 296s Selecting previously unselected package librust-chrono-tz-build-dev:armhf. 296s Preparing to unpack .../392-librust-chrono-tz-build-dev_0.2.1-1_armhf.deb ... 296s Unpacking librust-chrono-tz-build-dev:armhf (0.2.1-1) ... 296s Selecting previously unselected package librust-chrono-tz-dev:armhf. 296s Preparing to unpack .../393-librust-chrono-tz-dev_0.8.6-2_armhf.deb ... 296s Unpacking librust-chrono-tz-dev:armhf (0.8.6-2) ... 296s Selecting previously unselected package librust-ctor-dev:armhf. 296s Preparing to unpack .../394-librust-ctor-dev_0.1.26-1_armhf.deb ... 296s Unpacking librust-ctor-dev:armhf (0.1.26-1) ... 296s Selecting previously unselected package librust-powerfmt-macros-dev:armhf. 296s Preparing to unpack .../395-librust-powerfmt-macros-dev_0.1.0-1_armhf.deb ... 296s Unpacking librust-powerfmt-macros-dev:armhf (0.1.0-1) ... 296s Selecting previously unselected package librust-powerfmt-dev:armhf. 296s Preparing to unpack .../396-librust-powerfmt-dev_0.2.0-1_armhf.deb ... 296s Unpacking librust-powerfmt-dev:armhf (0.2.0-1) ... 297s Selecting previously unselected package librust-deranged-dev:armhf. 297s Preparing to unpack .../397-librust-deranged-dev_0.3.11-1_armhf.deb ... 297s Unpacking librust-deranged-dev:armhf (0.3.11-1) ... 297s Selecting previously unselected package librust-eui48-dev:armhf. 297s Preparing to unpack .../398-librust-eui48-dev_1.1.0-2_armhf.deb ... 297s Unpacking librust-eui48-dev:armhf (1.1.0-2) ... 297s Selecting previously unselected package librust-indenter-dev:armhf. 297s Preparing to unpack .../399-librust-indenter-dev_0.3.3-1_armhf.deb ... 297s Unpacking librust-indenter-dev:armhf (0.3.3-1) ... 297s Selecting previously unselected package librust-eyre-dev:armhf. 297s Preparing to unpack .../400-librust-eyre-dev_0.6.12-1_armhf.deb ... 297s Unpacking librust-eyre-dev:armhf (0.6.12-1) ... 297s Selecting previously unselected package librust-eyre+default-dev:armhf. 297s Preparing to unpack .../401-librust-eyre+default-dev_0.6.12-1_armhf.deb ... 297s Unpacking librust-eyre+default-dev:armhf (0.6.12-1) ... 297s Selecting previously unselected package librust-fancy-regex-dev:armhf. 297s Preparing to unpack .../402-librust-fancy-regex-dev_0.11.0-2_armhf.deb ... 297s Unpacking librust-fancy-regex-dev:armhf (0.11.0-2) ... 297s Selecting previously unselected package librust-fnv-dev:armhf. 297s Preparing to unpack .../403-librust-fnv-dev_1.0.7-1_armhf.deb ... 297s Unpacking librust-fnv-dev:armhf (1.0.7-1) ... 297s Selecting previously unselected package librust-geo-types-dev:armhf. 297s Preparing to unpack .../404-librust-geo-types-dev_0.7.11-2_armhf.deb ... 297s Unpacking librust-geo-types-dev:armhf (0.7.11-2) ... 297s Selecting previously unselected package librust-ghost-dev:armhf. 298s Preparing to unpack .../405-librust-ghost-dev_0.1.5-1_armhf.deb ... 298s Unpacking librust-ghost-dev:armhf (0.1.5-1) ... 298s Selecting previously unselected package librust-hmac-dev:armhf. 298s Preparing to unpack .../406-librust-hmac-dev_0.12.1-1_armhf.deb ... 298s Unpacking librust-hmac-dev:armhf (0.12.1-1) ... 298s Selecting previously unselected package librust-indoc-dev:armhf. 298s Preparing to unpack .../407-librust-indoc-dev_2.0.5-1_armhf.deb ... 298s Unpacking librust-indoc-dev:armhf (2.0.5-1) ... 298s Selecting previously unselected package librust-inventory-dev:armhf. 298s Preparing to unpack .../408-librust-inventory-dev_0.3.2-1_armhf.deb ... 298s Unpacking librust-inventory-dev:armhf (0.3.2-1) ... 298s Selecting previously unselected package librust-memoffset-dev:armhf. 298s Preparing to unpack .../409-librust-memoffset-dev_0.8.0-1_armhf.deb ... 298s Unpacking librust-memoffset-dev:armhf (0.8.0-1) ... 298s Selecting previously unselected package librust-num-threads-dev:armhf. 298s Preparing to unpack .../410-librust-num-threads-dev_0.1.7-1_armhf.deb ... 298s Unpacking librust-num-threads-dev:armhf (0.1.7-1) ... 298s Selecting previously unselected package librust-postgres-derive-dev:armhf. 298s Preparing to unpack .../411-librust-postgres-derive-dev_0.4.5-1_armhf.deb ... 298s Unpacking librust-postgres-derive-dev:armhf (0.4.5-1) ... 298s Selecting previously unselected package librust-sha2-asm-dev:armhf. 298s Preparing to unpack .../412-librust-sha2-asm-dev_0.6.2-2_armhf.deb ... 298s Unpacking librust-sha2-asm-dev:armhf (0.6.2-2) ... 298s Selecting previously unselected package librust-sha2-dev:armhf. 298s Preparing to unpack .../413-librust-sha2-dev_0.10.8-1_armhf.deb ... 298s Unpacking librust-sha2-dev:armhf (0.10.8-1) ... 298s Selecting previously unselected package librust-unicode-bidi-dev:armhf. 298s Preparing to unpack .../414-librust-unicode-bidi-dev_0.3.13-1_armhf.deb ... 298s Unpacking librust-unicode-bidi-dev:armhf (0.3.13-1) ... 298s Selecting previously unselected package librust-unicode-normalization-dev:armhf. 298s Preparing to unpack .../415-librust-unicode-normalization-dev_0.1.22-1_armhf.deb ... 298s Unpacking librust-unicode-normalization-dev:armhf (0.1.22-1) ... 298s Selecting previously unselected package librust-stringprep-dev:armhf. 298s Preparing to unpack .../416-librust-stringprep-dev_0.1.2-1_armhf.deb ... 298s Unpacking librust-stringprep-dev:armhf (0.1.2-1) ... 298s Selecting previously unselected package librust-postgres-protocol-dev:armhf. 298s Preparing to unpack .../417-librust-postgres-protocol-dev_0.6.6-2_armhf.deb ... 298s Unpacking librust-postgres-protocol-dev:armhf (0.6.6-2) ... 298s Selecting previously unselected package librust-time-core-dev:armhf. 298s Preparing to unpack .../418-librust-time-core-dev_0.1.2-1_armhf.deb ... 298s Unpacking librust-time-core-dev:armhf (0.1.2-1) ... 298s Selecting previously unselected package librust-time-macros-dev:armhf. 298s Preparing to unpack .../419-librust-time-macros-dev_0.2.16-1_armhf.deb ... 298s Unpacking librust-time-macros-dev:armhf (0.2.16-1) ... 298s Selecting previously unselected package librust-time-dev:armhf. 298s Preparing to unpack .../420-librust-time-dev_0.3.31-2_armhf.deb ... 298s Unpacking librust-time-dev:armhf (0.3.31-2) ... 298s Selecting previously unselected package librust-postgres-types-dev:armhf. 298s Preparing to unpack .../421-librust-postgres-types-dev_0.2.6-2_armhf.deb ... 298s Unpacking librust-postgres-types-dev:armhf (0.2.6-2) ... 298s Selecting previously unselected package librust-rand-xorshift-dev:armhf. 298s Preparing to unpack .../422-librust-rand-xorshift-dev_0.3.0-2_armhf.deb ... 298s Unpacking librust-rand-xorshift-dev:armhf (0.3.0-2) ... 298s Selecting previously unselected package librust-quick-error-dev:armhf. 298s Preparing to unpack .../423-librust-quick-error-dev_2.0.1-1_armhf.deb ... 298s Unpacking librust-quick-error-dev:armhf (2.0.1-1) ... 298s Selecting previously unselected package librust-tempfile-dev:armhf. 298s Preparing to unpack .../424-librust-tempfile-dev_3.10.1-1_armhf.deb ... 298s Unpacking librust-tempfile-dev:armhf (3.10.1-1) ... 299s Selecting previously unselected package librust-rusty-fork-dev:armhf. 299s Preparing to unpack .../425-librust-rusty-fork-dev_0.3.0-1_armhf.deb ... 299s Unpacking librust-rusty-fork-dev:armhf (0.3.0-1) ... 299s Selecting previously unselected package librust-wait-timeout-dev:armhf. 299s Preparing to unpack .../426-librust-wait-timeout-dev_0.2.0-1_armhf.deb ... 299s Unpacking librust-wait-timeout-dev:armhf (0.2.0-1) ... 299s Selecting previously unselected package librust-rusty-fork+wait-timeout-dev:armhf. 299s Preparing to unpack .../427-librust-rusty-fork+wait-timeout-dev_0.3.0-1_armhf.deb ... 299s Unpacking librust-rusty-fork+wait-timeout-dev:armhf (0.3.0-1) ... 299s Selecting previously unselected package librust-unarray-dev:armhf. 299s Preparing to unpack .../428-librust-unarray-dev_0.1.4-1_armhf.deb ... 299s Unpacking librust-unarray-dev:armhf (0.1.4-1) ... 299s Selecting previously unselected package librust-proptest-dev:armhf. 299s Preparing to unpack .../429-librust-proptest-dev_1.5.0-2_armhf.deb ... 299s Unpacking librust-proptest-dev:armhf (1.5.0-2) ... 299s Selecting previously unselected package llvm-19-runtime. 299s Preparing to unpack .../430-llvm-19-runtime_1%3a19.1.2-1ubuntu1_armhf.deb ... 299s Unpacking llvm-19-runtime (1:19.1.2-1ubuntu1) ... 299s Selecting previously unselected package llvm-runtime:armhf. 299s Preparing to unpack .../431-llvm-runtime_1%3a19.0-60~exp1_armhf.deb ... 299s Unpacking llvm-runtime:armhf (1:19.0-60~exp1) ... 299s Selecting previously unselected package llvm-19-linker-tools. 299s Preparing to unpack .../432-llvm-19-linker-tools_1%3a19.1.2-1ubuntu1_armhf.deb ... 299s Unpacking llvm-19-linker-tools (1:19.1.2-1ubuntu1) ... 299s Selecting previously unselected package libpfm4:armhf. 299s Preparing to unpack .../433-libpfm4_4.13.0+git32-g0d4ed0e-1_armhf.deb ... 299s Unpacking libpfm4:armhf (4.13.0+git32-g0d4ed0e-1) ... 299s Selecting previously unselected package llvm-19. 299s Preparing to unpack .../434-llvm-19_1%3a19.1.2-1ubuntu1_armhf.deb ... 299s Unpacking llvm-19 (1:19.1.2-1ubuntu1) ... 300s Selecting previously unselected package llvm. 300s Preparing to unpack .../435-llvm_1%3a19.0-60~exp1_armhf.deb ... 300s Unpacking llvm (1:19.0-60~exp1) ... 300s Selecting previously unselected package binutils-mingw-w64-x86-64. 300s Preparing to unpack .../436-binutils-mingw-w64-x86-64_2.43.1-4ubuntu1+12_armhf.deb ... 300s Unpacking binutils-mingw-w64-x86-64 (2.43.1-4ubuntu1+12) ... 300s Selecting previously unselected package binutils-mingw-w64-i686. 300s Preparing to unpack .../437-binutils-mingw-w64-i686_2.43.1-4ubuntu1+12_armhf.deb ... 300s Unpacking binutils-mingw-w64-i686 (2.43.1-4ubuntu1+12) ... 300s Selecting previously unselected package librust-python3-dll-a-dev:armhf. 300s Preparing to unpack .../438-librust-python3-dll-a-dev_0.2.10-1_armhf.deb ... 300s Unpacking librust-python3-dll-a-dev:armhf (0.2.10-1) ... 300s Selecting previously unselected package librust-target-lexicon-dev:armhf. 300s Preparing to unpack .../439-librust-target-lexicon-dev_0.12.14-1_armhf.deb ... 300s Unpacking librust-target-lexicon-dev:armhf (0.12.14-1) ... 300s Selecting previously unselected package librust-pyo3-build-config-dev:armhf. 300s Preparing to unpack .../440-librust-pyo3-build-config-dev_0.22.2-1_armhf.deb ... 300s Unpacking librust-pyo3-build-config-dev:armhf (0.22.2-1) ... 300s Selecting previously unselected package python3.12-dev. 300s Preparing to unpack .../441-python3.12-dev_3.12.7-1_armhf.deb ... 300s Unpacking python3.12-dev (3.12.7-1) ... 300s Selecting previously unselected package librust-pyo3-ffi-dev:armhf. 300s Preparing to unpack .../442-librust-pyo3-ffi-dev_0.22.2-1_armhf.deb ... 300s Unpacking librust-pyo3-ffi-dev:armhf (0.22.2-1) ... 300s Selecting previously unselected package librust-pyo3-macros-backend-dev:armhf. 300s Preparing to unpack .../443-librust-pyo3-macros-backend-dev_0.22.2-1_armhf.deb ... 300s Unpacking librust-pyo3-macros-backend-dev:armhf (0.22.2-1) ... 300s Selecting previously unselected package librust-pyo3-macros-dev:armhf. 300s Preparing to unpack .../444-librust-pyo3-macros-dev_0.22.2-1_armhf.deb ... 300s Unpacking librust-pyo3-macros-dev:armhf (0.22.2-1) ... 300s Selecting previously unselected package librust-rust-decimal-dev:armhf. 300s Preparing to unpack .../445-librust-rust-decimal-dev_1.36.0-1_armhf.deb ... 300s Unpacking librust-rust-decimal-dev:armhf (1.36.0-1) ... 300s Selecting previously unselected package librust-unindent-dev:armhf. 300s Preparing to unpack .../446-librust-unindent-dev_0.2.3-1_armhf.deb ... 300s Unpacking librust-unindent-dev:armhf (0.2.3-1) ... 300s Selecting previously unselected package librust-pyo3-dev:armhf. 300s Preparing to unpack .../447-librust-pyo3-dev_0.22.2-4_armhf.deb ... 300s Unpacking librust-pyo3-dev:armhf (0.22.2-4) ... 300s Selecting previously unselected package librust-rustc-hash-dev:armhf. 300s Preparing to unpack .../448-librust-rustc-hash-dev_1.1.0-1_armhf.deb ... 300s Unpacking librust-rustc-hash-dev:armhf (1.1.0-1) ... 301s Selecting previously unselected package pybuild-plugin-autopkgtest. 301s Preparing to unpack .../449-pybuild-plugin-autopkgtest_6.20240824_all.deb ... 301s Unpacking pybuild-plugin-autopkgtest (6.20240824) ... 301s Selecting previously unselected package python3-packaging. 301s Preparing to unpack .../450-python3-packaging_24.1-1_all.deb ... 301s Unpacking python3-packaging (24.1-1) ... 301s Selecting previously unselected package python3-pyproject-hooks. 301s Preparing to unpack .../451-python3-pyproject-hooks_1.2.0-1_all.deb ... 301s Unpacking python3-pyproject-hooks (1.2.0-1) ... 301s Selecting previously unselected package python3-toml. 301s Preparing to unpack .../452-python3-toml_0.10.2-1_all.deb ... 301s Unpacking python3-toml (0.10.2-1) ... 301s Selecting previously unselected package python3-wheel. 301s Preparing to unpack .../453-python3-wheel_0.44.0-1_all.deb ... 301s Unpacking python3-wheel (0.44.0-1) ... 301s Selecting previously unselected package python3-build. 301s Preparing to unpack .../454-python3-build_1.2.1-1_all.deb ... 301s Unpacking python3-build (1.2.1-1) ... 301s Selecting previously unselected package python3-installer. 301s Preparing to unpack .../455-python3-installer_0.7.0+dfsg1-3_all.deb ... 301s Unpacking python3-installer (0.7.0+dfsg1-3) ... 301s Selecting previously unselected package pybuild-plugin-pyproject. 301s Preparing to unpack .../456-pybuild-plugin-pyproject_6.20240824_all.deb ... 301s Unpacking pybuild-plugin-pyproject (6.20240824) ... 301s Selecting previously unselected package python3-all. 301s Preparing to unpack .../457-python3-all_3.12.6-0ubuntu1_armhf.deb ... 301s Unpacking python3-all (3.12.6-0ubuntu1) ... 301s Selecting previously unselected package python3-six. 301s Preparing to unpack .../458-python3-six_1.16.0-7_all.deb ... 301s Unpacking python3-six (1.16.0-7) ... 301s Selecting previously unselected package python3-dateutil. 301s Preparing to unpack .../459-python3-dateutil_2.9.0-2_all.deb ... 301s Unpacking python3-dateutil (2.9.0-2) ... 301s Selecting previously unselected package python3-sortedcontainers. 301s Preparing to unpack .../460-python3-sortedcontainers_2.4.0-2_all.deb ... 301s Unpacking python3-sortedcontainers (2.4.0-2) ... 301s Selecting previously unselected package python3-hypothesis. 301s Preparing to unpack .../461-python3-hypothesis_6.105.1-1_all.deb ... 301s Unpacking python3-hypothesis (6.105.1-1) ... 301s Selecting previously unselected package python3-iniconfig. 301s Preparing to unpack .../462-python3-iniconfig_1.1.1-2_all.deb ... 301s Unpacking python3-iniconfig (1.1.1-2) ... 301s Selecting previously unselected package python3-pluggy. 301s Preparing to unpack .../463-python3-pluggy_1.5.0-1_all.deb ... 301s Unpacking python3-pluggy (1.5.0-1) ... 301s Selecting previously unselected package python3-pytest. 301s Preparing to unpack .../464-python3-pytest_8.3.2-1_all.deb ... 301s Unpacking python3-pytest (8.3.2-1) ... 301s Selecting previously unselected package python3-regex. 301s Preparing to unpack .../465-python3-regex_0.1.20240724-1_armhf.deb ... 301s Unpacking python3-regex (0.1.20240724-1) ... 301s Selecting previously unselected package python3-semantic-version. 301s Preparing to unpack .../466-python3-semantic-version_2.10.0-2_all.deb ... 301s Unpacking python3-semantic-version (2.10.0-2) ... 301s Selecting previously unselected package rustc. 301s Preparing to unpack .../467-rustc_1.80.1ubuntu2_armhf.deb ... 301s Unpacking rustc (1.80.1ubuntu2) ... 301s Selecting previously unselected package cargo. 301s Preparing to unpack .../468-cargo_1.80.1ubuntu2_armhf.deb ... 301s Unpacking cargo (1.80.1ubuntu2) ... 302s Selecting previously unselected package python3-setuptools-rust. 302s Preparing to unpack .../469-python3-setuptools-rust_1.9.0+dfsg-2_all.deb ... 302s Unpacking python3-setuptools-rust (1.9.0+dfsg-2) ... 302s Selecting previously unselected package python3-tiktoken. 302s Preparing to unpack .../470-python3-tiktoken_0.8.0-1_armhf.deb ... 302s Unpacking python3-tiktoken (0.8.0-1) ... 302s Selecting previously unselected package autopkgtest-satdep. 302s Preparing to unpack .../471-1-autopkgtest-satdep.deb ... 302s Unpacking autopkgtest-satdep (0) ... 302s Setting up dh-python (6.20240824) ... 302s Setting up librust-ciborium-io-dev:armhf (0.2.2-1) ... 302s Setting up librust-crossbeam-utils-dev:armhf (0.8.19-1) ... 302s Setting up librust-parking-dev:armhf (2.2.0-1) ... 302s Setting up librust-ppv-lite86-dev:armhf (0.2.16-1) ... 302s Setting up python3-iniconfig (1.1.1-2) ... 302s Setting up libllvm19:armhf (1:19.1.2-1ubuntu1) ... 302s Setting up libsharpyuv0:armhf (1.4.0-0.1) ... 302s Setting up librust-pin-utils-dev:armhf (0.1.0-1) ... 302s Setting up librust-fnv-dev:armhf (1.0.7-1) ... 302s Setting up librust-libc-dev:armhf (0.2.155-1) ... 302s Setting up librust-unindent-dev:armhf (0.2.3-1) ... 302s Setting up librust-quick-error-dev:armhf (2.0.1-1) ... 302s Setting up librust-is-terminal-dev:armhf (0.4.13-1) ... 302s Setting up librust-traitobject-dev:armhf (0.1.0-1) ... 302s Setting up librust-either-dev:armhf (1.13.0-1) ... 302s Setting up binutils-mingw-w64-x86-64 (2.43.1-4ubuntu1+12) ... 302s Setting up librust-adler-dev:armhf (1.0.2-2) ... 302s Setting up librust-version-check-dev:armhf (0.9.5-1) ... 302s Setting up librust-base64-dev:armhf (0.21.7-1) ... 302s Setting up librust-indoc-dev:armhf (2.0.5-1) ... 302s Setting up librust-anstyle-dev:armhf (1.0.8-1) ... 302s Setting up librust-winapi-i686-pc-windows-gnu-dev:armhf (0.4.0-1) ... 302s Setting up librust-futures-task-dev:armhf (0.3.30-1) ... 302s Setting up librust-rustc-hash-dev:armhf (1.1.0-1) ... 302s Setting up librust-wasm-bindgen-shared-dev:armhf (0.2.87-1) ... 302s Setting up libarchive-zip-perl (1.68-1) ... 302s Setting up librust-colorchoice-dev:armhf (1.0.0-1) ... 302s Setting up librust-fastrand-dev:armhf (2.1.1-1) ... 302s Setting up librust-socket2-dev:armhf (0.5.7-1) ... 302s Setting up libdebhelper-perl (13.20ubuntu1) ... 302s Setting up librust-unsafe-any-dev:armhf (0.4.2-2) ... 302s Setting up librust-tinyvec-macros-dev:armhf (0.1.0-1) ... 302s Setting up librust-num-cpus-dev:armhf (1.16.0-1) ... 302s Setting up librust-libm-dev:armhf (0.2.8-1) ... 302s Setting up librust-strsim-dev:armhf (0.11.1-1) ... 302s Setting up linux-libc-dev:armhf (6.11.0-8.8) ... 302s Setting up libwebpdecoder3:armhf (1.4.0-0.1) ... 302s Setting up m4 (1.4.19-4build1) ... 302s Setting up librust-rustc-demangle-dev:armhf (0.1.21-1) ... 302s Setting up python3-all (3.12.6-0ubuntu1) ... 302s Setting up librust-cpufeatures-dev:armhf (0.2.11-1) ... 302s Setting up librust-const-cstr-dev:armhf (0.3.0-1) ... 302s Setting up librust-fallible-iterator-dev:armhf (0.3.0-2) ... 302s Setting up librust-ryu-dev:armhf (1.0.15-1) ... 302s Setting up python3-sortedcontainers (2.4.0-2) ... 302s Setting up librust-humantime-dev:armhf (2.1.0-1) ... 302s Setting up librust-anstyle-query-dev:armhf (1.0.0-1) ... 302s Setting up librust-cast-dev:armhf (0.3.0-1) ... 302s Setting up libgomp1:armhf (14.2.0-7ubuntu1) ... 302s Setting up librust-subtle-dev:armhf (2.6.1-1) ... 302s Setting up librust-simdutf8-dev:armhf (0.1.4-4) ... 302s Setting up librust-atomic-waker-dev:armhf (1.1.2-1) ... 302s Setting up librust-miniz-oxide-dev:armhf (0.7.1-1) ... 302s Setting up librust-pin-project-lite-dev:armhf (0.2.13-1) ... 302s Setting up python3-wheel (0.44.0-1) ... 302s Setting up librust-bytes-dev:armhf (1.5.0-1) ... 302s Setting up librust-unicode-segmentation-dev:armhf (1.11.0-1) ... 302s Setting up librust-typemap-dev:armhf (0.3.3-2) ... 302s Setting up python3-six (1.16.0-7) ... 302s Setting up libpython3.12t64:armhf (3.12.7-1) ... 302s Setting up librust-compiler-builtins-dev:armhf (0.1.101-1) ... 302s Setting up librust-weezl-dev:armhf (0.1.5-1) ... 302s Setting up librust-utf8parse-dev:armhf (0.2.1-1) ... 302s Setting up librust-signal-hook-registry-dev:armhf (1.4.0-1) ... 302s Setting up librust-crossbeam-epoch-dev:armhf (0.9.18-1) ... 302s Setting up autotools-dev (20220109.1) ... 302s Setting up librust-tap-dev:armhf (1.0.1-1) ... 302s Setting up librust-errno-dev:armhf (0.3.8-1) ... 302s Setting up python3-packaging (24.1-1) ... 303s Setting up librust-array-init-dev:armhf (2.0.1-1) ... 303s Setting up libpkgconf3:armhf (1.8.1-3ubuntu1) ... 303s Setting up libpfm4:armhf (4.13.0+git32-g0d4ed0e-1) ... 303s Setting up rpcsvc-proto (1.4.2-0ubuntu7) ... 303s Setting up librust-oorandom-dev:armhf (11.1.3-1) ... 303s Setting up python3-pyproject-hooks (1.2.0-1) ... 303s Setting up libfreetype6:armhf (2.13.3+dfsg-1) ... 303s Setting up librust-rustc-std-workspace-core-dev:armhf (1.0.0-1) ... 303s Setting up librust-funty-dev:armhf (2.0.0-1) ... 303s Setting up librust-futures-io-dev:armhf (0.3.30-2) ... 303s Setting up librust-typenum-dev:armhf (1.17.0-2) ... 303s Setting up librust-core-maths-dev:armhf (0.1.0-2) ... 303s Setting up librust-stable-deref-trait-dev:armhf (1.2.0-1) ... 303s Setting up librust-critical-section-dev:armhf (1.1.3-1) ... 303s Setting up librust-scopeguard-dev:armhf (1.2.0-1) ... 303s Setting up librust-iana-time-zone-dev:armhf (0.1.60-1) ... 303s Setting up fonts-dejavu-mono (2.37-8) ... 303s Setting up libmpc3:armhf (1.3.1-1build2) ... 303s Setting up librust-rand-core-dev:armhf (0.6.4-2) ... 303s Setting up python3-semantic-version (2.10.0-2) ... 303s Setting up librust-jobserver-dev:armhf (0.1.32-1) ... 303s Setting up autopoint (0.22.5-2) ... 303s Setting up libjsoncpp25:armhf (1.9.5-6build1) ... 303s Setting up fonts-dejavu-core (2.37-8) ... 303s Setting up librust-seahash-dev:armhf (4.1.0-1) ... 303s Setting up pkgconf-bin (1.8.1-3ubuntu1) ... 303s Setting up librust-ab-glyph-rasterizer-dev:armhf (0.1.7-1) ... 303s Setting up binutils-mingw-w64-i686 (2.43.1-4ubuntu1+12) ... 303s Setting up librust-time-core-dev:armhf (0.1.2-1) ... 303s Setting up python3-regex (0.1.20240724-1) ... 303s Setting up librust-crunchy-dev:armhf (0.2.2-1) ... 303s Setting up python3-toml (0.10.2-1) ... 303s Setting up librust-unicase-dev:armhf (2.6.0-1) ... 303s Setting up librust-unicode-width-dev:armhf (0.1.13-3) ... 303s Setting up python3-installer (0.7.0+dfsg1-3) ... 303s Setting up autoconf (2.72-3) ... 303s Setting up python3-pluggy (1.5.0-1) ... 304s Setting up libwebp7:armhf (1.4.0-0.1) ... 304s Setting up libubsan1:armhf (14.2.0-7ubuntu1) ... 304s Setting up librust-unicode-ident-dev:armhf (1.0.12-1) ... 304s Setting up librust-equivalent-dev:armhf (1.0.1-1) ... 304s Setting up dwz (0.15-1build6) ... 304s Setting up librust-bitflags-1-dev:armhf (1.3.2-5) ... 304s Setting up librust-uncased-dev:armhf (0.9.6-2) ... 304s Setting up librust-slog-dev:armhf (2.7.0-1) ... 304s Setting up python3-tiktoken (0.8.0-1) ... 304s Setting up librust-pure-rust-locales-dev:armhf (0.8.1-1) ... 304s Setting up librhash0:armhf (1.4.3-3build1) ... 304s Setting up libcrypt-dev:armhf (1:4.4.36-4build1) ... 304s Setting up libasan8:armhf (14.2.0-7ubuntu1) ... 304s Setting up librust-wait-timeout-dev:armhf (0.2.0-1) ... 304s Setting up librust-ttf-parser-dev:armhf (0.24.1-1) ... 304s Setting up librust-cfg-if-dev:armhf (1.0.0-1) ... 304s Setting up debugedit (1:5.1-1) ... 304s Setting up librust-color-quant-dev:armhf (1.1.0-1) ... 304s Setting up python3-dateutil (2.9.0-2) ... 304s Setting up librust-blobby-dev:armhf (0.3.1-1) ... 304s Setting up cmake-data (3.30.3-1) ... 304s Setting up llvm-19-linker-tools (1:19.1.2-1ubuntu1) ... 304s Setting up librust-byteorder-dev:armhf (1.5.0-1) ... 304s Setting up librust-static-assertions-dev:armhf (1.1.0-1) ... 304s Setting up librust-compiler-builtins+core-dev:armhf (0.1.101-1) ... 304s Setting up librust-float-ord-dev:armhf (0.3.2-1) ... 304s Setting up librust-autocfg-dev:armhf (1.1.0-1) ... 304s Setting up libgcc-14-dev:armhf (14.2.0-7ubuntu1) ... 304s Setting up libisl23:armhf (0.27-1) ... 304s Setting up librust-time-macros-dev:armhf (0.2.16-1) ... 304s Setting up llvm-19-runtime (1:19.1.2-1ubuntu1) ... 304s Setting up librust-futures-sink-dev:armhf (0.3.31-1) ... 304s Setting up python3-build (1.2.1-1) ... 304s Setting up libsharpyuv-dev:armhf (1.4.0-0.1) ... 304s Setting up libc-dev-bin (2.40-1ubuntu3) ... 304s Setting up librust-cfg-if-0.1-dev:armhf (0.1.10-2) ... 304s Setting up librust-tinyvec-dev:armhf (1.6.0-2) ... 304s Setting up libwebpmux3:armhf (1.4.0-0.1) ... 304s Setting up librust-plotters-backend-dev:armhf (0.3.5-1) ... 304s Setting up librust-shlex-dev:armhf (1.3.0-1) ... 304s Setting up librust-indenter-dev:armhf (0.3.3-1) ... 304s Setting up librust-cpp-demangle-dev:armhf (0.4.0-1) ... 304s Setting up librust-winapi-x86-64-pc-windows-gnu-dev:armhf (0.4.0-1) ... 304s Setting up libcc1-0:armhf (14.2.0-7ubuntu1) ... 304s Setting up libbrotli-dev:armhf (1.1.0-2build2) ... 304s Setting up librust-clap-lex-dev:armhf (0.7.2-2) ... 304s Setting up libhttp-parser2.9:armhf (2.9.4-6build1) ... 304s Setting up librust-unarray-dev:armhf (0.1.4-1) ... 304s Setting up cpp-14-arm-linux-gnueabihf (14.2.0-7ubuntu1) ... 304s Setting up libllvm18:armhf (1:18.1.8-11) ... 304s Setting up librust-itertools-dev:armhf (0.10.5-1) ... 304s Setting up librust-heck-dev:armhf (0.4.1-1) ... 304s Setting up automake (1:1.16.5-1.3ubuntu1) ... 304s update-alternatives: using /usr/bin/automake-1.16 to provide /usr/bin/automake (automake) in auto mode 304s Setting up libfile-stripnondeterminism-perl (1.14.0-1) ... 304s Setting up librust-owned-ttf-parser-dev:armhf (0.24.0-1) ... 304s Setting up librust-num-threads-dev:armhf (0.1.7-1) ... 304s Setting up librust-crossbeam-epoch+std-dev:armhf (0.9.18-1) ... 304s Setting up gettext (0.22.5-2) ... 304s Setting up librust-gif-dev:armhf (0.11.3-1) ... 304s Setting up librust-crossbeam-deque-dev:armhf (0.8.5-1) ... 304s Setting up librust-tiny-keccak-dev:armhf (2.0.2-1) ... 304s Setting up librust-linux-raw-sys-dev:armhf (0.4.14-1) ... 304s Setting up pybuild-plugin-pyproject (6.20240824) ... 304s Setting up fontconfig-config (2.15.0-1.1ubuntu2) ... 304s Setting up librust-getrandom-dev:armhf (0.2.12-1) ... 304s Setting up python3-pytest (8.3.2-1) ... 305s Setting up librust-libloading-dev:armhf (0.8.5-1) ... 305s Setting up librust-memmap2-dev:armhf (0.9.3-1) ... 305s Setting up libwebpdemux2:armhf (1.4.0-0.1) ... 305s Setting up python3-hypothesis (6.105.1-1) ... 305s Setting up librust-ab-glyph-rasterizer+libm-dev:armhf (0.1.7-1) ... 305s Setting up librust-tinyvec+tinyvec-macros-dev:armhf (1.6.0-2) ... 305s Setting up librust-owning-ref-dev:armhf (0.4.1-1) ... 305s Setting up librust-memoffset-dev:armhf (0.8.0-1) ... 305s Setting up gcc-14-arm-linux-gnueabihf (14.2.0-7ubuntu1) ... 305s Setting up librust-proc-macro2-dev:armhf (1.0.86-1) ... 305s Setting up librust-compiler-builtins+rustc-dep-of-std-dev:armhf (0.1.101-1) ... 305s Setting up librust-rayon-core-dev:armhf (1.12.1-1) ... 305s Setting up librust-winapi-dev:armhf (0.3.9-1) ... 305s Setting up pkgconf:armhf (1.8.1-3ubuntu1) ... 305s Setting up librust-ab-glyph-dev:armhf (0.2.28-1) ... 305s Setting up intltool-debian (0.35.0+20060710.6) ... 305s Setting up librust-rand-core+getrandom-dev:armhf (0.6.4-2) ... 305s Setting up librust-rand-xorshift-dev:armhf (0.3.0-2) ... 305s Setting up libwebp-dev:armhf (1.4.0-0.1) ... 305s Setting up librust-anes-dev:armhf (0.1.6-1) ... 305s Setting up llvm-runtime:armhf (1:19.0-60~exp1) ... 305s Setting up librust-cc-dev:armhf (1.1.14-1) ... 305s Setting up pkg-config:armhf (1.8.1-3ubuntu1) ... 305s Setting up cpp-14 (14.2.0-7ubuntu1) ... 305s Setting up dh-strip-nondeterminism (1.14.0-1) ... 305s Setting up librust-crc32fast-dev:armhf (1.4.2-1) ... 305s Setting up librust-num-traits-dev:armhf (0.2.19-2) ... 305s Setting up librust-winapi-util-dev:armhf (0.1.6-1) ... 305s Setting up cmake (3.30.3-1) ... 305s Setting up libgit2-1.7:armhf (1.7.2+ds-1ubuntu3) ... 305s Setting up libc6-dev:armhf (2.40-1ubuntu3) ... 305s Setting up llvm-19 (1:19.1.2-1ubuntu1) ... 305s Setting up libfontconfig1:armhf (2.15.0-1.1ubuntu2) ... 305s Setting up librust-sha1-asm-dev:armhf (0.5.1-2) ... 305s Setting up librust-same-file-dev:armhf (1.0.6-1) ... 305s Setting up librust-rayon-dev:armhf (1.10.0-1) ... 305s Setting up librust-termcolor-dev:armhf (1.4.1-1) ... 305s Setting up librust-pkg-config-dev:armhf (0.3.27-1) ... 305s Setting up libstdc++-14-dev:armhf (14.2.0-7ubuntu1) ... 305s Setting up cpp-arm-linux-gnueabihf (4:14.1.0-2ubuntu1) ... 305s Setting up libstd-rust-1.80:armhf (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 305s Setting up librust-jpeg-decoder-dev:armhf (0.3.0-1) ... 305s Setting up libbz2-dev:armhf (1.0.8-6) ... 305s Setting up librust-dirs-sys-next-dev:armhf (0.1.1-1) ... 305s Setting up gcc-arm-linux-gnueabihf (4:14.1.0-2ubuntu1) ... 305s Setting up librust-cmake-dev:armhf (0.1.45-1) ... 305s Setting up librust-num-integer-dev:armhf (0.1.46-1) ... 305s Setting up librust-dirs-next-dev:armhf (2.0.0-1) ... 305s Setting up g++-14-arm-linux-gnueabihf (14.2.0-7ubuntu1) ... 305s Setting up librust-dlib-dev:armhf (0.5.2-2) ... 305s Setting up librust-sha2-asm-dev:armhf (0.6.2-2) ... 305s Setting up librust-libwebp-sys-dev:armhf (0.9.5-1build1) ... 305s Setting up po-debconf (1.0.21+nmu1) ... 305s Setting up librust-quote-dev:armhf (1.0.37-1) ... 305s Setting up librust-syn-dev:armhf (2.0.77-1) ... 305s Setting up librust-rand-core+std-dev:armhf (0.6.4-2) ... 305s Setting up librust-powerfmt-macros-dev:armhf (0.1.0-1) ... 305s Setting up gcc-14 (14.2.0-7ubuntu1) ... 305s Setting up libstd-rust-1.80-dev:armhf (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 305s Setting up libexpat1-dev:armhf (2.6.2-2) ... 305s Setting up librust-powerfmt-dev:armhf (0.2.0-1) ... 305s Setting up librust-sval-derive-dev:armhf (2.6.1-2) ... 305s Setting up uuid-dev:armhf (2.40.2-1ubuntu1) ... 305s Setting up librust-md5-asm-dev:armhf (0.5.0-2) ... 305s Setting up librust-zeroize-derive-dev:armhf (1.4.2-1) ... 305s Setting up llvm (1:19.0-60~exp1) ... 305s Setting up librust-postgres-derive-dev:armhf (0.4.5-1) ... 305s Setting up librust-syn-1-dev:armhf (1.0.109-2) ... 305s Setting up librust-clap-derive-dev:armhf (4.5.13-2) ... 305s Setting up zlib1g-dev:armhf (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 305s Setting up librust-bytecheck-derive-dev:armhf (0.6.12-1) ... 305s Setting up librust-no-panic-dev:armhf (0.1.13-1) ... 305s Setting up cpp (4:14.1.0-2ubuntu1) ... 305s Setting up librust-serde-derive-dev:armhf (1.0.210-1) ... 305s Setting up librust-walkdir-dev:armhf (2.5.0-1) ... 305s Setting up librust-zerocopy-derive-dev:armhf (0.7.32-2) ... 305s Setting up g++-14 (14.2.0-7ubuntu1) ... 305s Setting up librust-valuable-derive-dev:armhf (0.1.0-1) ... 305s Setting up librust-ghost-dev:armhf (0.1.5-1) ... 305s Setting up librust-serde-dev:armhf (1.0.210-2) ... 305s Setting up librust-bytemuck-derive-dev:armhf (1.5.0-2) ... 305s Setting up librust-derive-arbitrary-dev:armhf (1.3.2-1) ... 305s Setting up librust-allocator-api2-dev:armhf (0.2.16-1) ... 305s Setting up g++-arm-linux-gnueabihf (4:14.1.0-2ubuntu1) ... 305s Setting up librust-async-attributes-dev (1.1.2-6) ... 305s Setting up librust-rand-chacha-dev:armhf (0.3.1-2) ... 305s Setting up librust-futures-macro-dev:armhf (0.3.30-1) ... 305s Setting up librust-ctor-dev:armhf (0.1.26-1) ... 305s Setting up librust-unicode-bidi-dev:armhf (0.3.13-1) ... 305s Setting up librust-tracing-attributes-dev:armhf (0.1.27-1) ... 305s Setting up librust-ptr-meta-derive-dev:armhf (0.1.4-1) ... 305s Setting up librust-serde-fmt-dev (1.0.3-3) ... 305s Setting up libtool (2.4.7-7build1) ... 305s Setting up libpng-dev:armhf (1.6.44-1) ... 305s Setting up librust-portable-atomic-dev:armhf (1.4.3-2) ... 305s Setting up librust-tokio-macros-dev:armhf (2.4.0-2) ... 305s Setting up librust-lock-api-dev:armhf (0.4.11-1) ... 305s Setting up librust-libz-sys-dev:armhf (1.1.20-1) ... 305s Setting up libpython3.12-dev:armhf (3.12.7-1) ... 305s Setting up librust-ptr-meta-dev:armhf (0.1.4-1) ... 305s Setting up librust-inventory-dev:armhf (0.3.2-1) ... 305s Setting up librust-sval-dev:armhf (2.6.1-2) ... 305s Setting up librust-itoa-dev:armhf (1.0.9-1) ... 305s Setting up gcc (4:14.1.0-2ubuntu1) ... 305s Setting up librust-bumpalo-dev:armhf (3.16.0-1) ... 305s Setting up librust-python3-dll-a-dev:armhf (0.2.10-1) ... 305s Setting up libfreetype-dev:armhf (2.13.3+dfsg-1) ... 305s Setting up librust-siphasher-dev:armhf (0.3.10-1) ... 305s Setting up rustc-1.80 (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 305s Setting up dh-autoreconf (20) ... 305s Setting up librust-rand-core+serde-dev:armhf (0.6.4-2) ... 305s Setting up librust-sval-ref-dev:armhf (2.6.1-1) ... 305s Setting up librust-rkyv-derive-dev:armhf (0.7.44-1) ... 305s Setting up librust-zerocopy-dev:armhf (0.7.32-1) ... 305s Setting up librust-semver-dev:armhf (1.0.21-1) ... 305s Setting up python3.12-dev (3.12.7-1) ... 305s Setting up librust-bytemuck-dev:armhf (1.14.0-1) ... 305s Setting up librust-bit-vec-dev:armhf (0.6.3-1) ... 305s Setting up librust-zeroize-dev:armhf (1.8.1-1) ... 305s Setting up librust-slab-dev:armhf (0.4.9-1) ... 305s Setting up g++ (4:14.1.0-2ubuntu1) ... 305s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 305s Setting up rustc (1.80.1ubuntu2) ... 305s Setting up librust-arbitrary-dev:armhf (1.3.2-1) ... 305s Setting up librust-valuable-dev:armhf (0.1.0-4) ... 305s Setting up librust-target-lexicon-dev:armhf (0.12.14-1) ... 305s Setting up librust-serde-test-dev:armhf (1.0.171-1) ... 305s Setting up librust-bit-set-dev:armhf (0.5.2-1) ... 305s Setting up build-essential (12.10ubuntu1) ... 305s Setting up librust-concurrent-queue-dev:armhf (2.5.0-4) ... 305s Setting up cargo-1.80 (1.80.1+dfsg0ubuntu1-0ubuntu1) ... 305s Setting up librust-erased-serde-dev:armhf (0.3.31-1) ... 305s Setting up librust-radium-dev:armhf (1.1.0-1) ... 305s Setting up librust-bit-set+std-dev:armhf (0.5.2-1) ... 305s Setting up librust-phf-shared-dev:armhf (0.11.2-1) ... 305s Setting up librust-smol-str-dev:armhf (0.2.0-1) ... 305s Setting up librust-atomic-dev:armhf (0.6.0-1) ... 305s Setting up librust-generic-array-dev:armhf (0.14.7-1) ... 305s Setting up librust-half-dev:armhf (1.8.2-4) ... 305s Setting up librust-phf-dev:armhf (0.11.2-1) ... 305s Setting up librust-spin-dev:armhf (0.9.8-4) ... 305s Setting up libpython3-dev:armhf (3.12.6-0ubuntu1) ... 305s Setting up librust-sval-dynamic-dev:armhf (2.6.1-1) ... 305s Setting up librust-qoi-dev:armhf (0.4.1-2) ... 305s Setting up librust-async-task-dev (4.7.1-3) ... 305s Setting up librust-crypto-common-dev:armhf (0.1.6-1) ... 305s Setting up librust-ciborium-ll-dev:armhf (0.2.2-1) ... 305s Setting up librust-futures-core-dev:armhf (0.3.30-1) ... 305s Setting up librust-lazy-static-dev:armhf (1.4.0-2) ... 305s Setting up libfontconfig-dev:armhf (2.15.0-1.1ubuntu2) ... 305s Setting up librust-sval-buffer-dev:armhf (2.6.1-1) ... 305s Setting up librust-arrayvec-dev:armhf (0.7.4-2) ... 305s Setting up librust-rustc-version-dev:armhf (0.4.0-1) ... 305s Setting up librust-event-listener-dev (5.3.1-8) ... 305s Setting up librust-flate2-dev:armhf (1.0.27-2) ... 305s Setting up librust-freetype-sys-dev:armhf (0.13.1-1) ... 305s Setting up debhelper (13.20ubuntu1) ... 305s Setting up librust-smallvec-dev:armhf (1.13.2-1) ... 305s Setting up librust-sval-fmt-dev:armhf (2.6.1-1) ... 305s Setting up librust-const-oid-dev:armhf (0.9.3-1) ... 305s Setting up librust-anstyle-parse-dev:armhf (0.2.1-1) ... 305s Setting up cargo (1.80.1ubuntu2) ... 305s Setting up librust-ciborium-dev:armhf (0.2.2-2) ... 305s Setting up librust-block-buffer-dev:armhf (0.10.2-2) ... 305s Setting up python3-setuptools-rust (1.9.0+dfsg-2) ... 305s Setting up libpython3-all-dev:armhf (3.12.6-0ubuntu1) ... 305s Setting up librust-pathfinder-simd-dev:armhf (0.5.2-1) ... 305s Setting up librust-freetype-dev:armhf (0.7.0-4) ... 305s Setting up librust-unicode-normalization-dev:armhf (0.1.22-1) ... 305s Setting up librust-anstream-dev:armhf (0.6.7-1) ... 305s Setting up librust-bitflags-dev:armhf (2.6.0-1) ... 305s Setting up librust-regex-syntax-dev:armhf (0.8.2-1) ... 305s Setting up librust-parking-lot-core-dev:armhf (0.9.10-1) ... 305s Setting up librust-futures-channel-dev:armhf (0.3.30-1) ... 305s Setting up librust-once-cell-dev:armhf (1.19.0-1) ... 305s Setting up librust-pyo3-build-config-dev:armhf (0.22.2-1) ... 305s Setting up librust-phf-shared+uncased-dev:armhf (0.11.2-1) ... 305s Setting up librust-tiff-dev:armhf (0.9.0-1) ... 305s Setting up librust-digest-dev:armhf (0.10.7-2) ... 305s Setting up librust-md-5-dev:armhf (0.10.6-1) ... 305s Setting up librust-sval-serde-dev:armhf (2.6.1-1) ... 305s Setting up librust-parking-lot-dev:armhf (0.12.1-2build1) ... 305s Setting up librust-event-listener-strategy-dev:armhf (0.5.2-3) ... 305s Setting up librust-pyo3-macros-backend-dev:armhf (0.22.2-1) ... 305s Setting up librust-pyo3-ffi-dev:armhf (0.22.2-1) ... 305s Setting up librust-png-dev:armhf (0.17.7-3) ... 305s Setting up pybuild-plugin-autopkgtest (6.20240824) ... 305s Setting up librust-const-random-macro-dev:armhf (0.1.16-2) ... 305s Setting up librust-const-random-dev:armhf (0.1.17-2) ... 305s Setting up librust-pyo3-macros-dev:armhf (0.22.2-1) ... 305s Setting up librust-sha1-dev:armhf (0.10.6-1) ... 305s Setting up librust-ahash-dev (0.8.11-8) ... 305s Setting up librust-async-channel-dev (2.3.1-8) ... 305s Setting up librust-stringprep-dev:armhf (0.1.2-1) ... 305s Setting up librust-tracing-core-dev:armhf (0.1.32-1) ... 305s Setting up librust-async-lock-dev (3.4.0-4) ... 305s Setting up librust-eyre-dev:armhf (0.6.12-1) ... 305s Setting up librust-yeslogic-fontconfig-sys-dev:armhf (3.0.1-1) ... 305s Setting up librust-sha2-dev:armhf (0.10.8-1) ... 305s Setting up librust-hmac-dev:armhf (0.12.1-1) ... 305s Setting up librust-rustix-dev:armhf (0.38.32-1) ... 305s Setting up librust-wyz-dev:armhf (0.5.1-1) ... 305s Setting up librust-bitvec-dev:armhf (1.0.1-1) ... 305s Setting up librust-phf+uncased-dev:armhf (0.11.2-1) ... 305s Setting up librust-value-bag-sval2-dev:armhf (1.9.0-1) ... 305s Setting up librust-tempfile-dev:armhf (3.10.1-1) ... 305s Setting up librust-eyre+default-dev:armhf (0.6.12-1) ... 305s Setting up librust-rusty-fork-dev:armhf (0.3.0-1) ... 305s Setting up librust-hashbrown-dev:armhf (0.14.5-5) ... 305s Setting up librust-rusty-fork+wait-timeout-dev:armhf (0.3.0-1) ... 305s Setting up librust-terminal-size-dev:armhf (0.3.0-2) ... 305s Setting up librust-indexmap-dev:armhf (2.2.6-1) ... 305s Setting up librust-gimli-dev:armhf (0.28.1-2) ... 305s Setting up librust-webp-dev:armhf (0.2.6-1) ... 305s Setting up librust-memchr-dev:armhf (2.7.1-1) ... 305s Setting up librust-futures-util-dev:armhf (0.3.30-2) ... 305s Setting up librust-csv-core-dev:armhf (0.1.11-1) ... 305s Setting up librust-futures-lite-dev:armhf (2.3.0-2) ... 305s Setting up librust-csv-dev:armhf (1.3.0-1) ... 305s Setting up librust-serde-json-dev:armhf (1.0.128-1) ... 305s Setting up librust-async-executor-dev (1.13.1-1) ... 305s Setting up librust-futures-executor-dev:armhf (0.3.30-1) ... 305s Setting up librust-value-bag-serde1-dev:armhf (1.9.0-1) ... 305s Setting up librust-tinytemplate-dev:armhf (1.2.1-1) ... 305s Setting up librust-futures-dev:armhf (0.3.30-2) ... 306s Setting up librust-value-bag-dev:armhf (1.9.0-1) ... 306s Setting up librust-log-dev:armhf (0.4.22-1) ... 306s Setting up librust-kv-log-macro-dev (1.0.8-4) ... 306s Setting up librust-pathfinder-geometry-dev:armhf (0.5.1-1) ... 306s Setting up librust-tracing-dev:armhf (0.1.40-1) ... 306s Setting up librust-polling-dev:armhf (3.4.0-1) ... 306s Setting up librust-aho-corasick-dev:armhf (1.1.3-1) ... 306s Setting up librust-font-kit-dev:armhf (0.11.0-2) ... 306s Setting up librust-async-io-dev:armhf (2.3.3-4) ... 306s Setting up librust-blocking-dev (1.6.1-5) ... 306s Setting up librust-async-net-dev (2.0.0-4) ... 306s Setting up librust-rand-dev:armhf (0.8.5-1) ... 306s Setting up librust-mio-dev:armhf (1.0.2-1) ... 306s Setting up librust-wasm-bindgen-backend-dev:armhf (0.2.87-1) ... 306s Setting up librust-twox-hash-dev:armhf (1.6.3-1) ... 306s Setting up librust-proptest-dev:armhf (1.5.0-2) ... 306s Setting up librust-wasm-bindgen-macro-support-dev:armhf (0.2.87-1) ... 306s Setting up librust-regex-automata-dev:armhf (0.4.7-1) ... 306s Setting up librust-wasm-bindgen-macro-support+spans-dev:armhf (0.2.87-1) ... 306s Setting up librust-wasm-bindgen-macro-dev:armhf (0.2.87-1) ... 306s Setting up librust-uuid-dev:armhf (1.10.0-1) ... 306s Setting up librust-bstr-dev:armhf (1.7.0-2build1) ... 306s Setting up librust-async-signal-dev:armhf (0.2.10-1) ... 306s Setting up librust-bytecheck-dev:armhf (0.6.12-1) ... 306s Setting up librust-postgres-protocol-dev:armhf (0.6.6-2) ... 306s Setting up librust-async-fs-dev (2.1.2-4) ... 306s Setting up librust-wasm-bindgen-dev:armhf (0.2.87-1) ... 306s Setting up librust-convert-case-dev:armhf (0.6.0-2) ... 306s Setting up librust-regex-dev:armhf (1.10.6-1) ... 306s Setting up librust-fancy-regex-dev:armhf (0.11.0-2) ... 306s Setting up librust-async-process-dev (2.3.0-1) ... 306s Setting up librust-wasm-bindgen-macro+spans-dev:armhf (0.2.87-1) ... 306s Setting up librust-rend-dev:armhf (0.4.0-1) ... 306s Setting up librust-derive-more-0.99-dev:armhf (0.99.18-1) ... 306s Setting up librust-env-logger-dev:armhf (0.10.2-2) ... 306s Setting up librust-wasm-bindgen+spans-dev:armhf (0.2.87-1) ... 306s Setting up librust-wasm-bindgen+default-dev:armhf (0.2.87-1) ... 306s Setting up librust-rkyv-dev:armhf (0.7.44-1) ... 306s Setting up librust-eui48-dev:armhf (1.1.0-2) ... 306s Setting up librust-parse-zoneinfo-dev:armhf (0.3.0-1) ... 306s Setting up librust-smol-dev (2.0.1-2) ... 306s Setting up librust-js-sys-dev:armhf (0.3.64-1) ... 306s Setting up librust-num-complex-dev:armhf (0.4.6-2) ... 306s Setting up librust-approx-dev:armhf (0.5.1-1) ... 306s Setting up librust-ruzstd-dev:armhf (0.5.0-1) ... 306s Setting up librust-web-sys-dev:armhf (0.3.64-2) ... 306s Setting up librust-quickcheck-dev:armhf (1.0.3-3) ... 306s Setting up librust-geo-types-dev:armhf (0.7.11-2) ... 306s Setting up librust-deranged-dev:armhf (0.3.11-1) ... 306s Setting up librust-num-bigint-dev:armhf (0.4.6-1) ... 306s Setting up librust-num-rational-dev:armhf (0.4.1-2) ... 306s Setting up librust-chrono-dev:armhf (0.4.38-2) ... 306s Setting up librust-object-dev:armhf (0.32.2-1) ... 306s Setting up librust-image-dev:armhf (0.24.7-2) ... 306s Setting up librust-time-dev:armhf (0.3.31-2) ... 306s Setting up librust-plotters-bitmap-dev:armhf (0.3.3-3) ... 306s Setting up librust-postgres-types-dev:armhf (0.2.6-2) ... 306s Setting up librust-addr2line-dev:armhf (0.21.0-2) ... 306s Setting up librust-plotters-svg-dev:armhf (0.3.5-1) ... 306s Setting up librust-rust-decimal-dev:armhf (1.36.0-1) ... 306s Setting up librust-plotters-dev:armhf (0.3.5-4) ... 306s Setting up librust-backtrace-dev:armhf (0.3.69-2) ... 306s Setting up librust-tokio-dev:armhf (1.39.3-3) ... 306s Setting up librust-async-global-executor-dev:armhf (2.4.1-5) ... 306s Setting up librust-clap-builder-dev:armhf (4.5.15-2) ... 306s Setting up librust-clap-dev:armhf (4.5.16-1) ... 306s Setting up librust-async-std-dev (1.12.0-22) ... 306s Setting up librust-anyhow-dev:armhf (1.0.86-1) ... 306s Setting up librust-criterion-dev (0.5.1-6) ... 306s Setting up librust-phf-generator-dev:armhf (0.11.2-2) ... 306s Setting up librust-phf-codegen-dev:armhf (0.11.2-1) ... 306s Setting up librust-chrono-tz-build-dev:armhf (0.2.1-1) ... 306s Setting up librust-chrono-tz-dev:armhf (0.8.6-2) ... 306s Setting up librust-pyo3-dev:armhf (0.22.2-4) ... 306s Setting up autopkgtest-satdep (0) ... 306s Processing triggers for libc-bin (2.40-1ubuntu3) ... 306s Processing triggers for systemd (256.5-2ubuntu3) ... 306s Processing triggers for man-db (2.12.1-3) ... 307s Processing triggers for install-info (7.1.1-1) ... 369s (Reading database ... 86670 files and directories currently installed.) 369s Removing autopkgtest-satdep (0) ... 375s autopkgtest [14:59:38]: test pybuild-autopkgtest: pybuild-autopkgtest 375s autopkgtest [14:59:38]: test pybuild-autopkgtest: [----------------------- 377s pybuild-autopkgtest 377s I: pybuild base:311: cd /tmp/autopkgtest.hefNha/autopkgtest_tmp/build; python3.12 -m pytest tests 378s ============================= test session starts ============================== 378s platform linux -- Python 3.12.7, pytest-8.3.2, pluggy-1.5.0 378s rootdir: /tmp/autopkgtest.hefNha/autopkgtest_tmp/build 378s configfile: pyproject.toml 378s plugins: typeguard-4.4.1, hypothesis-6.105.1 378s collected 30 items 378s 974s tests/test_encoding.py FFFFFFFFFFFFFFFFFFFFFF [ 73%] 975s tests/test_misc.py F. [ 80%] 978s tests/test_offsets.py FF [ 86%] 979s tests/test_pickle.py F [ 90%] 981s tests/test_simple_public.py FF. [100%] 981s 981s =================================== FAILURES =================================== 981s _________________________________ test_simple __________________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/gpt-2/encodings/main/vocab.bpe', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_simple(): 981s > enc = tiktoken.get_encoding("gpt2") 981s 981s tests/test_encoding.py:15: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:18: in gpt2 981s mergeable_ranks = data_gym_to_mergeable_bpe_ranks( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:103: in data_gym_to_mergeable_bpe_ranks 981s vocab_bpe_contents = read_file_cached(vocab_bpe_file, vocab_bpe_hash).decode() 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s _____________________________ test_simple_repeated _____________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/gpt-2/encodings/main/vocab.bpe', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_simple_repeated(): 981s > enc = tiktoken.get_encoding("gpt2") 981s 981s tests/test_encoding.py:32: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:18: in gpt2 981s mergeable_ranks = data_gym_to_mergeable_bpe_ranks( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:103: in data_gym_to_mergeable_bpe_ranks 981s vocab_bpe_contents = read_file_cached(vocab_bpe_file, vocab_bpe_hash).decode() 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ______________________________ test_simple_regex _______________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_simple_regex(): 981s > enc = tiktoken.get_encoding("cl100k_base") 981s 981s tests/test_encoding.py:53: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ______________________________ test_basic_encode _______________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_basic_encode(): 981s > enc = tiktoken.get_encoding("r50k_base") 981s 981s tests/test_encoding.py:62: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ______________________________ test_encode_empty _______________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_encode_empty(): 981s > enc = tiktoken.get_encoding("r50k_base") 981s 981s tests/test_encoding.py:74: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ______________________________ test_encode_bytes _______________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_encode_bytes(): 981s > enc = tiktoken.get_encoding("cl100k_base") 981s 981s tests/test_encoding.py:79: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s _________________________ test_encode_surrogate_pairs __________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_encode_surrogate_pairs(): 981s > enc = tiktoken.get_encoding("cl100k_base") 981s 981s tests/test_encoding.py:84: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s _________________ test_catastrophically_repetitive[r50k_base] __________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'r50k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s def test_catastrophically_repetitive(make_enc: Callable[[], tiktoken.Encoding]): 981s > enc = make_enc() 981s 981s tests/test_encoding.py:96: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ________________ test_catastrophically_repetitive[cl100k_base] _________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'cl100k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s def test_catastrophically_repetitive(make_enc: Callable[[], tiktoken.Encoding]): 981s > enc = make_enc() 981s 981s tests/test_encoding.py:96: 981s _ _ _ _ _ _ _ _ _ _ _ _ _E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest.hefNha/autopkgtest_tmp/build; python3.12 -m pytest tests 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s _______________________ test_basic_roundtrip[r50k_base] ________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully.pybuild-autopkgtest: error: pybuild --autopkgtest --test-pytest -i python{version} -p 3.12 returned exit code 13 981s make: *** [/tmp/hzW6fnqaze/run:4: pybuild-autopkgtest] Error 25 981s pybuild-autopkgtest: error: /tmp/hzW6fnqaze/run pybuild-autopkgtest returned exit code 2 981s 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'r50k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s def test_basic_roundtrip(make_enc): 981s > enc = make_enc() 981s 981s tests/test_encoding.py:115: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ______________________ test_basic_roundtrip[cl100k_base] _______________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'cl100k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s def test_basic_roundtrip(make_enc): 981s > enc = make_enc() 981s 981s tests/test_encoding.py:115: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ________________________ test_hyp_roundtrip[r50k_base] _________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'r50k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s > @hypothesis.given(text=st.text()) 981s 981s tests/test_encoding.py:131: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s tests/test_encoding.py:134: in test_hyp_roundtrip 981s enc = make_enc() 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s E Falsifying example: test_hyp_roundtrip( 981s E make_enc=functools.partial(get_encoding, 'r50k_base'), 981s E text='', # or any other generated value 981s E ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s _______________________ test_hyp_roundtrip[cl100k_base] ________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'cl100k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s > @hypothesis.given(text=st.text()) 981s 981s tests/test_encoding.py:131: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s tests/test_encoding.py:134: in test_hyp_roundtrip 981s enc = make_enc() 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s E Falsifying example: test_hyp_roundtrip( 981s E make_enc=functools.partial(get_encoding, 'cl100k_base'), 981s E text='', # or any other generated value 981s E ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ____________________ test_single_token_roundtrip[r50k_base] ____________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'r50k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s def test_single_token_roundtrip(make_enc: Callable[[], tiktoken.Encoding]): 981s > enc = make_enc() 981s 981s tests/test_encoding.py:141: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ___________________ test_single_token_roundtrip[cl100k_base] ___________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'cl100k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s def test_single_token_roundtrip(make_enc: Callable[[], tiktoken.Encoding]): 981s > enc = make_enc() 981s 981s tests/test_encoding.py:141: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ______________________________ test_special_token ______________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_special_token(): 981s > enc = tiktoken.get_encoding("cl100k_base") 981s 981s tests/test_encoding.py:157: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s _____________________ test_hyp_special_ordinary[r50k_base] _____________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'r50k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s > @hypothesis.given(text=st.text()) 981s 981s tests/test_encoding.py:208: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s tests/test_encoding.py:211: in test_hyp_special_ordinary 981s enc = make_enc() 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s E Falsifying example: test_hyp_special_ordinary( 981s E make_enc=functools.partial(get_encoding, 'r50k_base'), 981s E text='', # or any other generated value 981s E ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ____________________ test_hyp_special_ordinary[cl100k_base] ____________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'cl100k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s > @hypothesis.given(text=st.text()) 981s 981s tests/test_encoding.py:208: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s tests/test_encoding.py:211: in test_hyp_special_ordinary 981s enc = make_enc() 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s E Falsifying example: test_hyp_special_ordinary( 981s E make_enc=functools.partial(get_encoding, 'cl100k_base'), 981s E text='', # or any other generated value 981s E ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s _________________________ test_batch_encode[r50k_base] _________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'r50k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s def test_batch_encode(make_enc: Callable[[], tiktoken.Encoding]): 981s > enc = make_enc() 981s 981s tests/test_encoding.py:222: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ________________________ test_batch_encode[cl100k_base] ________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'cl100k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s def test_batch_encode(make_enc: Callable[[], tiktoken.Encoding]): 981s > enc = make_enc() 981s 981s tests/test_encoding.py:222: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s _____________________ test_hyp_batch_roundtrip[r50k_base] ______________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'r50k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s > @hypothesis.given(batch=st.lists(st.text())) 981s 981s tests/test_encoding.py:237: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s tests/test_encoding.py:240: in test_hyp_batch_roundtrip 981s enc = make_enc() 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s E Falsifying example: test_hyp_batch_roundtrip( 981s E make_enc=functools.partial(get_encoding, 'r50k_base'), 981s E batch=[], # or any other generated value 981s E ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ____________________ test_hyp_batch_roundtrip[cl100k_base] _____________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'cl100k_base') 981s 981s @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) 981s > @hypothesis.given(batch=st.lists(st.text())) 981s 981s tests/test_encoding.py:237: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s tests/test_encoding.py:240: in test_hyp_batch_roundtrip 981s enc = make_enc() 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s E Falsifying example: test_hyp_batch_roundtrip( 981s E make_enc=functools.partial(get_encoding, 'cl100k_base'), 981s E batch=[], # or any other generated value 981s E ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ___________________________ test_encoding_for_model ____________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/gpt-2/encodings/main/vocab.bpe', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_encoding_for_model(): 981s > enc = tiktoken.encoding_for_model("gpt2") 981s 981s tests/test_misc.py:8: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/model.py:105: in encoding_for_model 981s return get_encoding(encoding_name_for_model(model_name)) 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:18: in gpt2 981s mergeable_ranks = data_gym_to_mergeable_bpe_ranks( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:103: in data_gym_to_mergeable_bpe_ranks 981s vocab_bpe_contents = read_file_cached(vocab_bpe_file, vocab_bpe_hash).decode() 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ________________________ test_hyp_offsets[cl100k_base] _________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s make_enc = functools.partial(, 'cl100k_base') 981s 981s @pytest.mark.parametrize("make_enc", SOME_ENCODING_FACTORIES) 981s > @hypothesis.given(data=st.data()) 981s 981s tests/test_offsets.py:29: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s tests/test_offsets.py:32: in test_hyp_offsets 981s enc = make_enc() 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s E Falsifying example: test_hyp_offsets( 981s E make_enc=functools.partial(get_encoding, 'cl100k_base'), 981s E data=data(...), 981s E ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ______________________________ test_basic_offsets ______________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/cl100k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/cl100k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_basic_offsets(): 981s > enc = tiktoken.get_encoding("cl100k_base") 981s 981s tests/test_offsets.py:50: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:76: in cl100k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s _________________________________ test_pickle __________________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/encodings/r50k_base.tiktoken', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/encodings/r50k_base.tiktoken', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_pickle(): 981s import pickle 981s 981s > enc_old = tiktoken.get_encoding("r50k_base") 981s 981s tests/test_pickle.py:7: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:34: in r50k_base 981s mergeable_ranks = load_tiktoken_bpe( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:144: in load_tiktoken_bpe 981s contents = read_file_cached(tiktoken_bpe_file, expected_hash) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s _________________________________ test_simple __________________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/gpt-2/encodings/main/vocab.bpe', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_simple(): 981s # Note that there are more actual tests, they're just not currently public :-) 981s > enc = tiktoken.get_encoding("gpt2") 981s 981s tests/test_simple_public.py:9: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:18: in gpt2 981s mergeable_ranks = data_gym_to_mergeable_bpe_ranks( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:103: in data_gym_to_mergeable_bpe_ranks 981s vocab_bpe_contents = read_file_cached(vocab_bpe_file, vocab_bpe_hash).decode() 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s ___________________________ test_encoding_for_model ____________________________ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s > sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:203: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:85: in create_connection 981s raise err 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s address = ('openaipublic.blob.core.windows.net', 443), timeout = None 981s source_address = None, socket_options = [(6, 1, 1)] 981s 981s def create_connection( 981s address: tuple[str, int], 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s source_address: tuple[str, int] | None = None, 981s socket_options: _TYPE_SOCKET_OPTIONS | None = None, 981s ) -> socket.socket: 981s """Connect to *address* and return the socket object. 981s 981s Convenience function. Connect to *address* (a 2-tuple ``(host, 981s port)``) and return the socket object. Passing the optional 981s *timeout* parameter will set the timeout on the socket instance 981s before attempting to connect. If no *timeout* is supplied, the 981s global default timeout setting returned by :func:`socket.getdefaulttimeout` 981s is used. If *source_address* is set it must be a tuple of (host, port) 981s for the socket to bind as a source address before making the connection. 981s An host of '' or port 0 tells the OS to use the default. 981s """ 981s 981s host, port = address 981s if host.startswith("["): 981s host = host.strip("[]") 981s err = None 981s 981s # Using the value from allowed_gai_family() in the context of getaddrinfo lets 981s # us select whether to work with IPv4 DNS records, IPv6 records, or both. 981s # The original create_connection function always returns all records. 981s family = allowed_gai_family() 981s 981s try: 981s host.encode("idna") 981s except UnicodeError: 981s raise LocationParseError(f"'{host}', label empty or too long") from None 981s 981s for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 981s af, socktype, proto, canonname, sa = res 981s sock = None 981s try: 981s sock = socket.socket(af, socktype, proto) 981s 981s # If provided, set socket level options before connecting. 981s _set_socket_options(sock, socket_options) 981s 981s if timeout is not _DEFAULT_TIMEOUT: 981s sock.settimeout(timeout) 981s if source_address: 981s sock.bind(source_address) 981s > sock.connect(sa) 981s E ConnectionRefusedError: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/util/connection.py:73: ConnectionRefusedError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', body = None 981s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} 981s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s redirect = False, assert_same_host = False 981s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 981s release_conn = False, chunked = False, body_pos = None, preload_content = False 981s decode_content = False, response_kw = {} 981s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/gpt-2/encodings/main/vocab.bpe', query=None, fragment=None) 981s destination_scheme = None, conn = None, release_this_conn = True 981s http_tunnel_required = False, err = None, clean_exit = False 981s 981s def urlopen( # type: ignore[override] 981s self, 981s method: str, 981s url: str, 981s body: _TYPE_BODY | None = None, 981s headers: typing.Mapping[str, str] | None = None, 981s retries: Retry | bool | int | None = None, 981s redirect: bool = True, 981s assert_same_host: bool = True, 981s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 981s pool_timeout: int | None = None, 981s release_conn: bool | None = None, 981s chunked: bool = False, 981s body_pos: _TYPE_BODY_POSITION | None = None, 981s preload_content: bool = True, 981s decode_content: bool = True, 981s **response_kw: typing.Any, 981s ) -> BaseHTTPResponse: 981s """ 981s Get a connection from the pool and perform an HTTP request. This is the 981s lowest level call for making a request, so you'll need to specify all 981s the raw details. 981s 981s .. note:: 981s 981s More commonly, it's appropriate to use a convenience method 981s such as :meth:`request`. 981s 981s .. note:: 981s 981s `release_conn` will only behave as expected if 981s `preload_content=False` because we want to make 981s `preload_content=False` the default behaviour someday soon without 981s breaking backwards compatibility. 981s 981s :param method: 981s HTTP request method (such as GET, POST, PUT, etc.) 981s 981s :param url: 981s The URL to perform the request on. 981s 981s :param body: 981s Data to send in the request body, either :class:`str`, :class:`bytes`, 981s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 981s 981s :param headers: 981s Dictionary of custom headers to send, such as User-Agent, 981s If-None-Match, etc. If None, pool headers are used. If provided, 981s these headers completely replace any pool-specific headers. 981s 981s :param retries: 981s Configure the number of retries to allow before raising a 981s :class:`~urllib3.exceptions.MaxRetryError` exception. 981s 981s Pass ``None`` to retry until you receive a response. Pass a 981s :class:`~urllib3.util.retry.Retry` object for fine-grained control 981s over different types of retries. 981s Pass an integer number to retry connection errors that many times, 981s but no other types of errors. Pass zero to never retry. 981s 981s If ``False``, then retries are disabled and any exception is raised 981s immediately. Also, instead of raising a MaxRetryError on redirects, 981s the redirect response will be returned. 981s 981s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 981s 981s :param redirect: 981s If True, automatically handle redirects (status codes 301, 302, 981s 303, 307, 308). Each redirect counts as a retry. Disabling retries 981s will disable redirect, too. 981s 981s :param assert_same_host: 981s If ``True``, will make sure that the host of the pool requests is 981s consistent else will raise HostChangedError. When ``False``, you can 981s use the pool on an HTTP proxy and request foreign hosts. 981s 981s :param timeout: 981s If specified, overrides the default timeout for this one 981s request. It may be a float (in seconds) or an instance of 981s :class:`urllib3.util.Timeout`. 981s 981s :param pool_timeout: 981s If set and the pool is set to block=True, then this method will 981s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 981s connection is available within the time period. 981s 981s :param bool preload_content: 981s If True, the response's body will be preloaded into memory. 981s 981s :param bool decode_content: 981s If True, will attempt to decode the body based on the 981s 'content-encoding' header. 981s 981s :param release_conn: 981s If False, then the urlopen call will not release the connection 981s back into the pool once a response is received (but will release if 981s you read the entire contents of the response such as when 981s `preload_content=True`). This is useful if you're not preloading 981s the response's content immediately. You will need to call 981s ``r.release_conn()`` on the response ``r`` to return the connection 981s back into the pool. If None, it takes the value of ``preload_content`` 981s which defaults to ``True``. 981s 981s :param bool chunked: 981s If True, urllib3 will send the body using chunked transfer 981s encoding. Otherwise, urllib3 will send the body using the standard 981s content-length form. Defaults to False. 981s 981s :param int body_pos: 981s Position to seek to in file-like body in the event of a retry or 981s redirect. Typically this won't need to be set because urllib3 will 981s auto-populate the value when needed. 981s """ 981s parsed_url = parse_url(url) 981s destination_scheme = parsed_url.scheme 981s 981s if headers is None: 981s headers = self.headers 981s 981s if not isinstance(retries, Retry): 981s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 981s 981s if release_conn is None: 981s release_conn = preload_content 981s 981s # Check host 981s if assert_same_host and not self.is_same_host(url): 981s raise HostChangedError(self, url, retries) 981s 981s # Ensure that the URL we're connecting to is properly encoded 981s if url.startswith("/"): 981s url = to_str(_encode_target(url)) 981s else: 981s url = to_str(parsed_url.url) 981s 981s conn = None 981s 981s # Track whether `conn` needs to be released before 981s # returning/raising/recursing. Update this variable if necessary, and 981s # leave `release_conn` constant throughout the function. That way, if 981s # the function recurses, the original value of `release_conn` will be 981s # passed down into the recursive call, and its value will be respected. 981s # 981s # See issue #651 [1] for details. 981s # 981s # [1] 981s release_this_conn = release_conn 981s 981s http_tunnel_required = connection_requires_http_tunnel( 981s self.proxy, self.proxy_config, destination_scheme 981s ) 981s 981s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 981s # have to copy the headers dict so we can safely change it without those 981s # changes being reflected in anyone else's copy. 981s if not http_tunnel_required: 981s headers = headers.copy() # type: ignore[attr-defined] 981s headers.update(self.proxy_headers) # type: ignore[union-attr] 981s 981s # Must keep the exception bound to a separate variable or else Python 3 981s # complains about UnboundLocalError. 981s err = None 981s 981s # Keep track of whether we cleanly exited the except block. This 981s # ensures we do proper cleanup in finally. 981s clean_exit = False 981s 981s # Rewind body position, if needed. Record current position 981s # for future rewinds in the event of a redirect/retry. 981s body_pos = set_file_position(body, body_pos) 981s 981s try: 981s # Request a connection from the queue. 981s timeout_obj = self._get_timeout(timeout) 981s conn = self._get_conn(timeout=pool_timeout) 981s 981s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 981s 981s # Is this a closed/new connection that requires CONNECT tunnelling? 981s if self.proxy is not None and http_tunnel_required and conn.is_closed: 981s try: 981s self._prepare_proxy(conn) 981s except (BaseSSLError, OSError, SocketTimeout) as e: 981s self._raise_timeout( 981s err=e, url=self.proxy.url, timeout_value=conn.timeout 981s ) 981s raise 981s 981s # If we're going to release the connection in ``finally:``, then 981s # the response doesn't need to know about the connection. Otherwise 981s # it will also try to release it and we'll have a double-release 981s # mess. 981s response_conn = conn if not release_conn else None 981s 981s # Make the request on the HTTPConnection object 981s > response = self._make_request( 981s conn, 981s method, 981s url, 981s timeout=timeout_obj, 981s body=body, 981s headers=headers, 981s chunked=chunked, 981s retries=retries, 981s response_conn=response_conn, 981s preload_content=preload_content, 981s decode_content=decode_content, 981s **response_kw, 981s ) 981s 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:791: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:492: in _make_request 981s raise new_e 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:468: in _make_request 981s self._validate_conn(conn) 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1097: in _validate_conn 981s conn.connect() 981s /usr/lib/python3/dist-packages/urllib3/connection.py:611: in connect 981s self.sock = sock = self._new_conn() 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s 981s def _new_conn(self) -> socket.socket: 981s """Establish a socket connection and set nodelay settings on it. 981s 981s :return: New socket connection. 981s """ 981s try: 981s sock = connection.create_connection( 981s (self._dns_host, self.port), 981s self.timeout, 981s source_address=self.source_address, 981s socket_options=self.socket_options, 981s ) 981s except socket.gaierror as e: 981s raise NameResolutionError(self.host, self, e) from e 981s except SocketTimeout as e: 981s raise ConnectTimeoutError( 981s self, 981s f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 981s ) from e 981s 981s except OSError as e: 981s > raise NewConnectionError( 981s self, f"Failed to establish a new connection: {e}" 981s ) from e 981s E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 981s 981s /usr/lib/python3/dist-packages/urllib3/connection.py:218: NewConnectionError 981s 981s The above exception was the direct cause of the following exception: 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s > resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:667: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 981s retries = retries.increment( 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 981s method = 'GET', url = '/gpt-2/encodings/main/vocab.bpe', response = None 981s error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 981s _pool = 981s _stacktrace = 981s 981s def increment( 981s self, 981s method: str | None = None, 981s url: str | None = None, 981s response: BaseHTTPResponse | None = None, 981s error: Exception | None = None, 981s _pool: ConnectionPool | None = None, 981s _stacktrace: TracebackType | None = None, 981s ) -> Retry: 981s """Return a new Retry object with incremented retry counters. 981s 981s :param response: A response object, or None, if the server did not 981s return a response. 981s :type response: :class:`~urllib3.response.BaseHTTPResponse` 981s :param Exception error: An error encountered during the request, or 981s None if the response was received successfully. 981s 981s :return: A new ``Retry`` object. 981s """ 981s if self.total is False and error: 981s # Disabled, indicate to re-raise the error. 981s raise reraise(type(error), error, _stacktrace) 981s 981s total = self.total 981s if total is not None: 981s total -= 1 981s 981s connect = self.connect 981s read = self.read 981s redirect = self.redirect 981s status_count = self.status 981s other = self.other 981s cause = "unknown" 981s status = None 981s redirect_location = None 981s 981s if error and self._is_connection_error(error): 981s # Connect retry? 981s if connect is False: 981s raise reraise(type(error), error, _stacktrace) 981s elif connect is not None: 981s connect -= 1 981s 981s elif error and self._is_read_error(error): 981s # Read retry? 981s if read is False or method is None or not self._is_method_retryable(method): 981s raise reraise(type(error), error, _stacktrace) 981s elif read is not None: 981s read -= 1 981s 981s elif error: 981s # Other retry? 981s if other is not None: 981s other -= 1 981s 981s elif response and response.get_redirect_location(): 981s # Redirect retry? 981s if redirect is not None: 981s redirect -= 1 981s cause = "too many redirects" 981s response_redirect_location = response.get_redirect_location() 981s if response_redirect_location: 981s redirect_location = response_redirect_location 981s status = response.status 981s 981s else: 981s # Incrementing because of a server error like a 500 in 981s # status_forcelist and the given method is in the allowed_methods 981s cause = ResponseError.GENERIC_ERROR 981s if response and response.status: 981s if status_count is not None: 981s status_count -= 1 981s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 981s status = response.status 981s 981s history = self.history + ( 981s RequestHistory(method, url, error, status, redirect_location), 981s ) 981s 981s new_retry = self.new( 981s total=total, 981s connect=connect, 981s read=read, 981s redirect=redirect, 981s status=status_count, 981s other=other, 981s history=history, 981s ) 981s 981s if new_retry.is_exhausted(): 981s reason = error or ResponseError(cause) 981s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 981s 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')) 981s 981s /usr/lib/python3/dist-packages/urllib3/util/retry.py:515: MaxRetryError 981s 981s During handling of the above exception, another exception occurred: 981s 981s def test_encoding_for_model(): 981s > enc = tiktoken.encoding_for_model("gpt2") 981s 981s tests/test_simple_public.py:26: 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s /usr/lib/python3/dist-packages/tiktoken/model.py:105: in encoding_for_model 981s return get_encoding(encoding_name_for_model(model_name)) 981s /usr/lib/python3/dist-packages/tiktoken/registry.py:86: in get_encoding 981s enc = Encoding(**constructor()) 981s /usr/lib/python3/dist-packages/tiktoken_ext/openai_public.py:18: in gpt2 981s mergeable_ranks = data_gym_to_mergeable_bpe_ranks( 981s /usr/lib/python3/dist-packages/tiktoken/load.py:103: in data_gym_to_mergeable_bpe_ranks 981s vocab_bpe_contents = read_file_cached(vocab_bpe_file, vocab_bpe_hash).decode() 981s /usr/lib/python3/dist-packages/tiktoken/load.py:63: in read_file_cached 981s contents = read_file(blobpath) 981s /usr/lib/python3/dist-packages/tiktoken/load.py:24: in read_file 981s resp = requests.get(blobpath) 981s /usr/lib/python3/dist-packages/requests/api.py:73: in get 981s return request("get", url, params=params, **kwargs) 981s /usr/lib/python3/dist-packages/requests/api.py:59: in request 981s return session.request(method=method, url=url, **kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 981s resp = self.send(prep, **send_kwargs) 981s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 981s r = adapter.send(request, **kwargs) 981s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 981s 981s self = 981s request = , stream = False 981s timeout = Timeout(connect=None, read=None, total=None), verify = True 981s cert = None, proxies = OrderedDict() 981s 981s def send( 981s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 981s ): 981s """Sends PreparedRequest object. Returns Response object. 981s 981s :param request: The :class:`PreparedRequest ` being sent. 981s :param stream: (optional) Whether to stream the request content. 981s :param timeout: (optional) How long to wait for the server to send 981s data before giving up, as a float, or a :ref:`(connect timeout, 981s read timeout) ` tuple. 981s :type timeout: float or tuple or urllib3 Timeout object 981s :param verify: (optional) Either a boolean, in which case it controls whether 981s we verify the server's TLS certificate, or a string, in which case it 981s must be a path to a CA bundle to use 981s :param cert: (optional) Any user-provided SSL certificate to be trusted. 981s :param proxies: (optional) The proxies dictionary to apply to the request. 981s :rtype: requests.Response 981s """ 981s 981s try: 981s conn = self.get_connection_with_tls_context( 981s request, verify, proxies=proxies, cert=cert 981s ) 981s except LocationValueError as e: 981s raise InvalidURL(e, request=request) 981s 981s self.cert_verify(conn, request.url, verify, cert) 981s url = self.request_url(request, proxies) 981s self.add_headers( 981s request, 981s stream=stream, 981s timeout=timeout, 981s verify=verify, 981s cert=cert, 981s proxies=proxies, 981s ) 981s 981s chunked = not (request.body is None or "Content-Length" in request.headers) 981s 981s if isinstance(timeout, tuple): 981s try: 981s connect, read = timeout 981s timeout = TimeoutSauce(connect=connect, read=read) 981s except ValueError: 981s raise ValueError( 981s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 981s f"or a single float to set both timeouts to the same value." 981s ) 981s elif isinstance(timeout, TimeoutSauce): 981s pass 981s else: 981s timeout = TimeoutSauce(connect=timeout, read=timeout) 981s 981s try: 981s resp = conn.urlopen( 981s method=request.method, 981s url=url, 981s body=request.body, 981s headers=request.headers, 981s redirect=False, 981s assert_same_host=False, 981s preload_content=False, 981s decode_content=False, 981s retries=self.max_retries, 981s timeout=timeout, 981s chunked=chunked, 981s ) 981s 981s except (ProtocolError, OSError) as err: 981s raise ConnectionError(err, request=request) 981s 981s except MaxRetryError as e: 981s if isinstance(e.reason, ConnectTimeoutError): 981s # TODO: Remove this in 3.0.0: see #2811 981s if not isinstance(e.reason, NewConnectionError): 981s raise ConnectTimeout(e, request=request) 981s 981s if isinstance(e.reason, ResponseError): 981s raise RetryError(e, request=request) 981s 981s if isinstance(e.reason, _ProxyError): 981s raise ProxyError(e, request=request) 981s 981s if isinstance(e.reason, _SSLError): 981s # This branch is for urllib3 v1.22 and later. 981s raise SSLError(e, request=request) 981s 981s > raise ConnectionError(e, request=request) 981s 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')) 981s 981s /usr/lib/python3/dist-packages/requests/adapters.py:700: ConnectionError 981s =========================== short test summary info ============================ 981s FAILED tests/test_encoding.py::test_simple - requests.exceptions.ConnectionEr... 981s FAILED tests/test_encoding.py::test_simple_repeated - requests.exceptions.Con... 981s FAILED tests/test_encoding.py::test_simple_regex - requests.exceptions.Connec... 981s FAILED tests/test_encoding.py::test_basic_encode - requests.exceptions.Connec... 981s FAILED tests/test_encoding.py::test_encode_empty - requests.exceptions.Connec... 981s FAILED tests/test_encoding.py::test_encode_bytes - requests.exceptions.Connec... 981s FAILED tests/test_encoding.py::test_encode_surrogate_pairs - requests.excepti... 981s FAILED tests/test_encoding.py::test_catastrophically_repetitive[r50k_base] - ... 981s FAILED tests/test_encoding.py::test_catastrophically_repetitive[cl100k_base] 981s FAILED tests/test_encoding.py::test_basic_roundtrip[r50k_base] - requests.exc... 981s FAILED tests/test_encoding.py::test_basic_roundtrip[cl100k_base] - requests.e... 981s FAILED tests/test_encoding.py::test_hyp_roundtrip[r50k_base] - requests.excep... 981s FAILED tests/test_encoding.py::test_hyp_roundtrip[cl100k_base] - requests.exc... 981s FAILED tests/test_encoding.py::test_single_token_roundtrip[r50k_base] - reque... 981s FAILED tests/test_encoding.py::test_single_token_roundtrip[cl100k_base] - req... 981s FAILED tests/test_encoding.py::test_special_token - requests.exceptions.Conne... 981s FAILED tests/test_encoding.py::test_hyp_special_ordinary[r50k_base] - request... 981s FAILED tests/test_encoding.py::test_hyp_special_ordinary[cl100k_base] - reque... 981s FAILED tests/test_encoding.py::test_batch_encode[r50k_base] - requests.except... 981s FAILED tests/test_encoding.py::test_batch_encode[cl100k_base] - requests.exce... 981s FAILED tests/test_encoding.py::test_hyp_batch_roundtrip[r50k_base] - requests... 981s FAILED tests/test_encoding.py::test_hyp_batch_roundtrip[cl100k_base] - reques... 981s FAILED tests/test_misc.py::test_encoding_for_model - requests.exceptions.Conn... 981s FAILED tests/test_offsets.py::test_hyp_offsets[cl100k_base] - requests.except... 981s FAILED tests/test_offsets.py::test_basic_offsets - requests.exceptions.Connec... 981s FAILED tests/test_pickle.py::test_pickle - requests.exceptions.ConnectionErro... 981s FAILED tests/test_simple_public.py::test_simple - requests.exceptions.Connect... 981s FAILED tests/test_simple_public.py::test_encoding_for_model - requests.except... 981s =================== 28 failed, 2 passed in 603.39s (0:10:03) =================== 981s autopkgtest [15:09:44]: test pybuild-autopkgtest: -----------------------] 986s autopkgtest [15:09:49]: test pybuild-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 986s pybuild-autopkgtest FAIL non-zero exit status 25 989s autopkgtest [15:09:52]: @@@@@@@@@@@@@@@@@@@@ summary 989s pybuild-autopkgtest FAIL non-zero exit status 25