codekingpro commited on
Commit
f69b840
·
verified ·
1 Parent(s): ba58326

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/info/about.json +16 -0
  2. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/info/hash_input.json +1 -0
  3. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/info/index.json +11 -0
  4. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/info/paths.json +0 -0
  5. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/info/repodata_record.json +19 -0
  6. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/CET +0 -0
  7. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/CST6CDT +0 -0
  8. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/Cuba +0 -0
  9. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/EET +0 -0
  10. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/EST +0 -0
  11. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/EST5EDT +0 -0
  12. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/Egypt +0 -0
  13. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/Eire +0 -0
  14. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/Factory +0 -0
  15. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/GB +0 -0
  16. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/GB-Eire +0 -0
  17. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/GMT +0 -0
  18. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/GMT+0 +0 -0
  19. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/GMT-0 +0 -0
  20. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/about.json +252 -0
  21. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/files +45 -0
  22. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/git +0 -0
  23. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/hash_input.json +3 -0
  24. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/index.json +20 -0
  25. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/licenses/LICENSE.txt +21 -0
  26. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/link.json +6 -0
  27. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/paths.json +275 -0
  28. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/recipe/conda_build_config.yaml +31 -0
  29. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/recipe/meta.yaml +94 -0
  30. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/recipe/meta.yaml.template +63 -0
  31. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/recipe/recipe-scripts-license.txt +26 -0
  32. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/repodata_record.json +28 -0
  33. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/test/run_test.bat +7 -0
  34. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/test/run_test.py +9 -0
  35. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/test/run_test.sh +8 -0
  36. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/test/test_time_dependencies.json +1 -0
  37. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/INSTALLER +1 -0
  38. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/METADATA +163 -0
  39. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/RECORD +81 -0
  40. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/REQUESTED +0 -0
  41. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/WHEEL +4 -0
  42. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/direct_url.json +1 -0
  43. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/licenses/LICENSE.txt +21 -0
  44. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/__init__.py +211 -0
  45. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/_base_connection.py +167 -0
  46. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/_collections.py +486 -0
  47. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/_request_methods.py +278 -0
  48. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/_version.py +34 -0
  49. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/connection.py +1099 -0
  50. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/connectionpool.py +1191 -0
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/info/about.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "channels": [
3
+ "https://conda.anaconda.org/conda-forge/"
4
+ ],
5
+ "description": "The Time Zone Database (called tz, tzdb or zoneinfo) contains code \n(the tzcode package) and data (this package) that represent the\nhistory of local time for many representative\nlocations around the globe. It is updated periodically to reflect\nchanges made by political bodies to time zone boundaries, UTC offsets,\nand daylight-saving rules.",
6
+ "dev_url": "https://github.com/eggert/tz",
7
+ "doc_url": "https://data.iana.org/time-zones/tz-link.html",
8
+ "extra": {
9
+ "flow_run_id": "azure_20251229.2.1",
10
+ "remote_url": "https://github.com/conda-forge/tzdata-feedstock",
11
+ "sha": "4dfa50a5927cc5741051945aa56df5d5e40c91b7"
12
+ },
13
+ "home": "https://www.iana.org/time-zones",
14
+ "license": "LicenseRef-Public-Domain",
15
+ "summary": "The Time Zone Database (called tz, tzdb or zoneinfo) data"
16
+ }
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/info/hash_input.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"CONDA_BUILD_SYSROOT": "/opt/conda-sdks/MacOSX10.13.sdk", "MACOSX_DEPLOYMENT_TARGET": "10.13", "c_compiler": "clang", "c_compiler_version": "19", "c_stdlib": "macosx_deployment_target", "c_stdlib_version": "10.13", "channel_sources": "conda-forge", "channel_targets": "conda-forge main", "target_platform": "noarch"}
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/info/index.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "build": "hc9c84f9_1",
3
+ "build_number": 1,
4
+ "depends": [],
5
+ "license": "LicenseRef-Public-Domain",
6
+ "name": "tzdata",
7
+ "noarch": "generic",
8
+ "subdir": "noarch",
9
+ "timestamp": 1767016325805,
10
+ "version": "2025c"
11
+ }
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/info/paths.json ADDED
The diff for this file is too large to render. See raw diff
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/info/repodata_record.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "build": "hc9c84f9_1",
3
+ "build_number": 1,
4
+ "build_string": "hc9c84f9_1",
5
+ "channel": "conda-forge",
6
+ "constrains": [],
7
+ "depends": [],
8
+ "fn": "tzdata-2025c-hc9c84f9_1.conda",
9
+ "license": "LicenseRef-Public-Domain",
10
+ "md5": "ad659d0a2b3e47e38d829aa8cad2d610",
11
+ "name": "tzdata",
12
+ "noarch": "generic",
13
+ "sha256": "1d30098909076af33a35017eed6f2953af1c769e273a0626a04722ac4acaba3c",
14
+ "size": 119135,
15
+ "subdir": "noarch",
16
+ "timestamp": 1767016325,
17
+ "url": "https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda",
18
+ "version": "2025c"
19
+ }
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/CET ADDED
Binary file (1.1 kB). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/CST6CDT ADDED
Binary file (1.75 kB). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/Cuba ADDED
Binary file (1.12 kB). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/EET ADDED
Binary file (682 Bytes). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/EST ADDED
Binary file (149 Bytes). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/EST5EDT ADDED
Binary file (1.74 kB). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/Egypt ADDED
Binary file (1.31 kB). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/Eire ADDED
Binary file (1.5 kB). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/Factory ADDED
Binary file (113 Bytes). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/GB ADDED
Binary file (1.6 kB). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/GB-Eire ADDED
Binary file (1.6 kB). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/GMT ADDED
Binary file (111 Bytes). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/GMT+0 ADDED
Binary file (111 Bytes). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1/share/zoneinfo/GMT-0 ADDED
Binary file (111 Bytes). View file
 
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/about.json ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "channels": [
3
+ "https://conda.anaconda.org/conda-forge"
4
+ ],
5
+ "conda_build_version": "26.3.0",
6
+ "conda_version": "26.3.2",
7
+ "dev_url": "https://github.com/urllib3/urllib3",
8
+ "doc_url": "https://urllib3.readthedocs.io/",
9
+ "env_vars": {
10
+ "CIO_TEST": "<not set>"
11
+ },
12
+ "extra": {
13
+ "copy_test_source_files": true,
14
+ "final": true,
15
+ "flow_run_id": "github_25522491322",
16
+ "recipe-maintainers": [
17
+ "shazow",
18
+ "sethmlarson",
19
+ "ocefpaf",
20
+ "pquentin",
21
+ "illia-v"
22
+ ],
23
+ "remote_url": "https://github.com/conda-forge/urllib3-feedstock",
24
+ "sha": "a9a252f019b1712e1dcd0d2a6cc982cc52b6eea8"
25
+ },
26
+ "home": "https://urllib3.readthedocs.io/",
27
+ "identifiers": [],
28
+ "keywords": [],
29
+ "license": "MIT",
30
+ "license_family": "MIT",
31
+ "license_file": "LICENSE.txt",
32
+ "root_pkgs": [
33
+ "xz 5.8.3 ha02ee65_0",
34
+ "importlib_resources 7.1.0 pyhd8ed1ab_0",
35
+ "openssl 3.6.2 h35e630c_0",
36
+ "keyring 25.7.0 pyha804496_0",
37
+ "libcurl 8.20.0 hcf29cc6_0",
38
+ "annotated-doc 0.0.4 pyhcf101f3_0",
39
+ "yaml-cpp 0.8.0 h59595ed_0",
40
+ "h11 0.16.0 pyhcf101f3_1",
41
+ "libstdcxx 15.2.0 h934c35e_18",
42
+ "zstandard 0.25.0 py312h5253ce2_1",
43
+ "libmsgpack-c 6.1.0 h54a6638_6",
44
+ "typing-inspection 0.4.2 pyhcf101f3_2",
45
+ "httpx 0.28.1 pyhd8ed1ab_0",
46
+ "pybind11-abi 11 hc364b38_1",
47
+ "reproc 14.2.7.post0 hb03c661_0",
48
+ "idna 3.13 pyhcf101f3_0",
49
+ "psutil 7.2.2 py312h5253ce2_0",
50
+ "zstd 1.5.7 hb78ec9c_6",
51
+ "hyperframe 6.1.0 pyhd8ed1ab_0",
52
+ "markupsafe 3.0.3 py312h8a5da7c_1",
53
+ "python-dotenv 1.2.2 pyhcf101f3_0",
54
+ "nlohmann_json-abi 3.12.0 h0f90c79_1",
55
+ "perl 5.32.1 7_hd590300_perl5",
56
+ "tk 8.6.13 noxft_h366c992_103",
57
+ "referencing 0.37.0 pyhcf101f3_0",
58
+ "anaconda-auth 0.14.4 pyhd8ed1ab_0",
59
+ "pcre2 10.47 haa7fec5_0",
60
+ "pysocks 1.7.1 pyha55dd90_7",
61
+ "fmt 12.1.0 hff5e90c_0",
62
+ "py-lief 0.17.6 py312h1289d80_0",
63
+ "xorg-libxdmcp 1.1.5 hb03c661_1",
64
+ "mdurl 0.1.2 pyhd8ed1ab_1",
65
+ "setuptools 82.0.1 pyh332efcf_0",
66
+ "jaraco.classes 3.4.0 pyhcf101f3_3",
67
+ "pthread-stubs 0.4 hb9d3cd8_1002",
68
+ "liblzma 5.8.3 hb03c661_0",
69
+ "yaml 0.2.5 h280c20c_3",
70
+ "jeepney 0.9.0 pyhd8ed1ab_0",
71
+ "bzip2 1.0.8 hda65f42_9",
72
+ "annotated-types 0.7.0 pyhd8ed1ab_1",
73
+ "lzo 2.10 h280c20c_1002",
74
+ "libarchive 3.8.7 gpl_hc2c16d8_100",
75
+ "libuuid 2.42 h5347b49_0",
76
+ "truststore 0.10.4 pyhcf101f3_0",
77
+ "mbedtls 3.6.3.1 h5888daf_0",
78
+ "simdjson 4.6.3 hb700be7_0",
79
+ "libgomp 15.2.0 he0feb66_18",
80
+ "ca-certificates 2026.4.22 hbd8a1cb_0",
81
+ "conda-package-handling 2.4.0 pyh7900ff3_2",
82
+ "ruamel.yaml 0.18.17 py312h5253ce2_2",
83
+ "jsonpointer 3.1.1 pyhcf101f3_0",
84
+ "pyyaml 6.0.3 py312h8a5da7c_1",
85
+ "packaging 26.2 pyhc364b38_0",
86
+ "typing-extensions 4.15.0 h396c80c_0",
87
+ "requests-toolbelt 1.0.0 pyhd8ed1ab_1",
88
+ "libxml2 2.15.3 h49c6c72_0",
89
+ "rattler-build 0.64.1 ha759004_0",
90
+ "libmamba 2.6.0 hd28c85e_0",
91
+ "libsolv 0.7.37 h9463b59_0",
92
+ "libpng 1.6.58 h421ea60_0",
93
+ "tomli 2.4.1 pyhcf101f3_0",
94
+ "xorg-libxau 1.0.12 hb03c661_1",
95
+ "semver 3.0.4 pyhcf101f3_1",
96
+ "pillow 12.2.0 py312h50c33e8_0",
97
+ "c-ares 1.34.6 hb03c661_0",
98
+ "libmambapy 2.6.0 py312h5ee1301_0",
99
+ "pkginfo 1.12.1.2 pyhd8ed1ab_0",
100
+ "backports.tarfile 1.2.0 pyhcf101f3_2",
101
+ "libgcc-ng 15.2.0 h69a702a_18",
102
+ "wheel 0.47.0 pyhd8ed1ab_0",
103
+ "tomlkit 0.14.0 pyha770c72_0",
104
+ "jinja2 3.1.6 pyhcf101f3_1",
105
+ "distro 1.9.0 pyhd8ed1ab_1",
106
+ "libglib 2.88.1 h0d30a3d_1",
107
+ "ncurses 6.6 hdb14827_0",
108
+ "libxml2-16 2.15.3 hca6bf5a_0",
109
+ "h2 4.3.0 pyhcf101f3_0",
110
+ "importlib-metadata 8.8.0 pyhcf101f3_0",
111
+ "conda-build 26.3.0 pyh31ec981_1",
112
+ "libnsl 2.0.1 hb9d3cd8_1",
113
+ "typer 0.25.1 pyhcf101f3_0",
114
+ "attrs 26.1.0 pyhcf101f3_0",
115
+ "libffi 3.5.2 h3435931_0",
116
+ "pycosat 0.6.6 py312h4c3975b_3",
117
+ "dbus 1.16.2 h24cb091_1",
118
+ "msgpack-python 1.1.2 py312hd9148b4_1",
119
+ "ripgrep 15.1.0 hdab8a38_0",
120
+ "defusedxml 0.7.1 pyhd8ed1ab_0",
121
+ "frozendict 2.4.7 py312h4c3975b_0",
122
+ "filelock 3.29.0 pyhd8ed1ab_0",
123
+ "libsqlite 3.53.1 h0c1763c_0",
124
+ "libstdcxx-ng 15.2.0 hdf11a46_18",
125
+ "lerc 4.1.0 hdb68285_0",
126
+ "soupsieve 2.8.3 pyhd8ed1ab_0",
127
+ "jaraco.functools 4.4.0 pyhcf101f3_1",
128
+ "python 3.12.13 hd63d673_0_cpython",
129
+ "libxcb 1.17.0 h8a09558_0",
130
+ "libnghttp2 1.68.1 h877daf1_0",
131
+ "liblief 0.17.6 hecca717_0",
132
+ "libssh2 1.11.1 hcf80075_0",
133
+ "su-exec 0.2 h166bdaf_1003",
134
+ "jsonpatch 1.33 pyhd8ed1ab_1",
135
+ "anaconda-cli-base 0.8.2 pyhc364b38_0",
136
+ "tini 0.19.0 h166bdaf_1",
137
+ "charset-normalizer 3.4.7 pyhd8ed1ab_0",
138
+ "archspec 0.2.5 pyhd8ed1ab_0",
139
+ "backports 1.0 pyhd8ed1ab_5",
140
+ "libexpat 2.8.0 hecca717_0",
141
+ "jsonschema 4.26.0 pyhcf101f3_0",
142
+ "evalidate 2.0.5 pyhe01879c_0",
143
+ "anaconda-client 1.14.1 pyhcf101f3_0",
144
+ "rpds-py 0.30.0 py312h868fb18_0",
145
+ "jsonschema-specifications 2025.9.1 pyhcf101f3_0",
146
+ "conda-libmamba-solver 26.4.1 pyhd8ed1ab_0",
147
+ "krb5 1.22.2 ha1258a1_0",
148
+ "xz-tools 5.8.3 hb03c661_0",
149
+ "pluggy 1.6.0 pyhf9edf01_1",
150
+ "python-dateutil 2.9.0.post0 pyhe01879c_2",
151
+ "brotli-python 1.2.0 py312hdb49522_1",
152
+ "keyutils 1.6.3 hb9d3cd8_0",
153
+ "libedit 3.1.20250104 pl5321h7949ede_0",
154
+ "pydantic 2.13.3 pyhcf101f3_0",
155
+ "pydantic-core 2.46.3 py312h868fb18_0",
156
+ "more-itertools 11.0.2 pyhcf101f3_0",
157
+ "jupyter_core 5.9.1 pyhc90fa1f_0",
158
+ "patchelf 0.17.2 h58526e2_0",
159
+ "cryptography 48.0.0 py312ha4b625e_0",
160
+ "platformdirs 4.9.6 pyhcf101f3_0",
161
+ "icu 78.3 h33c6efd_0",
162
+ "click 8.3.3 pyhc90fa1f_0",
163
+ "pyjwt 2.12.1 pyhcf101f3_0",
164
+ "libmamba-spdlog 2.6.0 hf859cbd_0",
165
+ "sniffio 1.3.1 pyhd8ed1ab_2",
166
+ "six 1.17.0 pyhe01879c_1",
167
+ "readchar 4.2.2 pyhcf101f3_0",
168
+ "python-libarchive-c 5.3 pyhe01879c_1",
169
+ "pytz 2026.2 pyhcf101f3_0",
170
+ "pygments 2.20.0 pyhd8ed1ab_0",
171
+ "openjpeg 2.5.4 h55fea9a_0",
172
+ "mamba 2.6.0 hf80e505_0",
173
+ "lcms2 2.19 h0c24ade_0",
174
+ "exceptiongroup 1.3.1 pyhd8ed1ab_0",
175
+ "rich 15.0.0 pyhcf101f3_0",
176
+ "cpp-expected 1.3.1 h171cf75_0",
177
+ "anyio 4.13.0 pyhcf101f3_0",
178
+ "python-fastjsonschema 2.21.2 pyhe01879c_0",
179
+ "pixi 0.67.2 ha759004_0",
180
+ "markdown-it-py 4.0.0 pyhd8ed1ab_0",
181
+ "typing_extensions 4.15.0 pyhcf101f3_0",
182
+ "cffi 2.0.0 py312h460c074_1",
183
+ "conda 26.3.2 py312h7900ff3_1",
184
+ "libdeflate 1.25 h17f619e_0",
185
+ "libjpeg-turbo 3.1.4.1 hb03c661_0",
186
+ "libiconv 1.18 h3b78370_2",
187
+ "libgcc 15.2.0 he0feb66_18",
188
+ "libfreetype 2.14.3 ha770c72_0",
189
+ "conda-package-streaming 0.12.0 pyhd8ed1ab_0",
190
+ "ld_impl_linux-64 2.45.1 default_hbd61a6d_102",
191
+ "httpcore 1.0.9 pyh29332c3_0",
192
+ "pycparser 2.22 pyh29332c3_1",
193
+ "libwebp-base 1.6.0 hd42ef1d_0",
194
+ "libev 4.33 hd590300_2",
195
+ "reproc-cpp 14.2.7.post0 hecca717_0",
196
+ "boltons 25.0.0 pyhd8ed1ab_0",
197
+ "_libgcc_mutex 0.1 conda_forge",
198
+ "git 2.54.0 pl5321h6d3cee1_0",
199
+ "zlib-ng 2.3.3 hceb46e0_1",
200
+ "readline 8.3 h853b02a_0",
201
+ "zipp 3.23.1 pyhcf101f3_0",
202
+ "beautifulsoup4 4.14.3 pyha770c72_0",
203
+ "pip 26.1.1 pyh8b19718_0",
204
+ "urllib3 2.6.3 pyhd8ed1ab_0",
205
+ "patch 2.8 hb03c661_1002",
206
+ "requests 2.33.1 pyhcf101f3_1",
207
+ "jaraco.context 6.1.2 pyhcf101f3_0",
208
+ "secretstorage 3.4.1 py312h7900ff3_0",
209
+ "menuinst 2.4.2 py312h7900ff3_0",
210
+ "libxcrypt 4.4.36 hd590300_1",
211
+ "hpack 4.1.0 pyhd8ed1ab_0",
212
+ "nbformat 5.10.4 pyhd8ed1ab_1",
213
+ "libfreetype6 2.14.3 h73754d4_0",
214
+ "traitlets 5.15.0 pyhcf101f3_0",
215
+ "ruamel.yaml.clib 0.2.15 py312h5253ce2_1",
216
+ "libtiff 4.7.1 h9d88235_1",
217
+ "_openmp_mutex 4.5 20_gnu",
218
+ "pydantic-settings 2.14.0 pyhcf101f3_1",
219
+ "chardet 7.4.3 pyhcf101f3_0",
220
+ "conda-index 0.11.0 pyhd8ed1ab_0",
221
+ "shellingham 1.5.4 pyhd8ed1ab_2",
222
+ "tqdm 4.67.3 pyh8f84b5b_0",
223
+ "libzlib 1.3.2 h25fd6f3_2",
224
+ "spdlog 1.17.0 hab81395_1",
225
+ "tzdata 2025c hc9c84f9_1",
226
+ "xz-gpl-tools 5.8.3 ha02ee65_0",
227
+ "certifi 2026.4.22 pyhd8ed1ab_0",
228
+ "liblzma-devel 5.8.3 hb03c661_0",
229
+ "pkce 1.0.3 pyhd8ed1ab_1",
230
+ "colorama 0.4.6 pyhd8ed1ab_1",
231
+ "python_abi 3.12 8_cp312",
232
+ "lz4-c 1.10.0 h5888daf_1",
233
+ "backports.zstd 1.4.0 py312h90b7ffd_0",
234
+ "joblib 1.5.3 pyhd8ed1ab_0",
235
+ "deprecated 1.3.1 pyhd8ed1ab_1",
236
+ "wrapt 2.1.2 py312h4c3975b_0",
237
+ "conda-oci-mirror 0.2.3 pyhd8ed1ab_1",
238
+ "conda-env 2.6.0 1",
239
+ "jq 1.8.1 h73b1eb8_0",
240
+ "pynacl 1.6.2 py312h587e1b2_1",
241
+ "conda-forge-metadata 0.13.0 pyhcf101f3_0",
242
+ "shyaml 0.6.2 pyhd3deb0d_0",
243
+ "rattler-build-conda-compat 1.4.14 pyhd8ed1ab_0",
244
+ "pygithub 2.9.1 pyhd8ed1ab_0",
245
+ "conda-forge-ci-setup 4.24.3 py312hef7310e_100",
246
+ "oras-py 0.1.14 pyhd8ed1ab_0",
247
+ "oniguruma 6.9.10 hb9d3cd8_0",
248
+ "libsodium 1.0.21 h280c20c_3"
249
+ ],
250
+ "summary": "HTTP library with thread-safe connection pooling, file post, and more.",
251
+ "tags": []
252
+ }
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/files ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ site-packages/urllib3-2.7.0.dist-info/INSTALLER
2
+ site-packages/urllib3-2.7.0.dist-info/METADATA
3
+ site-packages/urllib3-2.7.0.dist-info/RECORD
4
+ site-packages/urllib3-2.7.0.dist-info/REQUESTED
5
+ site-packages/urllib3-2.7.0.dist-info/WHEEL
6
+ site-packages/urllib3-2.7.0.dist-info/direct_url.json
7
+ site-packages/urllib3-2.7.0.dist-info/licenses/LICENSE.txt
8
+ site-packages/urllib3/__init__.py
9
+ site-packages/urllib3/_base_connection.py
10
+ site-packages/urllib3/_collections.py
11
+ site-packages/urllib3/_request_methods.py
12
+ site-packages/urllib3/_version.py
13
+ site-packages/urllib3/connection.py
14
+ site-packages/urllib3/connectionpool.py
15
+ site-packages/urllib3/contrib/__init__.py
16
+ site-packages/urllib3/contrib/emscripten/__init__.py
17
+ site-packages/urllib3/contrib/emscripten/connection.py
18
+ site-packages/urllib3/contrib/emscripten/emscripten_fetch_worker.js
19
+ site-packages/urllib3/contrib/emscripten/fetch.py
20
+ site-packages/urllib3/contrib/emscripten/request.py
21
+ site-packages/urllib3/contrib/emscripten/response.py
22
+ site-packages/urllib3/contrib/pyopenssl.py
23
+ site-packages/urllib3/contrib/socks.py
24
+ site-packages/urllib3/exceptions.py
25
+ site-packages/urllib3/fields.py
26
+ site-packages/urllib3/filepost.py
27
+ site-packages/urllib3/http2/__init__.py
28
+ site-packages/urllib3/http2/connection.py
29
+ site-packages/urllib3/http2/probe.py
30
+ site-packages/urllib3/poolmanager.py
31
+ site-packages/urllib3/py.typed
32
+ site-packages/urllib3/response.py
33
+ site-packages/urllib3/util/__init__.py
34
+ site-packages/urllib3/util/connection.py
35
+ site-packages/urllib3/util/proxy.py
36
+ site-packages/urllib3/util/request.py
37
+ site-packages/urllib3/util/response.py
38
+ site-packages/urllib3/util/retry.py
39
+ site-packages/urllib3/util/ssl_.py
40
+ site-packages/urllib3/util/ssl_match_hostname.py
41
+ site-packages/urllib3/util/ssltransport.py
42
+ site-packages/urllib3/util/timeout.py
43
+ site-packages/urllib3/util/url.py
44
+ site-packages/urllib3/util/util.py
45
+ site-packages/urllib3/util/wait.py
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/git ADDED
File without changes
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/hash_input.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "channel_targets": "conda-forge main"
3
+ }
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/index.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "arch": null,
3
+ "build": "pyhd8ed1ab_0",
4
+ "build_number": 0,
5
+ "depends": [
6
+ "backports.zstd >=1.0.0",
7
+ "brotli-python >=1.2.0",
8
+ "h2 >=4,<5",
9
+ "pysocks >=1.5.6,<2.0,!=1.5.7",
10
+ "python >=3.10"
11
+ ],
12
+ "license": "MIT",
13
+ "license_family": "MIT",
14
+ "name": "urllib3",
15
+ "noarch": "python",
16
+ "platform": null,
17
+ "subdir": "noarch",
18
+ "timestamp": 1778188657149,
19
+ "version": "2.7.0"
20
+ }
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/licenses/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2008-2020 Andrey Petrov and contributors.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/link.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "noarch": {
3
+ "type": "python"
4
+ },
5
+ "package_metadata_version": 1
6
+ }
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/paths.json ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "paths": [
3
+ {
4
+ "_path": "site-packages/urllib3-2.7.0.dist-info/INSTALLER",
5
+ "path_type": "hardlink",
6
+ "sha256": "d0edee15f91b406f3f99726e44eb990be6e34fd0345b52b910c568e0eef6a2a8",
7
+ "size_in_bytes": 5
8
+ },
9
+ {
10
+ "_path": "site-packages/urllib3-2.7.0.dist-info/METADATA",
11
+ "path_type": "hardlink",
12
+ "sha256": "66147856d30bbb6bed01c6ce3326d0f48d84ed5f286ac177633a1486b82eace5",
13
+ "size_in_bytes": 6852
14
+ },
15
+ {
16
+ "_path": "site-packages/urllib3-2.7.0.dist-info/RECORD",
17
+ "path_type": "hardlink",
18
+ "sha256": "ebebeb255f6aac3211ee74ef086cc5f5b067fc29f0f7fe46fc301027cc2ab4fb",
19
+ "size_in_bytes": 5711
20
+ },
21
+ {
22
+ "_path": "site-packages/urllib3-2.7.0.dist-info/REQUESTED",
23
+ "path_type": "hardlink",
24
+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
25
+ "size_in_bytes": 0
26
+ },
27
+ {
28
+ "_path": "site-packages/urllib3-2.7.0.dist-info/WHEEL",
29
+ "path_type": "hardlink",
30
+ "sha256": "41c708c5adba6e097513ab8ccb9f1d7865a2fb469e22491a9e01dcc64da459fc",
31
+ "size_in_bytes": 87
32
+ },
33
+ {
34
+ "_path": "site-packages/urllib3-2.7.0.dist-info/direct_url.json",
35
+ "path_type": "hardlink",
36
+ "sha256": "1c811a2903abfbb6ecf530e34a7eeedf87d001d6cb348611175c9ca4d109b2a1",
37
+ "size_in_bytes": 103
38
+ },
39
+ {
40
+ "_path": "site-packages/urllib3-2.7.0.dist-info/licenses/LICENSE.txt",
41
+ "path_type": "hardlink",
42
+ "sha256": "130e3a64d5fdd5d096a752694634a7d9df284469de86e5732100268041e3d686",
43
+ "size_in_bytes": 1093
44
+ },
45
+ {
46
+ "_path": "site-packages/urllib3/__init__.py",
47
+ "path_type": "hardlink",
48
+ "sha256": "24ca35b60d67215d40789daf10d0bf4f17e5d1ee61e86ce5f43195935ad645ba",
49
+ "size_in_bytes": 6979
50
+ },
51
+ {
52
+ "_path": "site-packages/urllib3/_base_connection.py",
53
+ "path_type": "hardlink",
54
+ "sha256": "1f37121077b1803ad152beb48cd9e20762908ddc3ded279d0f996e45f1ed0978",
55
+ "size_in_bytes": 5580
56
+ },
57
+ {
58
+ "_path": "site-packages/urllib3/_collections.py",
59
+ "path_type": "hardlink",
60
+ "sha256": "68e566da62a296fbaf4f579f006b6403ba62eb90b5342dc725fa45c6f6014bc0",
61
+ "size_in_bytes": 17522
62
+ },
63
+ {
64
+ "_path": "site-packages/urllib3/_request_methods.py",
65
+ "path_type": "hardlink",
66
+ "sha256": "802785f3948efd45385a83f0607228cffb70f9e33f1153a42c5a7c385b02ec30",
67
+ "size_in_bytes": 9931
68
+ },
69
+ {
70
+ "_path": "site-packages/urllib3/_version.py",
71
+ "path_type": "hardlink",
72
+ "sha256": "7a0a7a740c3b4bcd09ac6014358189358de2ab3792cc2e15b397374a70b74886",
73
+ "size_in_bytes": 704
74
+ },
75
+ {
76
+ "_path": "site-packages/urllib3/connection.py",
77
+ "path_type": "hardlink",
78
+ "sha256": "668b37ab12835bdf8643a695a9f050551339b280742231f163fc575a925a1532",
79
+ "size_in_bytes": 42786
80
+ },
81
+ {
82
+ "_path": "site-packages/urllib3/connectionpool.py",
83
+ "path_type": "hardlink",
84
+ "sha256": "b0616775d5d8c25c7b282e0908fd602af74d18b34af984c22437460021a3dd8f",
85
+ "size_in_bytes": 44164
86
+ },
87
+ {
88
+ "_path": "site-packages/urllib3/contrib/__init__.py",
89
+ "path_type": "hardlink",
90
+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
91
+ "size_in_bytes": 0
92
+ },
93
+ {
94
+ "_path": "site-packages/urllib3/contrib/emscripten/__init__.py",
95
+ "path_type": "hardlink",
96
+ "sha256": "c325ef7bcae6a97eecd8aa91401c43e56978f23cd63e7e7ed6efd7a100442d57",
97
+ "size_in_bytes": 836
98
+ },
99
+ {
100
+ "_path": "site-packages/urllib3/contrib/emscripten/connection.py",
101
+ "path_type": "hardlink",
102
+ "sha256": "822125b01a14b0a55445b6736fc182ac99aa5b6dd79ef8f668dc90545e36b258",
103
+ "size_in_bytes": 8960
104
+ },
105
+ {
106
+ "_path": "site-packages/urllib3/contrib/emscripten/emscripten_fetch_worker.js",
107
+ "path_type": "hardlink",
108
+ "sha256": "cf5937cd9e3f84329ddfeb4def0cf3f0b1e31c2da9c4dfeebbc07793d0fd0377",
109
+ "size_in_bytes": 3677
110
+ },
111
+ {
112
+ "_path": "site-packages/urllib3/contrib/emscripten/fetch.py",
113
+ "path_type": "hardlink",
114
+ "sha256": "e7171dfbebe217165dda7072d1a2bbdddb49f53b21d7261953f4945f09f089b9",
115
+ "size_in_bytes": 23520
116
+ },
117
+ {
118
+ "_path": "site-packages/urllib3/contrib/emscripten/request.py",
119
+ "path_type": "hardlink",
120
+ "sha256": "98bdbcb33cb52af137349856a2be633666aba7c830a650d4fbb8301996398344",
121
+ "size_in_bytes": 566
122
+ },
123
+ {
124
+ "_path": "site-packages/urllib3/contrib/emscripten/response.py",
125
+ "path_type": "hardlink",
126
+ "sha256": "083a58d0616896e47723110290cda01f9b837d80ccd042f5156afb07beb0b603",
127
+ "size_in_bytes": 9719
128
+ },
129
+ {
130
+ "_path": "site-packages/urllib3/contrib/pyopenssl.py",
131
+ "path_type": "hardlink",
132
+ "sha256": "5d963e433c93eecf1de37aa2b00e28f9e49960178890fc8131986d8f69242d9b",
133
+ "size_in_bytes": 19734
134
+ },
135
+ {
136
+ "_path": "site-packages/urllib3/contrib/socks.py",
137
+ "path_type": "hardlink",
138
+ "sha256": "ad2ba495f85ae3ebeda3ef2a48b8523e67f996644f218baa740c4a7bd6e0d910",
139
+ "size_in_bytes": 7639
140
+ },
141
+ {
142
+ "_path": "site-packages/urllib3/exceptions.py",
143
+ "path_type": "hardlink",
144
+ "sha256": "8503c7a2aa38cb0e3a7ac3525647225505d5520031580825b21e8c6f242d6be4",
145
+ "size_in_bytes": 9945
146
+ },
147
+ {
148
+ "_path": "site-packages/urllib3/fields.py",
149
+ "path_type": "hardlink",
150
+ "sha256": "6862c5015669554f856c996596f7b8021834fa91fd659050d88cfb95fa648e43",
151
+ "size_in_bytes": 10801
152
+ },
153
+ {
154
+ "_path": "site-packages/urllib3/filepost.py",
155
+ "path_type": "hardlink",
156
+ "sha256": "53c78d67e9a928a1e1ae56c7104893c7180ad7a21e8e111aeeecf8db2a80fdd2",
157
+ "size_in_bytes": 2388
158
+ },
159
+ {
160
+ "_path": "site-packages/urllib3/http2/__init__.py",
161
+ "path_type": "hardlink",
162
+ "sha256": "c73ac0487ed1e4035190f24ea2de651a70133aadca2aec97cc8e36adc9f09aab",
163
+ "size_in_bytes": 1741
164
+ },
165
+ {
166
+ "_path": "site-packages/urllib3/http2/connection.py",
167
+ "path_type": "hardlink",
168
+ "sha256": "6c7307e9f36f6adc173eb2aaadc9fbe32037a5459ca8f0e9a672b52dc2826cff",
169
+ "size_in_bytes": 12578
170
+ },
171
+ {
172
+ "_path": "site-packages/urllib3/http2/probe.py",
173
+ "path_type": "hardlink",
174
+ "sha256": "9e7024a9b8406a43a217be6bcfb5b4b9d677f047a1fee0fc7e357be0def71442",
175
+ "size_in_bytes": 3014
176
+ },
177
+ {
178
+ "_path": "site-packages/urllib3/poolmanager.py",
179
+ "path_type": "hardlink",
180
+ "sha256": "734ae1d2b7140b5b79b431ae51e188800ce512b6ac3cec16c0b881ebb957f293",
181
+ "size_in_bytes": 23895
182
+ },
183
+ {
184
+ "_path": "site-packages/urllib3/py.typed",
185
+ "path_type": "hardlink",
186
+ "sha256": "51a0ae3c56b71fc5006a46edfb91bc48f69c95d4ce1af26fd7ca4f8d42798036",
187
+ "size_in_bytes": 93
188
+ },
189
+ {
190
+ "_path": "site-packages/urllib3/response.py",
191
+ "path_type": "hardlink",
192
+ "sha256": "f525f806491da0b82cc759deea1a6dfb93e772b9c3ccfcdea82d4369285273e3",
193
+ "size_in_bytes": 53219
194
+ },
195
+ {
196
+ "_path": "site-packages/urllib3/util/__init__.py",
197
+ "path_type": "hardlink",
198
+ "sha256": "faa792d1071e8af6b3bc110a0cd142008fba00271d0ce1384ccbe8ed22cd9404",
199
+ "size_in_bytes": 1001
200
+ },
201
+ {
202
+ "_path": "site-packages/urllib3/util/connection.py",
203
+ "path_type": "hardlink",
204
+ "sha256": "2633bbdb69731e5ccb5cf4e4afd65605d86c7979cc5633126f50c92d5ad74a74",
205
+ "size_in_bytes": 4444
206
+ },
207
+ {
208
+ "_path": "site-packages/urllib3/util/proxy.py",
209
+ "path_type": "hardlink",
210
+ "sha256": "b1e3fcf90e41e9b07474cb703e3f98719650df4bc7b8ba91bbeb48d096767f3b",
211
+ "size_in_bytes": 1148
212
+ },
213
+ {
214
+ "_path": "site-packages/urllib3/util/request.py",
215
+ "path_type": "hardlink",
216
+ "sha256": "8ada670bcba0ec3e2755f0e6194091325824011510d77aff5ccc529f34f09a91",
217
+ "size_in_bytes": 8363
218
+ },
219
+ {
220
+ "_path": "site-packages/urllib3/util/response.py",
221
+ "path_type": "hardlink",
222
+ "sha256": "bd013adfdba81218f5be98c4771bb994d22124249466477ba6a965508d0164e0",
223
+ "size_in_bytes": 3374
224
+ },
225
+ {
226
+ "_path": "site-packages/urllib3/util/retry.py",
227
+ "path_type": "hardlink",
228
+ "sha256": "d989d25fefc579c312843eb5331e6cebc274fdbb541d9aeb73f064155452d4fe",
229
+ "size_in_bytes": 19577
230
+ },
231
+ {
232
+ "_path": "site-packages/urllib3/util/ssl_.py",
233
+ "path_type": "hardlink",
234
+ "sha256": "3aa7b7ac88545377b7195819a1bda1c6647c43464386b84448f94f3ff18b6954",
235
+ "size_in_bytes": 17742
236
+ },
237
+ {
238
+ "_path": "site-packages/urllib3/util/ssl_match_hostname.py",
239
+ "path_type": "hardlink",
240
+ "sha256": "16de38289cd3cc632629f7ff6573fdd658b65785a19af132d7a3ca05cbf8bd99",
241
+ "size_in_bytes": 5479
242
+ },
243
+ {
244
+ "_path": "site-packages/urllib3/util/ssltransport.py",
245
+ "path_type": "hardlink",
246
+ "sha256": "133e0ef2947fbd3f1d6a7fc5bea0584ba7600df05710c7d57ebcdc754a167e2e",
247
+ "size_in_bytes": 8847
248
+ },
249
+ {
250
+ "_path": "site-packages/urllib3/util/timeout.py",
251
+ "path_type": "hardlink",
252
+ "sha256": "e1e4f5155799654ee1ee6603d49ab639735ee1fc5e91d36f868594919bac4690",
253
+ "size_in_bytes": 10346
254
+ },
255
+ {
256
+ "_path": "site-packages/urllib3/util/url.py",
257
+ "path_type": "hardlink",
258
+ "sha256": "59187e4cc617a2c9a0a7c9bc953e07e6ca681f0e7252395c3027d4e77024a00b",
259
+ "size_in_bytes": 15205
260
+ },
261
+ {
262
+ "_path": "site-packages/urllib3/util/util.py",
263
+ "path_type": "hardlink",
264
+ "sha256": "8f795b64ad633f28b00f7e13f08809cdd5846554fee04fb4bd82098bd52378d0",
265
+ "size_in_bytes": 1146
266
+ },
267
+ {
268
+ "_path": "site-packages/urllib3/util/wait.py",
269
+ "path_type": "hardlink",
270
+ "sha256": "fe987c22b511deca8faa2d0ea29420254947e30ce419e3390a2c80ed7186b662",
271
+ "size_in_bytes": 4423
272
+ }
273
+ ],
274
+ "paths_version": 1
275
+ }
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/recipe/conda_build_config.yaml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CI: github_actions
2
+ c_compiler: gcc
3
+ channel_sources: conda-forge
4
+ channel_targets: conda-forge main
5
+ cpu_optimization_target: nocona
6
+ cran_mirror: https://cran.r-project.org
7
+ cxx_compiler: gxx
8
+ docker_image: quay.io/condaforge/linux-anvil-x86_64:alma9
9
+ extend_keys:
10
+ - pin_run_as_build
11
+ - ignore_build_only_deps
12
+ - ignore_version
13
+ - extend_keys
14
+ fortran_compiler: gfortran
15
+ ignore_build_only_deps:
16
+ - python
17
+ - numpy
18
+ lua: '5'
19
+ numpy: '1.26'
20
+ perl: 5.26.2
21
+ pin_run_as_build:
22
+ python:
23
+ max_pin: x.x
24
+ min_pin: x.x
25
+ r-base:
26
+ max_pin: x.x
27
+ min_pin: x.x
28
+ python: '3.12'
29
+ python_min: '3.10'
30
+ r_base: '3.5'
31
+ target_platform: linux-64
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/recipe/meta.yaml ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file created by conda-build 26.3.0
2
+ # meta.yaml template originally from:
3
+ # /home/conda/recipe_root, last modified Thu May 7 21:15:13 2026
4
+ # ------------------------------------------------
5
+
6
+ package:
7
+ name: urllib3
8
+ version: 2.7.0
9
+ source:
10
+ url: https://pypi.org/packages/source/u/urllib3/urllib3-2.7.0.tar.gz
11
+ sha256: 231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c
12
+ build:
13
+ number: '0'
14
+ noarch: python
15
+ script: /home/conda/feedstock_root/build_artifacts/urllib3_1778188571305/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/bin/python
16
+ -m pip install . -vv --no-deps --no-build-isolation
17
+ string: pyhd8ed1ab_0
18
+ requirements:
19
+ host:
20
+ - _openmp_mutex 4.5 20_gnu
21
+ - bzip2 1.0.8 hda65f42_9
22
+ - ca-certificates 2026.4.22 hbd8a1cb_0
23
+ - editables 0.6 pyhcf101f3_0
24
+ - hatch-vcs 0.5.0 pyhd8ed1ab_0
25
+ - hatchling 1.29.0 pyhcf101f3_0
26
+ - importlib-metadata 8.8.0 pyhcf101f3_0
27
+ - ld_impl_linux-64 2.45.1 default_hbd61a6d_102
28
+ - libexpat 2.8.0 hecca717_0
29
+ - libffi 3.5.2 h3435931_0
30
+ - libgcc 15.2.0 he0feb66_18
31
+ - libgcc-ng 15.2.0 h69a702a_18
32
+ - libgomp 15.2.0 he0feb66_18
33
+ - liblzma 5.8.3 hb03c661_0
34
+ - libnsl 2.0.1 hb9d3cd8_1
35
+ - libsqlite 3.53.1 h0c1763c_0
36
+ - libuuid 2.42 h5347b49_0
37
+ - libxcrypt 4.4.36 hd590300_1
38
+ - libzlib 1.3.2 h25fd6f3_2
39
+ - ncurses 6.6 hdb14827_0
40
+ - openssl 3.6.2 h35e630c_0
41
+ - packaging 26.2 pyhc364b38_0
42
+ - pathspec 1.1.1 pyhd8ed1ab_0
43
+ - pip 26.1.1 pyh8b19718_0
44
+ - pluggy 1.6.0 pyhf9edf01_1
45
+ - python 3.10.20 h3c07f61_0_cpython
46
+ - readline 8.3 h853b02a_0
47
+ - setuptools 82.0.1 pyh332efcf_0
48
+ - setuptools-scm 9.2.2 pyhd8ed1ab_0
49
+ - setuptools_scm 9.2.2 hd8ed1ab_0
50
+ - tk 8.6.13 noxft_h366c992_103
51
+ - tomli 2.4.1 pyhcf101f3_0
52
+ - trove-classifiers 2026.4.28.13 pyhd8ed1ab_0
53
+ - typing-extensions 4.15.0 h396c80c_0
54
+ - typing_extensions 4.15.0 pyhcf101f3_0
55
+ - tzdata 2025c hc9c84f9_1
56
+ - wheel 0.47.0 pyhd8ed1ab_0
57
+ - zipp 3.23.1 pyhcf101f3_0
58
+ - zstd 1.5.7 hb78ec9c_6
59
+ run:
60
+ - backports.zstd >=1.0.0
61
+ - brotli-python >=1.2.0
62
+ - h2 >=4,<5
63
+ - pysocks >=1.5.6,<2.0,!=1.5.7
64
+ - python >=3.10
65
+ test:
66
+ imports:
67
+ - urllib3
68
+ - urllib3.contrib
69
+ - urllib3.util
70
+ commands:
71
+ - pip check
72
+ requires:
73
+ - pip
74
+ - python 3.10.*
75
+ about:
76
+ home: https://urllib3.readthedocs.io/
77
+ license: MIT
78
+ license_family: MIT
79
+ license_file: LICENSE.txt
80
+ summary: HTTP library with thread-safe connection pooling, file post, and more.
81
+ doc_url: https://urllib3.readthedocs.io/
82
+ dev_url: https://github.com/urllib3/urllib3
83
+ extra:
84
+ recipe-maintainers:
85
+ - illia-v
86
+ - ocefpaf
87
+ - pquentin
88
+ - sethmlarson
89
+ - shazow
90
+ final: true
91
+ copy_test_source_files: true
92
+ flow_run_id: github_25522491322
93
+ remote_url: https://github.com/conda-forge/urllib3-feedstock
94
+ sha: a9a252f019b1712e1dcd0d2a6cc982cc52b6eea8
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/recipe/meta.yaml.template ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% set name = "urllib3" %}
2
+ {% set version = "2.7.0" %}
3
+
4
+
5
+ package:
6
+ name: {{ name|lower }}
7
+ version: {{ version }}
8
+
9
+ source:
10
+ url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}/urllib3-{{ version }}.tar.gz
11
+ sha256: 231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c
12
+
13
+ build:
14
+ number: 0
15
+ noarch: python
16
+ script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
17
+
18
+ requirements:
19
+ host:
20
+ - python {{ python_min }}
21
+ - hatchling >=1.27.0,<2
22
+ - hatch-vcs >=0.4.0,<0.6.0
23
+ - setuptools_scm >=8,<11
24
+ - pip
25
+ run:
26
+ - python >={{ python_min }}
27
+ # optional deps [socks]
28
+ - pysocks >=1.5.6,<2.0,!=1.5.7
29
+ # optional deps [brotli]
30
+ - brotli-python >=1.2.0
31
+ # optional deps [backports.zstd]
32
+ - backports.zstd >=1.0.0
33
+ # optional deps [h2]
34
+ - h2 >=4,<5
35
+
36
+
37
+ test:
38
+ imports:
39
+ - urllib3
40
+ - urllib3.contrib
41
+ - urllib3.util
42
+ commands:
43
+ - pip check
44
+ requires:
45
+ - pip
46
+ - python {{ python_min }}
47
+
48
+ about:
49
+ home: https://urllib3.readthedocs.io/
50
+ license: MIT
51
+ license_family: MIT
52
+ license_file: LICENSE.txt
53
+ summary: HTTP library with thread-safe connection pooling, file post, and more.
54
+ doc_url: https://urllib3.readthedocs.io/
55
+ dev_url: https://github.com/urllib3/urllib3
56
+
57
+ extra:
58
+ recipe-maintainers:
59
+ - shazow
60
+ - sethmlarson
61
+ - ocefpaf
62
+ - pquentin
63
+ - illia-v
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/recipe/recipe-scripts-license.txt ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ BSD-3-Clause license
2
+ Copyright (c) 2015-2026, conda-forge contributors
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+ 2. Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
12
+ 3. Neither the name of the copyright holder nor the names of its
13
+ contributors may be used to endorse or promote products derived from
14
+ this software without specific prior written permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
20
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26
+ DAMAGE.
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/repodata_record.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "arch": null,
3
+ "build": "pyhd8ed1ab_0",
4
+ "build_number": 0,
5
+ "build_string": "pyhd8ed1ab_0",
6
+ "channel": "conda-forge",
7
+ "constrains": [],
8
+ "depends": [
9
+ "backports.zstd >=1.0.0",
10
+ "brotli-python >=1.2.0",
11
+ "h2 >=4,<5",
12
+ "pysocks >=1.5.6,<2.0,!=1.5.7",
13
+ "python >=3.10"
14
+ ],
15
+ "fn": "urllib3-2.7.0-pyhd8ed1ab_0.conda",
16
+ "license": "MIT",
17
+ "license_family": "MIT",
18
+ "md5": "cbb88288f74dbe6ada1c6c7d0a97223e",
19
+ "name": "urllib3",
20
+ "noarch": "python",
21
+ "platform": null,
22
+ "sha256": "feff959a816f7988a0893201aa9727bbb7ee1e9cec2c4f0428269b489eb93fb4",
23
+ "size": 103560,
24
+ "subdir": "noarch",
25
+ "timestamp": 1778188657,
26
+ "url": "https://conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0.conda",
27
+ "version": "2.7.0"
28
+ }
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/test/run_test.bat ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+
2
+
3
+ @echo on
4
+
5
+ pip check
6
+ IF %ERRORLEVEL% NEQ 0 exit /B 1
7
+ exit /B 0
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/test/run_test.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ print("import: 'urllib3'")
2
+ import urllib3
3
+
4
+ print("import: 'urllib3.contrib'")
5
+ import urllib3.contrib
6
+
7
+ print("import: 'urllib3.util'")
8
+ import urllib3.util
9
+
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/test/run_test.sh ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ set -ex
4
+
5
+
6
+
7
+ pip check
8
+ exit 0
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/info/test/test_time_dependencies.json ADDED
@@ -0,0 +1 @@
 
 
1
+ ["pip", "python 3.10.*"]
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ conda
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/METADATA ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: urllib3
3
+ Version: 2.7.0
4
+ Summary: HTTP library with thread-safe connection pooling, file post, and more.
5
+ Project-URL: Changelog, https://github.com/urllib3/urllib3/blob/main/CHANGES.rst
6
+ Project-URL: Documentation, https://urllib3.readthedocs.io
7
+ Project-URL: Code, https://github.com/urllib3/urllib3
8
+ Project-URL: Issue tracker, https://github.com/urllib3/urllib3/issues
9
+ Author-email: Andrey Petrov <andrey.petrov@shazow.net>
10
+ Maintainer-email: Seth Michael Larson <sethmichaellarson@gmail.com>, Quentin Pradet <quentin@pradet.me>, Illia Volochii <illia.volochii@gmail.com>
11
+ License-Expression: MIT
12
+ License-File: LICENSE.txt
13
+ Keywords: filepost,http,httplib,https,pooling,ssl,threadsafe,urllib
14
+ Classifier: Environment :: Web Environment
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
26
+ Classifier: Programming Language :: Python :: Implementation :: CPython
27
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
28
+ Classifier: Topic :: Internet :: WWW/HTTP
29
+ Classifier: Topic :: Software Development :: Libraries
30
+ Requires-Python: >=3.10
31
+ Provides-Extra: brotli
32
+ Requires-Dist: brotli>=1.2.0; (platform_python_implementation == 'CPython') and extra == 'brotli'
33
+ Requires-Dist: brotlicffi>=1.2.0.0; (platform_python_implementation != 'CPython') and extra == 'brotli'
34
+ Provides-Extra: h2
35
+ Requires-Dist: h2<5,>=4; extra == 'h2'
36
+ Provides-Extra: socks
37
+ Requires-Dist: pysocks!=1.5.7,<2.0,>=1.5.6; extra == 'socks'
38
+ Provides-Extra: zstd
39
+ Requires-Dist: backports-zstd>=1.0.0; (python_version < '3.14') and extra == 'zstd'
40
+ Description-Content-Type: text/markdown
41
+
42
+ <h1 align="center">
43
+
44
+ ![urllib3](https://github.com/urllib3/urllib3/raw/main/docs/_static/banner_github.svg)
45
+
46
+ </h1>
47
+
48
+ <p align="center">
49
+ <a href="https://pypi.org/project/urllib3"><img alt="PyPI Version" src="https://img.shields.io/pypi/v/urllib3.svg?maxAge=86400" /></a>
50
+ <a href="https://pypi.org/project/urllib3"><img alt="Python Versions" src="https://img.shields.io/pypi/pyversions/urllib3.svg?maxAge=86400" /></a>
51
+ <a href="https://discord.gg/urllib3"><img alt="Join our Discord" src="https://img.shields.io/discord/756342717725933608?color=%237289da&label=discord" /></a>
52
+ <a href="https://github.com/urllib3/urllib3/actions?query=workflow%3ACI"><img alt="Coverage Status" src="https://img.shields.io/badge/coverage-100%25-success" /></a>
53
+ <a href="https://github.com/urllib3/urllib3/actions/workflows/ci.yml?query=branch%3Amain"><img alt="Build Status on GitHub" src="https://github.com/urllib3/urllib3/actions/workflows/ci.yml/badge.svg?branch:main&workflow:CI" /></a>
54
+ <a href="https://urllib3.readthedocs.io"><img alt="Documentation Status" src="https://readthedocs.org/projects/urllib3/badge/?version=latest" /></a><br>
55
+ <a href="https://deps.dev/pypi/urllib3"><img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/urllib3/urllib3/badge" /></a>
56
+ <a href="https://slsa.dev"><img alt="SLSA 3" src="https://slsa.dev/images/gh-badge-level3.svg" /></a>
57
+ <a href="https://bestpractices.coreinfrastructure.org/projects/6227"><img alt="CII Best Practices" src="https://bestpractices.coreinfrastructure.org/projects/6227/badge" /></a>
58
+ </p>
59
+
60
+ urllib3 is a powerful, *user-friendly* HTTP client for Python.
61
+ urllib3 brings many critical features that are missing from the Python
62
+ standard libraries:
63
+
64
+ - Thread safety.
65
+ - Connection pooling.
66
+ - Client-side SSL/TLS verification.
67
+ - File uploads with multipart encoding.
68
+ - Helpers for retrying requests and dealing with HTTP redirects.
69
+ - Support for gzip, deflate, brotli, and zstd encoding.
70
+ - Proxy support for HTTP and SOCKS.
71
+ - 100% test coverage.
72
+
73
+ ... and many more features, but most importantly: Our maintainers have a 15+
74
+ year track record of maintaining urllib3 with the highest code standards and
75
+ attention to security and safety.
76
+
77
+ [Much of the Python ecosystem already uses urllib3](https://urllib3.readthedocs.io/en/stable/#who-uses)
78
+ and you should too.
79
+
80
+
81
+ ## Installing
82
+
83
+ urllib3 can be installed with [pip](https://pip.pypa.io):
84
+
85
+ ```bash
86
+ $ python -m pip install urllib3
87
+ ```
88
+
89
+ Alternatively, you can grab the latest source code from [GitHub](https://github.com/urllib3/urllib3):
90
+
91
+ ```bash
92
+ $ git clone https://github.com/urllib3/urllib3.git
93
+ $ cd urllib3
94
+ $ pip install .
95
+ ```
96
+
97
+ ## Getting Started
98
+
99
+ urllib3 is easy to use:
100
+
101
+ ```python3
102
+ >>> import urllib3
103
+ >>> resp = urllib3.request("GET", "http://httpbin.org/robots.txt")
104
+ >>> resp.status
105
+ 200
106
+ >>> resp.data
107
+ b"User-agent: *\nDisallow: /deny\n"
108
+ ```
109
+
110
+ urllib3 has usage and reference documentation at [urllib3.readthedocs.io](https://urllib3.readthedocs.io).
111
+
112
+
113
+ ## Community
114
+
115
+ urllib3 has a [community Discord channel](https://discord.gg/urllib3) for asking questions and
116
+ collaborating with other contributors. Drop by and say hello 👋
117
+
118
+
119
+ ## Contributing
120
+
121
+ urllib3 happily accepts contributions. Please see our
122
+ [contributing documentation](https://urllib3.readthedocs.io/en/latest/contributing.html)
123
+ for some tips on getting started.
124
+
125
+
126
+ ## Security Disclosures
127
+
128
+ To report a security vulnerability, please use the
129
+ [Tidelift security contact](https://tidelift.com/security).
130
+ Tidelift will coordinate the fix and disclosure with maintainers.
131
+
132
+
133
+ ## Maintainers
134
+
135
+ Meet our maintainers since 2008:
136
+
137
+ - Current Lead: [@illia-v](https://github.com/illia-v) (Illia Volochii)
138
+ - [@sethmlarson](https://github.com/sethmlarson) (Seth M. Larson)
139
+ - [@pquentin](https://github.com/pquentin) (Quentin Pradet)
140
+ - [@theacodes](https://github.com/theacodes) (Thea Flowers)
141
+ - [@haikuginger](https://github.com/haikuginger) (Jess Shapiro)
142
+ - [@lukasa](https://github.com/lukasa) (Cory Benfield)
143
+ - [@sigmavirus24](https://github.com/sigmavirus24) (Ian Stapleton Cordasco)
144
+ - [@shazow](https://github.com/shazow) (Andrey Petrov)
145
+
146
+ 👋
147
+
148
+
149
+ ## Sponsorship
150
+
151
+ If your company benefits from this library, please consider [sponsoring its
152
+ development](https://urllib3.readthedocs.io/en/latest/sponsors.html).
153
+
154
+
155
+ ## For Enterprise
156
+
157
+ Professional support for urllib3 is available as part of the [Tidelift
158
+ Subscription][1]. Tidelift gives software development teams a single source for
159
+ purchasing and maintaining their software, with professional grade assurances
160
+ from the experts who know it best, while seamlessly integrating with existing
161
+ tools.
162
+
163
+ [1]: https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=readme
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/RECORD ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ urllib3-2.7.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2
+ urllib3-2.7.0.dist-info/METADATA,sha256=ZhR4VtMLu2vtAcbOMybQ9I2E7V8oasF3YzoUhrgurOU,6852
3
+ urllib3-2.7.0.dist-info/RECORD,,
4
+ urllib3-2.7.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ urllib3-2.7.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
6
+ urllib3-2.7.0.dist-info/direct_url.json,sha256=HIEaKQOr-7bs9TDjSn7u34fQAdbLNIYRF1ycpNEJsqE,103
7
+ urllib3-2.7.0.dist-info/licenses/LICENSE.txt,sha256=Ew46ZNX91dCWp1JpRjSn2d8oRGnehuVzIQAmgEHj1oY,1093
8
+ urllib3/__init__.py,sha256=JMo1tg1nIV1AeJ2vENC_Txfl0e5h6Gzl9DGVk1rWRbo,6979
9
+ urllib3/__pycache__/__init__.cpython-310.pyc,,
10
+ urllib3/__pycache__/_base_connection.cpython-310.pyc,,
11
+ urllib3/__pycache__/_collections.cpython-310.pyc,,
12
+ urllib3/__pycache__/_request_methods.cpython-310.pyc,,
13
+ urllib3/__pycache__/_version.cpython-310.pyc,,
14
+ urllib3/__pycache__/connection.cpython-310.pyc,,
15
+ urllib3/__pycache__/connectionpool.cpython-310.pyc,,
16
+ urllib3/__pycache__/exceptions.cpython-310.pyc,,
17
+ urllib3/__pycache__/fields.cpython-310.pyc,,
18
+ urllib3/__pycache__/filepost.cpython-310.pyc,,
19
+ urllib3/__pycache__/poolmanager.cpython-310.pyc,,
20
+ urllib3/__pycache__/response.cpython-310.pyc,,
21
+ urllib3/_base_connection.py,sha256=HzcSEHexgDrRUr60jNniB2KQjdw97SedD5luRfHtCXg,5580
22
+ urllib3/_collections.py,sha256=aOVm2mKilvuvT1efAGtkA7pi65C1NC3HJfpFxvYBS8A,17522
23
+ urllib3/_request_methods.py,sha256=gCeF85SO_UU4WoPwYHIoz_tw-eM_EVOkLFp8OFsC7DA,9931
24
+ urllib3/_version.py,sha256=egp6dAw7S80JrGAUNYGJNY3iqzeSzC4Vs5c3SnC3SIY,704
25
+ urllib3/connection.py,sha256=Zos3qxKDW9-GQ6aVqfBQVRM5soB0IjHxY_xXWpJaFTI,42786
26
+ urllib3/connectionpool.py,sha256=sGFnddXYwlx7KC4JCP1gKvdNGLNK-YTCJDdGACGj3Y8,44164
27
+ urllib3/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
+ urllib3/contrib/__pycache__/__init__.cpython-310.pyc,,
29
+ urllib3/contrib/__pycache__/pyopenssl.cpython-310.pyc,,
30
+ urllib3/contrib/__pycache__/socks.cpython-310.pyc,,
31
+ urllib3/contrib/emscripten/__init__.py,sha256=wyXve8rmqX7s2KqRQBxD5Wl48jzWPn5-1u_XoQBELVc,836
32
+ urllib3/contrib/emscripten/__pycache__/__init__.cpython-310.pyc,,
33
+ urllib3/contrib/emscripten/__pycache__/connection.cpython-310.pyc,,
34
+ urllib3/contrib/emscripten/__pycache__/fetch.cpython-310.pyc,,
35
+ urllib3/contrib/emscripten/__pycache__/request.cpython-310.pyc,,
36
+ urllib3/contrib/emscripten/__pycache__/response.cpython-310.pyc,,
37
+ urllib3/contrib/emscripten/connection.py,sha256=giElsBoUsKVURbZzb8GCrJmqW23Xnvj2aNyQVF42slg,8960
38
+ urllib3/contrib/emscripten/emscripten_fetch_worker.js,sha256=z1k3zZ4_hDKd3-tN7wzz8LHjHC2pxN_uu8B3k9D9A3c,3677
39
+ urllib3/contrib/emscripten/fetch.py,sha256=5xcd--viFxZd2nBy0aK73dtJ9Tsh1yYZU_SUXwnwibk,23520
40
+ urllib3/contrib/emscripten/request.py,sha256=mL28szy1KvE3NJhWor5jNmarp8gwplDU-7gwGZY5g0Q,566
41
+ urllib3/contrib/emscripten/response.py,sha256=CDpY0GFoluR3IxECkM2gH5uDfYDM0EL1FWr7B76wtgM,9719
42
+ urllib3/contrib/pyopenssl.py,sha256=XZY-QzyT7s8d43qisA4o-eSZYBeIkPyBMZhtj2kkLZs,19734
43
+ urllib3/contrib/socks.py,sha256=rSuklfha4-vto-8qSLhSPmf5lmRPIYuqdAxKe9bg2RA,7639
44
+ urllib3/exceptions.py,sha256=hQPHoqo4yw46esNSVkciVQXVUgAxWAglsh6MbyQta-Q,9945
45
+ urllib3/fields.py,sha256=aGLFAVZpVU-FbJlllve4Ahg0-pH9ZZBQ2Iz7lfpkjkM,10801
46
+ urllib3/filepost.py,sha256=U8eNZ-mpKKHhrlbHEEiTxxgK16IejhEa7uz42yqA_dI,2388
47
+ urllib3/http2/__init__.py,sha256=xzrASH7R5ANRkPJOot5lGnATOq3KKuyXzI42rcnwmqs,1741
48
+ urllib3/http2/__pycache__/__init__.cpython-310.pyc,,
49
+ urllib3/http2/__pycache__/connection.cpython-310.pyc,,
50
+ urllib3/http2/__pycache__/probe.cpython-310.pyc,,
51
+ urllib3/http2/connection.py,sha256=bHMH6fNvatwXPrKqrcn74yA3pUWcqPDppnK1LcKCbP8,12578
52
+ urllib3/http2/probe.py,sha256=nnAkqbhAakOiF75rz7W0udZ38Eeh_uD8fjV74N73FEI,3014
53
+ urllib3/poolmanager.py,sha256=c0rh0rcUC1t5tDGuUeGIgAzlErasPOwWwLiB67lX8pM,23895
54
+ urllib3/py.typed,sha256=UaCuPFa3H8UAakbt-5G8SPacldTOGvJv18pPjUJ5gDY,93
55
+ urllib3/response.py,sha256=9SX4BkkdoLgsx1ne6hpt-5PncrnDzPzeqC1DaShSc-M,53219
56
+ urllib3/util/__init__.py,sha256=-qeS0QceivazvBEKDNFCAI-6ACcdDOE4TMvo7SLNlAQ,1001
57
+ urllib3/util/__pycache__/__init__.cpython-310.pyc,,
58
+ urllib3/util/__pycache__/connection.cpython-310.pyc,,
59
+ urllib3/util/__pycache__/proxy.cpython-310.pyc,,
60
+ urllib3/util/__pycache__/request.cpython-310.pyc,,
61
+ urllib3/util/__pycache__/response.cpython-310.pyc,,
62
+ urllib3/util/__pycache__/retry.cpython-310.pyc,,
63
+ urllib3/util/__pycache__/ssl_.cpython-310.pyc,,
64
+ urllib3/util/__pycache__/ssl_match_hostname.cpython-310.pyc,,
65
+ urllib3/util/__pycache__/ssltransport.cpython-310.pyc,,
66
+ urllib3/util/__pycache__/timeout.cpython-310.pyc,,
67
+ urllib3/util/__pycache__/url.cpython-310.pyc,,
68
+ urllib3/util/__pycache__/util.cpython-310.pyc,,
69
+ urllib3/util/__pycache__/wait.cpython-310.pyc,,
70
+ urllib3/util/connection.py,sha256=JjO722lzHlzLXPTkr9ZWBdhseXnMVjMSb1DJLVrXSnQ,4444
71
+ urllib3/util/proxy.py,sha256=seP8-Q5B6bB0dMtwPj-YcZZQ30vHuLqRu-tI0JZ2fzs,1148
72
+ urllib3/util/request.py,sha256=itpnC8ug7D4nVfDmGUCRMlgkARUQ13r_XMxSnzTwmpE,8363
73
+ urllib3/util/response.py,sha256=vQE639uoEhj1vpjEdxu5lNIhJCSUZkd7pqllUI0BZOA,3374
74
+ urllib3/util/retry.py,sha256=2YnSX-_FecMShD61Mx5s68J0_btUHZrrc_BkFVRS1P4,19577
75
+ urllib3/util/ssl_.py,sha256=Oqe3rIhUU3e3GVgZob2hxmR8Q0ZDhrhESPlPP_GLaVQ,17742
76
+ urllib3/util/ssl_match_hostname.py,sha256=Ft44KJzTzGMmKff_ZXP91li2V4WhmvEy16PKBcv4vZk,5479
77
+ urllib3/util/ssltransport.py,sha256=Ez4O8pR_vT8dan_FvqBYS6dgDfBXEMfVfrzcdUoWfi4,8847
78
+ urllib3/util/timeout.py,sha256=4eT1FVeZZU7h7mYD1Jq2OXNe4fxekdNvhoWUkZusRpA,10346
79
+ urllib3/util/url.py,sha256=WRh-TMYXosmgp8m8lT4H5spoHw5yUjlcMCfU53AkoAs,15205
80
+ urllib3/util/util.py,sha256=j3lbZK1jPyiwD34T8IgJzdWEZVT-4E-0vYIJi9UjeNA,1146
81
+ urllib3/util/wait.py,sha256=_ph8IrUR3sqPqi0OopQgJUlH4wzkGeM5CiyA7XGGtmI,4423
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/REQUESTED ADDED
File without changes
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/WHEEL ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/direct_url.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/urllib3_1778188571305/work"}
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3-2.7.0.dist-info/licenses/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2008-2020 Andrey Petrov and contributors.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/__init__.py ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Python HTTP library with thread-safe connection pooling, file post support, user friendly, and more
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ # Set default logging handler to avoid "No handler found" warnings.
8
+ import logging
9
+ import sys
10
+ import typing
11
+ import warnings
12
+ from logging import NullHandler
13
+
14
+ from . import exceptions
15
+ from ._base_connection import _TYPE_BODY
16
+ from ._collections import HTTPHeaderDict
17
+ from ._version import __version__
18
+ from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
19
+ from .filepost import _TYPE_FIELDS, encode_multipart_formdata
20
+ from .poolmanager import PoolManager, ProxyManager, proxy_from_url
21
+ from .response import BaseHTTPResponse, HTTPResponse
22
+ from .util.request import make_headers
23
+ from .util.retry import Retry
24
+ from .util.timeout import Timeout
25
+
26
+ # Ensure that Python is compiled with OpenSSL 1.1.1+
27
+ # If the 'ssl' module isn't available at all that's
28
+ # fine, we only care if the module is available.
29
+ try:
30
+ import ssl
31
+ except ImportError:
32
+ pass
33
+ else:
34
+ if not ssl.OPENSSL_VERSION.startswith("OpenSSL "): # Defensive:
35
+ warnings.warn(
36
+ "urllib3 v2 only supports OpenSSL 1.1.1+, currently "
37
+ f"the 'ssl' module is compiled with {ssl.OPENSSL_VERSION!r}. "
38
+ "See: https://github.com/urllib3/urllib3/issues/3020",
39
+ exceptions.NotOpenSSLWarning,
40
+ )
41
+ elif ssl.OPENSSL_VERSION_INFO < (1, 1, 1): # Defensive:
42
+ raise ImportError(
43
+ "urllib3 v2 only supports OpenSSL 1.1.1+, currently "
44
+ f"the 'ssl' module is compiled with {ssl.OPENSSL_VERSION!r}. "
45
+ "See: https://github.com/urllib3/urllib3/issues/2168"
46
+ )
47
+
48
+ __author__ = "Andrey Petrov (andrey.petrov@shazow.net)"
49
+ __license__ = "MIT"
50
+ __version__ = __version__
51
+
52
+ __all__ = (
53
+ "HTTPConnectionPool",
54
+ "HTTPHeaderDict",
55
+ "HTTPSConnectionPool",
56
+ "PoolManager",
57
+ "ProxyManager",
58
+ "HTTPResponse",
59
+ "Retry",
60
+ "Timeout",
61
+ "add_stderr_logger",
62
+ "connection_from_url",
63
+ "disable_warnings",
64
+ "encode_multipart_formdata",
65
+ "make_headers",
66
+ "proxy_from_url",
67
+ "request",
68
+ "BaseHTTPResponse",
69
+ )
70
+
71
+ logging.getLogger(__name__).addHandler(NullHandler())
72
+
73
+
74
+ def add_stderr_logger(
75
+ level: int = logging.DEBUG,
76
+ ) -> logging.StreamHandler[typing.TextIO]:
77
+ """
78
+ Helper for quickly adding a StreamHandler to the logger. Useful for
79
+ debugging.
80
+
81
+ Returns the handler after adding it.
82
+ """
83
+ # This method needs to be in this __init__.py to get the __name__ correct
84
+ # even if urllib3 is vendored within another package.
85
+ logger = logging.getLogger(__name__)
86
+ handler = logging.StreamHandler()
87
+ handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %(message)s"))
88
+ logger.addHandler(handler)
89
+ logger.setLevel(level)
90
+ logger.debug("Added a stderr logging handler to logger: %s", __name__)
91
+ return handler
92
+
93
+
94
+ # ... Clean up.
95
+ del NullHandler
96
+
97
+
98
+ # All warning filters *must* be appended unless you're really certain that they
99
+ # shouldn't be: otherwise, it's very hard for users to use most Python
100
+ # mechanisms to silence them.
101
+ # SecurityWarning's always go off by default.
102
+ warnings.simplefilter("always", exceptions.SecurityWarning, append=True)
103
+ # InsecurePlatformWarning's don't vary between requests, so we keep it default.
104
+ warnings.simplefilter("default", exceptions.InsecurePlatformWarning, append=True)
105
+
106
+
107
+ def disable_warnings(category: type[Warning] = exceptions.HTTPWarning) -> None:
108
+ """
109
+ Helper for quickly disabling all urllib3 warnings.
110
+ """
111
+ warnings.simplefilter("ignore", category)
112
+
113
+
114
+ _DEFAULT_POOL = PoolManager()
115
+
116
+
117
+ def request(
118
+ method: str,
119
+ url: str,
120
+ *,
121
+ body: _TYPE_BODY | None = None,
122
+ fields: _TYPE_FIELDS | None = None,
123
+ headers: typing.Mapping[str, str] | None = None,
124
+ preload_content: bool | None = True,
125
+ decode_content: bool | None = True,
126
+ redirect: bool | None = True,
127
+ retries: Retry | bool | int | None = None,
128
+ timeout: Timeout | float | int | None = 3,
129
+ json: typing.Any | None = None,
130
+ ) -> BaseHTTPResponse:
131
+ """
132
+ A convenience, top-level request method. It uses a module-global ``PoolManager`` instance.
133
+ Therefore, its side effects could be shared across dependencies relying on it.
134
+ To avoid side effects create a new ``PoolManager`` instance and use it instead.
135
+ The method does not accept low-level ``**urlopen_kw`` keyword arguments.
136
+
137
+ :param method:
138
+ HTTP request method (such as GET, POST, PUT, etc.)
139
+
140
+ :param url:
141
+ The URL to perform the request on.
142
+
143
+ :param body:
144
+ Data to send in the request body, either :class:`str`, :class:`bytes`,
145
+ an iterable of :class:`str`/:class:`bytes`, or a file-like object.
146
+
147
+ :param fields:
148
+ Data to encode and send in the request body.
149
+
150
+ :param headers:
151
+ Dictionary of custom headers to send, such as User-Agent,
152
+ If-None-Match, etc.
153
+
154
+ :param bool preload_content:
155
+ If True, the response's body will be preloaded into memory.
156
+
157
+ :param bool decode_content:
158
+ If True, will attempt to decode the body based on the
159
+ 'content-encoding' header.
160
+
161
+ :param redirect:
162
+ If True, automatically handle redirects (status codes 301, 302,
163
+ 303, 307, 308). Each redirect counts as a retry. Disabling retries
164
+ will disable redirect, too.
165
+
166
+ :param retries:
167
+ Configure the number of retries to allow before raising a
168
+ :class:`~urllib3.exceptions.MaxRetryError` exception.
169
+
170
+ If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a
171
+ :class:`~urllib3.util.retry.Retry` object for fine-grained control
172
+ over different types of retries.
173
+ Pass an integer number to retry connection errors that many times,
174
+ but no other types of errors. Pass zero to never retry.
175
+
176
+ If ``False``, then retries are disabled and any exception is raised
177
+ immediately. Also, instead of raising a MaxRetryError on redirects,
178
+ the redirect response will be returned.
179
+
180
+ :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.
181
+
182
+ :param timeout:
183
+ If specified, overrides the default timeout for this one
184
+ request. It may be a float (in seconds) or an instance of
185
+ :class:`urllib3.util.Timeout`.
186
+
187
+ :param json:
188
+ Data to encode and send as JSON with UTF-encoded in the request body.
189
+ The ``"Content-Type"`` header will be set to ``"application/json"``
190
+ unless specified otherwise.
191
+ """
192
+
193
+ return _DEFAULT_POOL.request(
194
+ method,
195
+ url,
196
+ body=body,
197
+ fields=fields,
198
+ headers=headers,
199
+ preload_content=preload_content,
200
+ decode_content=decode_content,
201
+ redirect=redirect,
202
+ retries=retries,
203
+ timeout=timeout,
204
+ json=json,
205
+ )
206
+
207
+
208
+ if sys.platform == "emscripten":
209
+ from .contrib.emscripten import inject_into_urllib3 # noqa: 401
210
+
211
+ inject_into_urllib3()
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/_base_connection.py ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import typing
4
+
5
+ from .util.connection import _TYPE_SOCKET_OPTIONS
6
+ from .util.timeout import _DEFAULT_TIMEOUT, _TYPE_TIMEOUT
7
+ from .util.url import Url
8
+
9
+ _TYPE_BODY = typing.Union[
10
+ bytes, typing.IO[typing.Any], typing.Iterable[bytes | str], str
11
+ ]
12
+
13
+
14
+ class ProxyConfig(typing.NamedTuple):
15
+ ssl_context: ssl.SSLContext | None
16
+ use_forwarding_for_https: bool
17
+ assert_hostname: None | str | typing.Literal[False]
18
+ assert_fingerprint: str | None
19
+
20
+
21
+ class _ResponseOptions(typing.NamedTuple):
22
+ # TODO: Remove this in favor of a better
23
+ # HTTP request/response lifecycle tracking.
24
+ request_method: str
25
+ request_url: str
26
+ preload_content: bool
27
+ decode_content: bool
28
+ enforce_content_length: bool
29
+
30
+
31
+ if typing.TYPE_CHECKING:
32
+ import ssl
33
+ from typing import Protocol
34
+
35
+ from .response import BaseHTTPResponse
36
+
37
+ class BaseHTTPConnection(Protocol):
38
+ default_port: typing.ClassVar[int]
39
+ default_socket_options: typing.ClassVar[_TYPE_SOCKET_OPTIONS]
40
+
41
+ host: str
42
+ port: int
43
+ timeout: None | (
44
+ float
45
+ ) # Instance doesn't store _DEFAULT_TIMEOUT, must be resolved.
46
+ blocksize: int
47
+ source_address: tuple[str, int] | None
48
+ socket_options: _TYPE_SOCKET_OPTIONS | None
49
+
50
+ proxy: Url | None
51
+ proxy_config: ProxyConfig | None
52
+
53
+ is_verified: bool
54
+ proxy_is_verified: bool | None
55
+
56
+ def __init__(
57
+ self,
58
+ host: str,
59
+ port: int | None = None,
60
+ *,
61
+ timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,
62
+ source_address: tuple[str, int] | None = None,
63
+ blocksize: int = 8192,
64
+ socket_options: _TYPE_SOCKET_OPTIONS | None = ...,
65
+ proxy: Url | None = None,
66
+ proxy_config: ProxyConfig | None = None,
67
+ ) -> None: ...
68
+
69
+ def set_tunnel(
70
+ self,
71
+ host: str,
72
+ port: int | None = None,
73
+ headers: typing.Mapping[str, str] | None = None,
74
+ scheme: str = "http",
75
+ ) -> None: ...
76
+
77
+ def connect(self) -> None: ...
78
+
79
+ def request(
80
+ self,
81
+ method: str,
82
+ url: str,
83
+ body: _TYPE_BODY | None = None,
84
+ headers: typing.Mapping[str, str] | None = None,
85
+ # We know *at least* botocore is depending on the order of the
86
+ # first 3 parameters so to be safe we only mark the later ones
87
+ # as keyword-only to ensure we have space to extend.
88
+ *,
89
+ chunked: bool = False,
90
+ preload_content: bool = True,
91
+ decode_content: bool = True,
92
+ enforce_content_length: bool = True,
93
+ ) -> None: ...
94
+
95
+ def getresponse(self) -> BaseHTTPResponse: ...
96
+
97
+ def close(self) -> None: ...
98
+
99
+ @property
100
+ def is_closed(self) -> bool:
101
+ """Whether the connection either is brand new or has been previously closed.
102
+ If this property is True then both ``is_connected`` and ``has_connected_to_proxy``
103
+ properties must be False.
104
+ """
105
+
106
+ @property
107
+ def is_connected(self) -> bool:
108
+ """Whether the connection is actively connected to any origin (proxy or target)"""
109
+
110
+ @property
111
+ def has_connected_to_proxy(self) -> bool:
112
+ """Whether the connection has successfully connected to its proxy.
113
+ This returns False if no proxy is in use. Used to determine whether
114
+ errors are coming from the proxy layer or from tunnelling to the target origin.
115
+ """
116
+
117
+ class BaseHTTPSConnection(BaseHTTPConnection, Protocol):
118
+ default_port: typing.ClassVar[int]
119
+ default_socket_options: typing.ClassVar[_TYPE_SOCKET_OPTIONS]
120
+
121
+ # Certificate verification methods
122
+ cert_reqs: int | str | None
123
+ assert_hostname: None | str | typing.Literal[False]
124
+ assert_fingerprint: str | None
125
+ ssl_context: ssl.SSLContext | None
126
+
127
+ # Trusted CAs
128
+ ca_certs: str | None
129
+ ca_cert_dir: str | None
130
+ ca_cert_data: None | str | bytes
131
+
132
+ # TLS version
133
+ ssl_minimum_version: int | None
134
+ ssl_maximum_version: int | None
135
+ ssl_version: int | str | None # Deprecated
136
+
137
+ # Client certificates
138
+ cert_file: str | None
139
+ key_file: str | None
140
+ key_password: str | None
141
+
142
+ def __init__(
143
+ self,
144
+ host: str,
145
+ port: int | None = None,
146
+ *,
147
+ timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,
148
+ source_address: tuple[str, int] | None = None,
149
+ blocksize: int = 16384,
150
+ socket_options: _TYPE_SOCKET_OPTIONS | None = ...,
151
+ proxy: Url | None = None,
152
+ proxy_config: ProxyConfig | None = None,
153
+ cert_reqs: int | str | None = None,
154
+ assert_hostname: None | str | typing.Literal[False] = None,
155
+ assert_fingerprint: str | None = None,
156
+ server_hostname: str | None = None,
157
+ ssl_context: ssl.SSLContext | None = None,
158
+ ca_certs: str | None = None,
159
+ ca_cert_dir: str | None = None,
160
+ ca_cert_data: None | str | bytes = None,
161
+ ssl_minimum_version: int | None = None,
162
+ ssl_maximum_version: int | None = None,
163
+ ssl_version: int | str | None = None, # Deprecated
164
+ cert_file: str | None = None,
165
+ key_file: str | None = None,
166
+ key_password: str | None = None,
167
+ ) -> None: ...
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/_collections.py ADDED
@@ -0,0 +1,486 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import typing
4
+ from collections import OrderedDict
5
+ from enum import Enum, auto
6
+ from threading import RLock
7
+
8
+ if typing.TYPE_CHECKING:
9
+ # We can only import Protocol if TYPE_CHECKING because it's a development
10
+ # dependency, and is not available at runtime.
11
+ from typing import Protocol
12
+
13
+ from typing_extensions import Self
14
+
15
+ class HasGettableStringKeys(Protocol):
16
+ def keys(self) -> typing.Iterator[str]: ...
17
+
18
+ def __getitem__(self, key: str) -> str: ...
19
+
20
+
21
+ __all__ = ["RecentlyUsedContainer", "HTTPHeaderDict"]
22
+
23
+
24
+ # Key type
25
+ _KT = typing.TypeVar("_KT")
26
+ # Value type
27
+ _VT = typing.TypeVar("_VT")
28
+ # Default type
29
+ _DT = typing.TypeVar("_DT")
30
+
31
+ ValidHTTPHeaderSource = typing.Union[
32
+ "HTTPHeaderDict",
33
+ typing.Mapping[str, str],
34
+ typing.Iterable[tuple[str, str]],
35
+ "HasGettableStringKeys",
36
+ ]
37
+
38
+
39
+ class _Sentinel(Enum):
40
+ not_passed = auto()
41
+
42
+
43
+ def ensure_can_construct_http_header_dict(
44
+ potential: object,
45
+ ) -> ValidHTTPHeaderSource | None:
46
+ if isinstance(potential, HTTPHeaderDict):
47
+ return potential
48
+ elif isinstance(potential, typing.Mapping):
49
+ # Full runtime checking of the contents of a Mapping is expensive, so for the
50
+ # purposes of typechecking, we assume that any Mapping is the right shape.
51
+ return typing.cast(typing.Mapping[str, str], potential)
52
+ elif isinstance(potential, typing.Iterable):
53
+ # Similarly to Mapping, full runtime checking of the contents of an Iterable is
54
+ # expensive, so for the purposes of typechecking, we assume that any Iterable
55
+ # is the right shape.
56
+ return typing.cast(typing.Iterable[tuple[str, str]], potential)
57
+ elif hasattr(potential, "keys") and hasattr(potential, "__getitem__"):
58
+ return typing.cast("HasGettableStringKeys", potential)
59
+ else:
60
+ return None
61
+
62
+
63
+ class RecentlyUsedContainer(typing.Generic[_KT, _VT], typing.MutableMapping[_KT, _VT]):
64
+ """
65
+ Provides a thread-safe dict-like container which maintains up to
66
+ ``maxsize`` keys while throwing away the least-recently-used keys beyond
67
+ ``maxsize``.
68
+
69
+ :param maxsize:
70
+ Maximum number of recent elements to retain.
71
+
72
+ :param dispose_func:
73
+ Every time an item is evicted from the container,
74
+ ``dispose_func(value)`` is called. Callback which will get called
75
+ """
76
+
77
+ _container: typing.OrderedDict[_KT, _VT]
78
+ _maxsize: int
79
+ dispose_func: typing.Callable[[_VT], None] | None
80
+ lock: RLock
81
+
82
+ def __init__(
83
+ self,
84
+ maxsize: int = 10,
85
+ dispose_func: typing.Callable[[_VT], None] | None = None,
86
+ ) -> None:
87
+ super().__init__()
88
+ self._maxsize = maxsize
89
+ self.dispose_func = dispose_func
90
+ self._container = OrderedDict()
91
+ self.lock = RLock()
92
+
93
+ def __getitem__(self, key: _KT) -> _VT:
94
+ # Re-insert the item, moving it to the end of the eviction line.
95
+ with self.lock:
96
+ item = self._container.pop(key)
97
+ self._container[key] = item
98
+ return item
99
+
100
+ def __setitem__(self, key: _KT, value: _VT) -> None:
101
+ evicted_item = None
102
+ with self.lock:
103
+ # Possibly evict the existing value of 'key'
104
+ try:
105
+ # If the key exists, we'll overwrite it, which won't change the
106
+ # size of the pool. Because accessing a key should move it to
107
+ # the end of the eviction line, we pop it out first.
108
+ evicted_item = key, self._container.pop(key)
109
+ self._container[key] = value
110
+ except KeyError:
111
+ # When the key does not exist, we insert the value first so that
112
+ # evicting works in all cases, including when self._maxsize is 0
113
+ self._container[key] = value
114
+ if len(self._container) > self._maxsize:
115
+ # If we didn't evict an existing value, and we've hit our maximum
116
+ # size, then we have to evict the least recently used item from
117
+ # the beginning of the container.
118
+ evicted_item = self._container.popitem(last=False)
119
+
120
+ # After releasing the lock on the pool, dispose of any evicted value.
121
+ if evicted_item is not None and self.dispose_func:
122
+ _, evicted_value = evicted_item
123
+ self.dispose_func(evicted_value)
124
+
125
+ def __delitem__(self, key: _KT) -> None:
126
+ with self.lock:
127
+ value = self._container.pop(key)
128
+
129
+ if self.dispose_func:
130
+ self.dispose_func(value)
131
+
132
+ def __len__(self) -> int:
133
+ with self.lock:
134
+ return len(self._container)
135
+
136
+ def __iter__(self) -> typing.NoReturn:
137
+ raise NotImplementedError(
138
+ "Iteration over this class is unlikely to be threadsafe."
139
+ )
140
+
141
+ def clear(self) -> None:
142
+ with self.lock:
143
+ # Copy pointers to all values, then wipe the mapping
144
+ values = list(self._container.values())
145
+ self._container.clear()
146
+
147
+ if self.dispose_func:
148
+ for value in values:
149
+ self.dispose_func(value)
150
+
151
+ def keys(self) -> set[_KT]: # type: ignore[override]
152
+ with self.lock:
153
+ return set(self._container.keys())
154
+
155
+
156
+ class HTTPHeaderDictItemView(set[tuple[str, str]]):
157
+ """
158
+ HTTPHeaderDict is unusual for a Mapping[str, str] in that it has two modes of
159
+ address.
160
+
161
+ If we directly try to get an item with a particular name, we will get a string
162
+ back that is the concatenated version of all the values:
163
+
164
+ >>> d['X-Header-Name']
165
+ 'Value1, Value2, Value3'
166
+
167
+ However, if we iterate over an HTTPHeaderDict's items, we will optionally combine
168
+ these values based on whether combine=True was called when building up the dictionary
169
+
170
+ >>> d = HTTPHeaderDict({"A": "1", "B": "foo"})
171
+ >>> d.add("A", "2", combine=True)
172
+ >>> d.add("B", "bar")
173
+ >>> list(d.items())
174
+ [
175
+ ('A', '1, 2'),
176
+ ('B', 'foo'),
177
+ ('B', 'bar'),
178
+ ]
179
+
180
+ This class conforms to the interface required by the MutableMapping ABC while
181
+ also giving us the nonstandard iteration behavior we want; items with duplicate
182
+ keys, ordered by time of first insertion.
183
+ """
184
+
185
+ _headers: HTTPHeaderDict
186
+
187
+ def __init__(self, headers: HTTPHeaderDict) -> None:
188
+ self._headers = headers
189
+
190
+ def __len__(self) -> int:
191
+ return len(list(self._headers.iteritems()))
192
+
193
+ def __iter__(self) -> typing.Iterator[tuple[str, str]]:
194
+ return self._headers.iteritems()
195
+
196
+ def __contains__(self, item: object) -> bool:
197
+ if isinstance(item, tuple) and len(item) == 2:
198
+ passed_key, passed_val = item
199
+ if isinstance(passed_key, str) and isinstance(passed_val, str):
200
+ return self._headers._has_value_for_header(passed_key, passed_val)
201
+ return False
202
+
203
+
204
+ class HTTPHeaderDict(typing.MutableMapping[str, str]):
205
+ """
206
+ :param headers:
207
+ An iterable of field-value pairs. Must not contain multiple field names
208
+ when compared case-insensitively.
209
+
210
+ :param kwargs:
211
+ Additional field-value pairs to pass in to ``dict.update``.
212
+
213
+ A ``dict`` like container for storing HTTP Headers.
214
+
215
+ Field names are stored and compared case-insensitively in compliance with
216
+ RFC 7230. Iteration provides the first case-sensitive key seen for each
217
+ case-insensitive pair.
218
+
219
+ Using ``__setitem__`` syntax overwrites fields that compare equal
220
+ case-insensitively in order to maintain ``dict``'s api. For fields that
221
+ compare equal, instead create a new ``HTTPHeaderDict`` and use ``.add``
222
+ in a loop.
223
+
224
+ If multiple fields that are equal case-insensitively are passed to the
225
+ constructor or ``.update``, the behavior is undefined and some will be
226
+ lost.
227
+
228
+ >>> headers = HTTPHeaderDict()
229
+ >>> headers.add('Set-Cookie', 'foo=bar')
230
+ >>> headers.add('set-cookie', 'baz=quxx')
231
+ >>> headers['content-length'] = '7'
232
+ >>> headers['SET-cookie']
233
+ 'foo=bar, baz=quxx'
234
+ >>> headers['Content-Length']
235
+ '7'
236
+ """
237
+
238
+ _container: typing.MutableMapping[str, list[str]]
239
+
240
+ def __init__(self, headers: ValidHTTPHeaderSource | None = None, **kwargs: str):
241
+ super().__init__()
242
+ self._container = {} # 'dict' is insert-ordered
243
+ if headers is not None:
244
+ if isinstance(headers, HTTPHeaderDict):
245
+ self._copy_from(headers)
246
+ else:
247
+ self.extend(headers)
248
+ if kwargs:
249
+ self.extend(kwargs)
250
+
251
+ def __setitem__(self, key: str, val: str) -> None:
252
+ # avoid a bytes/str comparison by decoding before httplib
253
+ if isinstance(key, bytes):
254
+ key = key.decode("latin-1")
255
+ self._container[key.lower()] = [key, val]
256
+
257
+ def __getitem__(self, key: str) -> str:
258
+ if isinstance(key, bytes):
259
+ key = key.decode("latin-1")
260
+ val = self._container[key.lower()]
261
+ return ", ".join(val[1:])
262
+
263
+ def __delitem__(self, key: str) -> None:
264
+ if isinstance(key, bytes):
265
+ key = key.decode("latin-1")
266
+ del self._container[key.lower()]
267
+
268
+ def __contains__(self, key: object) -> bool:
269
+ if isinstance(key, bytes):
270
+ key = key.decode("latin-1")
271
+ if isinstance(key, str):
272
+ return key.lower() in self._container
273
+ return False
274
+
275
+ def setdefault(self, key: str, default: str = "") -> str:
276
+ return super().setdefault(key, default)
277
+
278
+ def __eq__(self, other: object) -> bool:
279
+ maybe_constructable = ensure_can_construct_http_header_dict(other)
280
+ if maybe_constructable is None:
281
+ return False
282
+ else:
283
+ other_as_http_header_dict = type(self)(maybe_constructable)
284
+
285
+ return {k.lower(): v for k, v in self.itermerged()} == {
286
+ k.lower(): v for k, v in other_as_http_header_dict.itermerged()
287
+ }
288
+
289
+ def __ne__(self, other: object) -> bool:
290
+ return not self.__eq__(other)
291
+
292
+ def __len__(self) -> int:
293
+ return len(self._container)
294
+
295
+ def __iter__(self) -> typing.Iterator[str]:
296
+ # Only provide the originally cased names
297
+ for vals in self._container.values():
298
+ yield vals[0]
299
+
300
+ def discard(self, key: str) -> None:
301
+ try:
302
+ del self[key]
303
+ except KeyError:
304
+ pass
305
+
306
+ def add(self, key: str, val: str, *, combine: bool = False) -> None:
307
+ """Adds a (name, value) pair, doesn't overwrite the value if it already
308
+ exists.
309
+
310
+ If this is called with combine=True, instead of adding a new header value
311
+ as a distinct item during iteration, this will instead append the value to
312
+ any existing header value with a comma. If no existing header value exists
313
+ for the key, then the value will simply be added, ignoring the combine parameter.
314
+
315
+ >>> headers = HTTPHeaderDict(foo='bar')
316
+ >>> headers.add('Foo', 'baz')
317
+ >>> headers['foo']
318
+ 'bar, baz'
319
+ >>> list(headers.items())
320
+ [('foo', 'bar'), ('foo', 'baz')]
321
+ >>> headers.add('foo', 'quz', combine=True)
322
+ >>> list(headers.items())
323
+ [('foo', 'bar, baz, quz')]
324
+ """
325
+ # avoid a bytes/str comparison by decoding before httplib
326
+ if isinstance(key, bytes):
327
+ key = key.decode("latin-1")
328
+ key_lower = key.lower()
329
+ new_vals = [key, val]
330
+ # Keep the common case aka no item present as fast as possible
331
+ vals = self._container.setdefault(key_lower, new_vals)
332
+ if new_vals is not vals:
333
+ # if there are values here, then there is at least the initial
334
+ # key/value pair
335
+ assert len(vals) >= 2
336
+ if combine:
337
+ vals[-1] = vals[-1] + ", " + val
338
+ else:
339
+ vals.append(val)
340
+
341
+ def extend(self, *args: ValidHTTPHeaderSource, **kwargs: str) -> None:
342
+ """Generic import function for any type of header-like object.
343
+ Adapted version of MutableMapping.update in order to insert items
344
+ with self.add instead of self.__setitem__
345
+ """
346
+ if len(args) > 1:
347
+ raise TypeError(
348
+ f"extend() takes at most 1 positional arguments ({len(args)} given)"
349
+ )
350
+ other = args[0] if len(args) >= 1 else ()
351
+
352
+ if isinstance(other, HTTPHeaderDict):
353
+ for key, val in other.iteritems():
354
+ self.add(key, val)
355
+ elif isinstance(other, typing.Mapping):
356
+ for key, val in other.items():
357
+ self.add(key, val)
358
+ elif isinstance(other, typing.Iterable):
359
+ for key, value in other:
360
+ self.add(key, value)
361
+ elif hasattr(other, "keys") and hasattr(other, "__getitem__"):
362
+ # THIS IS NOT A TYPESAFE BRANCH
363
+ # In this branch, the object has a `keys` attr but is not a Mapping or any of
364
+ # the other types indicated in the method signature. We do some stuff with
365
+ # it as though it partially implements the Mapping interface, but we're not
366
+ # doing that stuff safely AT ALL.
367
+ for key in other.keys():
368
+ self.add(key, other[key])
369
+
370
+ for key, value in kwargs.items():
371
+ self.add(key, value)
372
+
373
+ @typing.overload
374
+ def getlist(self, key: str) -> list[str]: ...
375
+
376
+ @typing.overload
377
+ def getlist(self, key: str, default: _DT) -> list[str] | _DT: ...
378
+
379
+ def getlist(
380
+ self, key: str, default: _Sentinel | _DT = _Sentinel.not_passed
381
+ ) -> list[str] | _DT:
382
+ """Returns a list of all the values for the named field. Returns an
383
+ empty list if the key doesn't exist."""
384
+ if isinstance(key, bytes):
385
+ key = key.decode("latin-1")
386
+ try:
387
+ vals = self._container[key.lower()]
388
+ except KeyError:
389
+ if default is _Sentinel.not_passed:
390
+ # _DT is unbound; empty list is instance of List[str]
391
+ return []
392
+ # _DT is bound; default is instance of _DT
393
+ return default
394
+ else:
395
+ # _DT may or may not be bound; vals[1:] is instance of List[str], which
396
+ # meets our external interface requirement of `Union[List[str], _DT]`.
397
+ return vals[1:]
398
+
399
+ def _prepare_for_method_change(self) -> Self:
400
+ """
401
+ Remove content-specific header fields before changing the request
402
+ method to GET or HEAD according to RFC 9110, Section 15.4.
403
+ """
404
+ content_specific_headers = [
405
+ "Content-Encoding",
406
+ "Content-Language",
407
+ "Content-Location",
408
+ "Content-Type",
409
+ "Content-Length",
410
+ "Digest",
411
+ "Last-Modified",
412
+ ]
413
+ for header in content_specific_headers:
414
+ self.discard(header)
415
+ return self
416
+
417
+ # Backwards compatibility for httplib
418
+ getheaders = getlist
419
+ getallmatchingheaders = getlist
420
+ iget = getlist
421
+
422
+ # Backwards compatibility for http.cookiejar
423
+ get_all = getlist
424
+
425
+ def __repr__(self) -> str:
426
+ return f"{type(self).__name__}({dict(self.itermerged())})"
427
+
428
+ def _copy_from(self, other: HTTPHeaderDict) -> None:
429
+ for key in other:
430
+ val = other.getlist(key)
431
+ self._container[key.lower()] = [key, *val]
432
+
433
+ def copy(self) -> Self:
434
+ clone = type(self)()
435
+ clone._copy_from(self)
436
+ return clone
437
+
438
+ def iteritems(self) -> typing.Iterator[tuple[str, str]]:
439
+ """Iterate over all header lines, including duplicate ones."""
440
+ for key in self:
441
+ vals = self._container[key.lower()]
442
+ for val in vals[1:]:
443
+ yield vals[0], val
444
+
445
+ def itermerged(self) -> typing.Iterator[tuple[str, str]]:
446
+ """Iterate over all headers, merging duplicate ones together."""
447
+ for key in self:
448
+ val = self._container[key.lower()]
449
+ yield val[0], ", ".join(val[1:])
450
+
451
+ def items(self) -> HTTPHeaderDictItemView: # type: ignore[override]
452
+ return HTTPHeaderDictItemView(self)
453
+
454
+ def _has_value_for_header(self, header_name: str, potential_value: str) -> bool:
455
+ if header_name in self:
456
+ return potential_value in self._container[header_name.lower()][1:]
457
+ return False
458
+
459
+ def __ior__(self, other: object) -> HTTPHeaderDict:
460
+ # Supports extending a header dict in-place using operator |=
461
+ # combining items with add instead of __setitem__
462
+ maybe_constructable = ensure_can_construct_http_header_dict(other)
463
+ if maybe_constructable is None:
464
+ return NotImplemented
465
+ self.extend(maybe_constructable)
466
+ return self
467
+
468
+ def __or__(self, other: object) -> Self:
469
+ # Supports merging header dicts using operator |
470
+ # combining items with add instead of __setitem__
471
+ maybe_constructable = ensure_can_construct_http_header_dict(other)
472
+ if maybe_constructable is None:
473
+ return NotImplemented
474
+ result = self.copy()
475
+ result.extend(maybe_constructable)
476
+ return result
477
+
478
+ def __ror__(self, other: object) -> Self:
479
+ # Supports merging header dicts using operator | when other is on left side
480
+ # combining items with add instead of __setitem__
481
+ maybe_constructable = ensure_can_construct_http_header_dict(other)
482
+ if maybe_constructable is None:
483
+ return NotImplemented
484
+ result = type(self)(maybe_constructable)
485
+ result.extend(self)
486
+ return result
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/_request_methods.py ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import json as _json
4
+ import typing
5
+ from urllib.parse import urlencode
6
+
7
+ from ._base_connection import _TYPE_BODY
8
+ from ._collections import HTTPHeaderDict
9
+ from .filepost import _TYPE_FIELDS, encode_multipart_formdata
10
+ from .response import BaseHTTPResponse
11
+
12
+ __all__ = ["RequestMethods"]
13
+
14
+ _TYPE_ENCODE_URL_FIELDS = typing.Union[
15
+ typing.Sequence[tuple[str, typing.Union[str, bytes]]],
16
+ typing.Mapping[str, typing.Union[str, bytes]],
17
+ ]
18
+
19
+
20
+ class RequestMethods:
21
+ """
22
+ Convenience mixin for classes who implement a :meth:`urlopen` method, such
23
+ as :class:`urllib3.HTTPConnectionPool` and
24
+ :class:`urllib3.PoolManager`.
25
+
26
+ Provides behavior for making common types of HTTP request methods and
27
+ decides which type of request field encoding to use.
28
+
29
+ Specifically,
30
+
31
+ :meth:`.request_encode_url` is for sending requests whose fields are
32
+ encoded in the URL (such as GET, HEAD, DELETE).
33
+
34
+ :meth:`.request_encode_body` is for sending requests whose fields are
35
+ encoded in the *body* of the request using multipart or www-form-urlencoded
36
+ (such as for POST, PUT, PATCH).
37
+
38
+ :meth:`.request` is for making any kind of request, it will look up the
39
+ appropriate encoding format and use one of the above two methods to make
40
+ the request.
41
+
42
+ Initializer parameters:
43
+
44
+ :param headers:
45
+ Headers to include with all requests, unless other headers are given
46
+ explicitly.
47
+ """
48
+
49
+ _encode_url_methods = {"DELETE", "GET", "HEAD", "OPTIONS"}
50
+
51
+ def __init__(self, headers: typing.Mapping[str, str] | None = None) -> None:
52
+ self.headers = headers or {}
53
+
54
+ def urlopen(
55
+ self,
56
+ method: str,
57
+ url: str,
58
+ body: _TYPE_BODY | None = None,
59
+ headers: typing.Mapping[str, str] | None = None,
60
+ encode_multipart: bool = True,
61
+ multipart_boundary: str | None = None,
62
+ **kw: typing.Any,
63
+ ) -> BaseHTTPResponse: # Abstract
64
+ raise NotImplementedError(
65
+ "Classes extending RequestMethods must implement "
66
+ "their own ``urlopen`` method."
67
+ )
68
+
69
+ def request(
70
+ self,
71
+ method: str,
72
+ url: str,
73
+ body: _TYPE_BODY | None = None,
74
+ fields: _TYPE_FIELDS | None = None,
75
+ headers: typing.Mapping[str, str] | None = None,
76
+ json: typing.Any | None = None,
77
+ **urlopen_kw: typing.Any,
78
+ ) -> BaseHTTPResponse:
79
+ """
80
+ Make a request using :meth:`urlopen` with the appropriate encoding of
81
+ ``fields`` based on the ``method`` used.
82
+
83
+ This is a convenience method that requires the least amount of manual
84
+ effort. It can be used in most situations, while still having the
85
+ option to drop down to more specific methods when necessary, such as
86
+ :meth:`request_encode_url`, :meth:`request_encode_body`,
87
+ or even the lowest level :meth:`urlopen`.
88
+
89
+ :param method:
90
+ HTTP request method (such as GET, POST, PUT, etc.)
91
+
92
+ :param url:
93
+ The URL to perform the request on.
94
+
95
+ :param body:
96
+ Data to send in the request body, either :class:`str`, :class:`bytes`,
97
+ an iterable of :class:`str`/:class:`bytes`, or a file-like object.
98
+
99
+ :param fields:
100
+ Data to encode and send in the URL or request body, depending on ``method``.
101
+
102
+ :param headers:
103
+ Dictionary of custom headers to send, such as User-Agent,
104
+ If-None-Match, etc. If None, pool headers are used. If provided,
105
+ these headers completely replace any pool-specific headers.
106
+
107
+ :param json:
108
+ Data to encode and send as JSON with UTF-encoded in the request body.
109
+ The ``"Content-Type"`` header will be set to ``"application/json"``
110
+ unless specified otherwise.
111
+ """
112
+ method = method.upper()
113
+
114
+ if json is not None and body is not None:
115
+ raise TypeError(
116
+ "request got values for both 'body' and 'json' parameters which are mutually exclusive"
117
+ )
118
+
119
+ if json is not None:
120
+ if headers is None:
121
+ headers = self.headers
122
+
123
+ if not ("content-type" in map(str.lower, headers.keys())):
124
+ headers = HTTPHeaderDict(headers)
125
+ headers["Content-Type"] = "application/json"
126
+
127
+ body = _json.dumps(json, separators=(",", ":"), ensure_ascii=False).encode(
128
+ "utf-8"
129
+ )
130
+
131
+ if body is not None:
132
+ urlopen_kw["body"] = body
133
+
134
+ if method in self._encode_url_methods:
135
+ return self.request_encode_url(
136
+ method,
137
+ url,
138
+ fields=fields, # type: ignore[arg-type]
139
+ headers=headers,
140
+ **urlopen_kw,
141
+ )
142
+ else:
143
+ return self.request_encode_body(
144
+ method, url, fields=fields, headers=headers, **urlopen_kw
145
+ )
146
+
147
+ def request_encode_url(
148
+ self,
149
+ method: str,
150
+ url: str,
151
+ fields: _TYPE_ENCODE_URL_FIELDS | None = None,
152
+ headers: typing.Mapping[str, str] | None = None,
153
+ **urlopen_kw: str,
154
+ ) -> BaseHTTPResponse:
155
+ """
156
+ Make a request using :meth:`urlopen` with the ``fields`` encoded in
157
+ the url. This is useful for request methods like GET, HEAD, DELETE, etc.
158
+
159
+ :param method:
160
+ HTTP request method (such as GET, POST, PUT, etc.)
161
+
162
+ :param url:
163
+ The URL to perform the request on.
164
+
165
+ :param fields:
166
+ Data to encode and send in the URL.
167
+
168
+ :param headers:
169
+ Dictionary of custom headers to send, such as User-Agent,
170
+ If-None-Match, etc. If None, pool headers are used. If provided,
171
+ these headers completely replace any pool-specific headers.
172
+ """
173
+ if headers is None:
174
+ headers = self.headers
175
+
176
+ extra_kw: dict[str, typing.Any] = {"headers": headers}
177
+ extra_kw.update(urlopen_kw)
178
+
179
+ if fields:
180
+ url += "?" + urlencode(fields)
181
+
182
+ return self.urlopen(method, url, **extra_kw)
183
+
184
+ def request_encode_body(
185
+ self,
186
+ method: str,
187
+ url: str,
188
+ fields: _TYPE_FIELDS | None = None,
189
+ headers: typing.Mapping[str, str] | None = None,
190
+ encode_multipart: bool = True,
191
+ multipart_boundary: str | None = None,
192
+ **urlopen_kw: str,
193
+ ) -> BaseHTTPResponse:
194
+ """
195
+ Make a request using :meth:`urlopen` with the ``fields`` encoded in
196
+ the body. This is useful for request methods like POST, PUT, PATCH, etc.
197
+
198
+ When ``encode_multipart=True`` (default), then
199
+ :func:`urllib3.encode_multipart_formdata` is used to encode
200
+ the payload with the appropriate content type. Otherwise
201
+ :func:`urllib.parse.urlencode` is used with the
202
+ 'application/x-www-form-urlencoded' content type.
203
+
204
+ Multipart encoding must be used when posting files, and it's reasonably
205
+ safe to use it in other times too. However, it may break request
206
+ signing, such as with OAuth.
207
+
208
+ Supports an optional ``fields`` parameter of key/value strings AND
209
+ key/filetuple. A filetuple is a (filename, data, MIME type) tuple where
210
+ the MIME type is optional. For example::
211
+
212
+ fields = {
213
+ 'foo': 'bar',
214
+ 'fakefile': ('foofile.txt', 'contents of foofile'),
215
+ 'realfile': ('barfile.txt', open('realfile').read()),
216
+ 'typedfile': ('bazfile.bin', open('bazfile').read(),
217
+ 'image/jpeg'),
218
+ 'nonamefile': 'contents of nonamefile field',
219
+ }
220
+
221
+ When uploading a file, providing a filename (the first parameter of the
222
+ tuple) is optional but recommended to best mimic behavior of browsers.
223
+
224
+ Note that if ``headers`` are supplied, the 'Content-Type' header will
225
+ be overwritten because it depends on the dynamic random boundary string
226
+ which is used to compose the body of the request. The random boundary
227
+ string can be explicitly set with the ``multipart_boundary`` parameter.
228
+
229
+ :param method:
230
+ HTTP request method (such as GET, POST, PUT, etc.)
231
+
232
+ :param url:
233
+ The URL to perform the request on.
234
+
235
+ :param fields:
236
+ Data to encode and send in the request body.
237
+
238
+ :param headers:
239
+ Dictionary of custom headers to send, such as User-Agent,
240
+ If-None-Match, etc. If None, pool headers are used. If provided,
241
+ these headers completely replace any pool-specific headers.
242
+
243
+ :param encode_multipart:
244
+ If True, encode the ``fields`` using the multipart/form-data MIME
245
+ format.
246
+
247
+ :param multipart_boundary:
248
+ If not specified, then a random boundary will be generated using
249
+ :func:`urllib3.filepost.choose_boundary`.
250
+ """
251
+ if headers is None:
252
+ headers = self.headers
253
+
254
+ extra_kw: dict[str, typing.Any] = {"headers": HTTPHeaderDict(headers)}
255
+ body: bytes | str
256
+
257
+ if fields:
258
+ if "body" in urlopen_kw:
259
+ raise TypeError(
260
+ "request got values for both 'fields' and 'body', can only specify one."
261
+ )
262
+
263
+ if encode_multipart:
264
+ body, content_type = encode_multipart_formdata(
265
+ fields, boundary=multipart_boundary
266
+ )
267
+ else:
268
+ body, content_type = (
269
+ urlencode(fields), # type: ignore[arg-type]
270
+ "application/x-www-form-urlencoded",
271
+ )
272
+
273
+ extra_kw["body"] = body
274
+ extra_kw["headers"].setdefault("Content-Type", content_type)
275
+
276
+ extra_kw.update(urlopen_kw)
277
+
278
+ return self.urlopen(method, url, **extra_kw)
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/_version.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # file generated by setuptools-scm
2
+ # don't change, don't track in version control
3
+
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
12
+
13
+ TYPE_CHECKING = False
14
+ if TYPE_CHECKING:
15
+ from typing import Tuple
16
+ from typing import Union
17
+
18
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
20
+ else:
21
+ VERSION_TUPLE = object
22
+ COMMIT_ID = object
23
+
24
+ version: str
25
+ __version__: str
26
+ __version_tuple__: VERSION_TUPLE
27
+ version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
30
+
31
+ __version__ = version = '2.7.0'
32
+ __version_tuple__ = version_tuple = (2, 7, 0)
33
+
34
+ __commit_id__ = commit_id = None
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/connection.py ADDED
@@ -0,0 +1,1099 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import datetime
4
+ import http.client
5
+ import logging
6
+ import os
7
+ import re
8
+ import socket
9
+ import sys
10
+ import threading
11
+ import typing
12
+ import warnings
13
+ from http.client import HTTPConnection as _HTTPConnection
14
+ from http.client import HTTPException as HTTPException # noqa: F401
15
+ from http.client import ResponseNotReady
16
+ from socket import timeout as SocketTimeout
17
+
18
+ if typing.TYPE_CHECKING:
19
+ from .response import HTTPResponse
20
+ from .util.ssl_ import _TYPE_PEER_CERT_RET_DICT
21
+ from .util.ssltransport import SSLTransport
22
+
23
+ from ._collections import HTTPHeaderDict
24
+ from .http2 import probe as http2_probe
25
+ from .util.response import assert_header_parsing
26
+ from .util.timeout import _DEFAULT_TIMEOUT, _TYPE_TIMEOUT, Timeout
27
+ from .util.util import to_str
28
+ from .util.wait import wait_for_read
29
+
30
+ try: # Compiled with SSL?
31
+ import ssl
32
+
33
+ BaseSSLError = ssl.SSLError
34
+ except (ImportError, AttributeError):
35
+ ssl = None # type: ignore[assignment]
36
+
37
+ class BaseSSLError(BaseException): # type: ignore[no-redef]
38
+ pass
39
+
40
+
41
+ from ._base_connection import _TYPE_BODY
42
+ from ._base_connection import ProxyConfig as ProxyConfig
43
+ from ._base_connection import _ResponseOptions as _ResponseOptions
44
+ from ._version import __version__
45
+ from .exceptions import (
46
+ ConnectTimeoutError,
47
+ HeaderParsingError,
48
+ NameResolutionError,
49
+ NewConnectionError,
50
+ ProxyError,
51
+ SystemTimeWarning,
52
+ )
53
+ from .util import SKIP_HEADER, SKIPPABLE_HEADERS, connection, ssl_
54
+ from .util.request import body_to_chunks
55
+ from .util.ssl_ import assert_fingerprint as _assert_fingerprint
56
+ from .util.ssl_ import (
57
+ create_urllib3_context,
58
+ is_ipaddress,
59
+ resolve_cert_reqs,
60
+ resolve_ssl_version,
61
+ ssl_wrap_socket,
62
+ )
63
+ from .util.ssl_match_hostname import CertificateError, match_hostname
64
+ from .util.url import Url
65
+
66
+ # Not a no-op, we're adding this to the namespace so it can be imported.
67
+ ConnectionError = ConnectionError
68
+ BrokenPipeError = BrokenPipeError
69
+
70
+
71
+ log = logging.getLogger(__name__)
72
+
73
+ port_by_scheme = {"http": 80, "https": 443}
74
+
75
+ # When it comes time to update this value as a part of regular maintenance
76
+ # (ie test_recent_date is failing) update it to ~6 months before the current date.
77
+ RECENT_DATE = datetime.date(2025, 1, 1)
78
+
79
+ _CONTAINS_CONTROL_CHAR_RE = re.compile(r"[^-!#$%&'*+.^_`|~0-9a-zA-Z]")
80
+
81
+
82
+ class HTTPConnection(_HTTPConnection):
83
+ """
84
+ Based on :class:`http.client.HTTPConnection` but provides an extra constructor
85
+ backwards-compatibility layer between older and newer Pythons.
86
+
87
+ Additional keyword parameters are used to configure attributes of the connection.
88
+ Accepted parameters include:
89
+
90
+ - ``source_address``: Set the source address for the current connection.
91
+ - ``socket_options``: Set specific options on the underlying socket. If not specified, then
92
+ defaults are loaded from ``HTTPConnection.default_socket_options`` which includes disabling
93
+ Nagle's algorithm (sets TCP_NODELAY to 1) unless the connection is behind a proxy.
94
+
95
+ For example, if you wish to enable TCP Keep Alive in addition to the defaults,
96
+ you might pass:
97
+
98
+ .. code-block:: python
99
+
100
+ HTTPConnection.default_socket_options + [
101
+ (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
102
+ ]
103
+
104
+ Or you may want to disable the defaults by passing an empty list (e.g., ``[]``).
105
+ """
106
+
107
+ default_port: typing.ClassVar[int] = port_by_scheme["http"] # type: ignore[misc]
108
+
109
+ #: Disable Nagle's algorithm by default.
110
+ #: ``[(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)]``
111
+ default_socket_options: typing.ClassVar[connection._TYPE_SOCKET_OPTIONS] = [
112
+ (socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
113
+ ]
114
+
115
+ #: Whether this connection verifies the host's certificate.
116
+ is_verified: bool = False
117
+
118
+ #: Whether this proxy connection verified the proxy host's certificate.
119
+ # If no proxy is currently connected to the value will be ``None``.
120
+ proxy_is_verified: bool | None = None
121
+
122
+ blocksize: int
123
+ source_address: tuple[str, int] | None
124
+ socket_options: connection._TYPE_SOCKET_OPTIONS | None
125
+
126
+ _has_connected_to_proxy: bool
127
+ _response_options: _ResponseOptions | None
128
+ _tunnel_host: str | None
129
+ _tunnel_port: int | None
130
+ _tunnel_scheme: str | None
131
+
132
+ def __init__(
133
+ self,
134
+ host: str,
135
+ port: int | None = None,
136
+ *,
137
+ timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,
138
+ source_address: tuple[str, int] | None = None,
139
+ blocksize: int = 16384,
140
+ socket_options: None | (
141
+ connection._TYPE_SOCKET_OPTIONS
142
+ ) = default_socket_options,
143
+ proxy: Url | None = None,
144
+ proxy_config: ProxyConfig | None = None,
145
+ ) -> None:
146
+ super().__init__(
147
+ host=host,
148
+ port=port,
149
+ timeout=Timeout.resolve_default_timeout(timeout),
150
+ source_address=source_address,
151
+ blocksize=blocksize,
152
+ )
153
+ self.socket_options = socket_options
154
+ self.proxy = proxy
155
+ self.proxy_config = proxy_config
156
+
157
+ self._has_connected_to_proxy = False
158
+ self._response_options = None
159
+ self._tunnel_host: str | None = None
160
+ self._tunnel_port: int | None = None
161
+ self._tunnel_scheme: str | None = None
162
+
163
+ def __str__(self) -> str:
164
+ return f"{type(self).__name__}(host={self.host!r}, port={self.port!r})"
165
+
166
+ def __repr__(self) -> str:
167
+ return f"<{self} at {id(self):#x}>"
168
+
169
+ @property
170
+ def host(self) -> str:
171
+ """
172
+ Getter method to remove any trailing dots that indicate the hostname is an FQDN.
173
+
174
+ In general, SSL certificates don't include the trailing dot indicating a
175
+ fully-qualified domain name, and thus, they don't validate properly when
176
+ checked against a domain name that includes the dot. In addition, some
177
+ servers may not expect to receive the trailing dot when provided.
178
+
179
+ However, the hostname with trailing dot is critical to DNS resolution; doing a
180
+ lookup with the trailing dot will properly only resolve the appropriate FQDN,
181
+ whereas a lookup without a trailing dot will search the system's search domain
182
+ list. Thus, it's important to keep the original host around for use only in
183
+ those cases where it's appropriate (i.e., when doing DNS lookup to establish the
184
+ actual TCP connection across which we're going to send HTTP requests).
185
+ """
186
+ return self._dns_host.rstrip(".")
187
+
188
+ @host.setter
189
+ def host(self, value: str) -> None:
190
+ """
191
+ Setter for the `host` property.
192
+
193
+ We assume that only urllib3 uses the _dns_host attribute; httplib itself
194
+ only uses `host`, and it seems reasonable that other libraries follow suit.
195
+ """
196
+ self._dns_host = value
197
+
198
+ def _new_conn(self) -> socket.socket:
199
+ """Establish a socket connection and set nodelay settings on it.
200
+
201
+ :return: New socket connection.
202
+ """
203
+ try:
204
+ sock = connection.create_connection(
205
+ (self._dns_host, self.port),
206
+ self.timeout,
207
+ source_address=self.source_address,
208
+ socket_options=self.socket_options,
209
+ )
210
+ except socket.gaierror as e:
211
+ raise NameResolutionError(self.host, self, e) from e
212
+ except SocketTimeout as e:
213
+ raise ConnectTimeoutError(
214
+ self,
215
+ f"Connection to {self.host} timed out. (connect timeout={self.timeout})",
216
+ ) from e
217
+
218
+ except OSError as e:
219
+ raise NewConnectionError(
220
+ self, f"Failed to establish a new connection: {e}"
221
+ ) from e
222
+
223
+ sys.audit("http.client.connect", self, self.host, self.port)
224
+
225
+ return sock
226
+
227
+ def set_tunnel(
228
+ self,
229
+ host: str,
230
+ port: int | None = None,
231
+ headers: typing.Mapping[str, str] | None = None,
232
+ scheme: str = "http",
233
+ ) -> None:
234
+ if scheme not in ("http", "https"):
235
+ raise ValueError(
236
+ f"Invalid proxy scheme for tunneling: {scheme!r}, must be either 'http' or 'https'"
237
+ )
238
+ super().set_tunnel(host, port=port, headers=headers)
239
+ self._tunnel_scheme = scheme
240
+
241
+ if sys.version_info < (3, 11, 9) or ((3, 12) <= sys.version_info < (3, 12, 3)):
242
+ # Taken from python/cpython#100986 which was backported in 3.11.9 and 3.12.3.
243
+ # When using connection_from_host, host will come without brackets.
244
+ def _wrap_ipv6(self, ip: bytes) -> bytes:
245
+ if b":" in ip and ip[0] != b"["[0]:
246
+ return b"[" + ip + b"]"
247
+ return ip
248
+
249
+ if sys.version_info < (3, 11, 9):
250
+ # `_tunnel` copied from 3.11.13 backporting
251
+ # https://github.com/python/cpython/commit/0d4026432591d43185568dd31cef6a034c4b9261
252
+ # and https://github.com/python/cpython/commit/6fbc61070fda2ffb8889e77e3b24bca4249ab4d1
253
+ def _tunnel(self) -> None:
254
+ _MAXLINE = http.client._MAXLINE # type: ignore[attr-defined]
255
+ connect = b"CONNECT %s:%d HTTP/1.0\r\n" % ( # type: ignore[str-format]
256
+ self._wrap_ipv6(self._tunnel_host.encode("ascii")), # type: ignore[union-attr]
257
+ self._tunnel_port,
258
+ )
259
+ headers = [connect]
260
+ for header, value in self._tunnel_headers.items(): # type: ignore[attr-defined]
261
+ headers.append(f"{header}: {value}\r\n".encode("latin-1"))
262
+ headers.append(b"\r\n")
263
+ # Making a single send() call instead of one per line encourages
264
+ # the host OS to use a more optimal packet size instead of
265
+ # potentially emitting a series of small packets.
266
+ self.send(b"".join(headers))
267
+ del headers
268
+
269
+ response = self.response_class(self.sock, method=self._method) # type: ignore[attr-defined]
270
+ try:
271
+ (version, code, message) = response._read_status() # type: ignore[attr-defined]
272
+
273
+ if code != http.HTTPStatus.OK:
274
+ self.close()
275
+ raise OSError(
276
+ f"Tunnel connection failed: {code} {message.strip()}"
277
+ )
278
+ while True:
279
+ line = response.fp.readline(_MAXLINE + 1)
280
+ if len(line) > _MAXLINE:
281
+ raise http.client.LineTooLong("header line")
282
+ if not line:
283
+ # for sites which EOF without sending a trailer
284
+ break
285
+ if line in (b"\r\n", b"\n", b""):
286
+ break
287
+
288
+ if self.debuglevel > 0:
289
+ print("header:", line.decode())
290
+ finally:
291
+ response.close()
292
+
293
+ elif (3, 12) <= sys.version_info < (3, 12, 3):
294
+ # `_tunnel` copied from 3.12.11 backporting
295
+ # https://github.com/python/cpython/commit/23aef575c7629abcd4aaf028ebd226fb41a4b3c8
296
+ def _tunnel(self) -> None: # noqa: F811
297
+ connect = b"CONNECT %s:%d HTTP/1.1\r\n" % ( # type: ignore[str-format]
298
+ self._wrap_ipv6(self._tunnel_host.encode("idna")), # type: ignore[union-attr]
299
+ self._tunnel_port,
300
+ )
301
+ headers = [connect]
302
+ for header, value in self._tunnel_headers.items(): # type: ignore[attr-defined]
303
+ headers.append(f"{header}: {value}\r\n".encode("latin-1"))
304
+ headers.append(b"\r\n")
305
+ # Making a single send() call instead of one per line encourages
306
+ # the host OS to use a more optimal packet size instead of
307
+ # potentially emitting a series of small packets.
308
+ self.send(b"".join(headers))
309
+ del headers
310
+
311
+ response = self.response_class(self.sock, method=self._method) # type: ignore[attr-defined]
312
+ try:
313
+ (version, code, message) = response._read_status() # type: ignore[attr-defined]
314
+
315
+ self._raw_proxy_headers = http.client._read_headers(response.fp) # type: ignore[attr-defined]
316
+
317
+ if self.debuglevel > 0:
318
+ for header in self._raw_proxy_headers:
319
+ print("header:", header.decode())
320
+
321
+ if code != http.HTTPStatus.OK:
322
+ self.close()
323
+ raise OSError(
324
+ f"Tunnel connection failed: {code} {message.strip()}"
325
+ )
326
+
327
+ finally:
328
+ response.close()
329
+
330
+ def connect(self) -> None:
331
+ self.sock = self._new_conn()
332
+ if self._tunnel_host:
333
+ # If we're tunneling it means we're connected to our proxy.
334
+ self._has_connected_to_proxy = True
335
+
336
+ # TODO: Fix tunnel so it doesn't depend on self.sock state.
337
+ self._tunnel()
338
+
339
+ # If there's a proxy to be connected to we are fully connected.
340
+ # This is set twice (once above and here) due to forwarding proxies
341
+ # not using tunnelling.
342
+ self._has_connected_to_proxy = bool(self.proxy)
343
+
344
+ if self._has_connected_to_proxy:
345
+ self.proxy_is_verified = False
346
+
347
+ @property
348
+ def is_closed(self) -> bool:
349
+ return self.sock is None
350
+
351
+ @property
352
+ def is_connected(self) -> bool:
353
+ if self.sock is None:
354
+ return False
355
+ return not wait_for_read(self.sock, timeout=0.0)
356
+
357
+ @property
358
+ def has_connected_to_proxy(self) -> bool:
359
+ return self._has_connected_to_proxy
360
+
361
+ @property
362
+ def proxy_is_forwarding(self) -> bool:
363
+ """
364
+ Return True if a forwarding proxy is configured, else return False
365
+ """
366
+ return bool(self.proxy) and self._tunnel_host is None
367
+
368
+ @property
369
+ def proxy_is_tunneling(self) -> bool:
370
+ """
371
+ Return True if a tunneling proxy is configured, else return False
372
+ """
373
+ return self._tunnel_host is not None
374
+
375
+ def close(self) -> None:
376
+ try:
377
+ super().close()
378
+ finally:
379
+ # Reset all stateful properties so connection
380
+ # can be re-used without leaking prior configs.
381
+ self.sock = None
382
+ self.is_verified = False
383
+ self.proxy_is_verified = None
384
+ self._has_connected_to_proxy = False
385
+ self._response_options = None
386
+ self._tunnel_host = None
387
+ self._tunnel_port = None
388
+ self._tunnel_scheme = None
389
+
390
+ def putrequest(
391
+ self,
392
+ method: str,
393
+ url: str,
394
+ skip_host: bool = False,
395
+ skip_accept_encoding: bool = False,
396
+ ) -> None:
397
+ """"""
398
+ # Empty docstring because the indentation of CPython's implementation
399
+ # is broken but we don't want this method in our documentation.
400
+ match = _CONTAINS_CONTROL_CHAR_RE.search(method)
401
+ if match:
402
+ raise ValueError(
403
+ f"Method cannot contain non-token characters {method!r} (found at least {match.group()!r})"
404
+ )
405
+
406
+ return super().putrequest(
407
+ method, url, skip_host=skip_host, skip_accept_encoding=skip_accept_encoding
408
+ )
409
+
410
+ def putheader(self, header: str, *values: str) -> None: # type: ignore[override]
411
+ """"""
412
+ if not any(isinstance(v, str) and v == SKIP_HEADER for v in values):
413
+ super().putheader(header, *values)
414
+ elif to_str(header.lower()) not in SKIPPABLE_HEADERS:
415
+ skippable_headers = "', '".join(
416
+ [str.title(header) for header in sorted(SKIPPABLE_HEADERS)]
417
+ )
418
+ raise ValueError(
419
+ f"urllib3.util.SKIP_HEADER only supports '{skippable_headers}'"
420
+ )
421
+
422
+ # `request` method's signature intentionally violates LSP.
423
+ # urllib3's API is different from `http.client.HTTPConnection` and the subclassing is only incidental.
424
+ def request( # type: ignore[override]
425
+ self,
426
+ method: str,
427
+ url: str,
428
+ body: _TYPE_BODY | None = None,
429
+ headers: typing.Mapping[str, str] | None = None,
430
+ *,
431
+ chunked: bool = False,
432
+ preload_content: bool = True,
433
+ decode_content: bool = True,
434
+ enforce_content_length: bool = True,
435
+ ) -> None:
436
+ # Update the inner socket's timeout value to send the request.
437
+ # This only triggers if the connection is re-used.
438
+ if self.sock is not None:
439
+ self.sock.settimeout(self.timeout)
440
+
441
+ # Store these values to be fed into the HTTPResponse
442
+ # object later. TODO: Remove this in favor of a real
443
+ # HTTP lifecycle mechanism.
444
+
445
+ # We have to store these before we call .request()
446
+ # because sometimes we can still salvage a response
447
+ # off the wire even if we aren't able to completely
448
+ # send the request body.
449
+ self._response_options = _ResponseOptions(
450
+ request_method=method,
451
+ request_url=url,
452
+ preload_content=preload_content,
453
+ decode_content=decode_content,
454
+ enforce_content_length=enforce_content_length,
455
+ )
456
+
457
+ if headers is None:
458
+ headers = {}
459
+ header_keys = frozenset(to_str(k.lower()) for k in headers)
460
+ skip_accept_encoding = "accept-encoding" in header_keys
461
+ skip_host = "host" in header_keys
462
+ self.putrequest(
463
+ method, url, skip_accept_encoding=skip_accept_encoding, skip_host=skip_host
464
+ )
465
+
466
+ # Transform the body into an iterable of sendall()-able chunks
467
+ # and detect if an explicit Content-Length is doable.
468
+ chunks_and_cl = body_to_chunks(body, method=method, blocksize=self.blocksize)
469
+ chunks = chunks_and_cl.chunks
470
+ content_length = chunks_and_cl.content_length
471
+
472
+ # When chunked is explicit set to 'True' we respect that.
473
+ if chunked:
474
+ if "transfer-encoding" not in header_keys:
475
+ self.putheader("Transfer-Encoding", "chunked")
476
+ else:
477
+ # Detect whether a framing mechanism is already in use. If so
478
+ # we respect that value, otherwise we pick chunked vs content-length
479
+ # depending on the type of 'body'.
480
+ if "content-length" in header_keys:
481
+ chunked = False
482
+ elif "transfer-encoding" in header_keys:
483
+ chunked = True
484
+
485
+ # Otherwise we go off the recommendation of 'body_to_chunks()'.
486
+ else:
487
+ chunked = False
488
+ if content_length is None:
489
+ if chunks is not None:
490
+ chunked = True
491
+ self.putheader("Transfer-Encoding", "chunked")
492
+ else:
493
+ self.putheader("Content-Length", str(content_length))
494
+
495
+ # Now that framing headers are out of the way we send all the other headers.
496
+ if "user-agent" not in header_keys:
497
+ self.putheader("User-Agent", _get_default_user_agent())
498
+ for header, value in headers.items():
499
+ self.putheader(header, value)
500
+ self.endheaders()
501
+
502
+ # If we're given a body we start sending that in chunks.
503
+ if chunks is not None:
504
+ for chunk in chunks:
505
+ # Sending empty chunks isn't allowed for TE: chunked
506
+ # as it indicates the end of the body.
507
+ if not chunk:
508
+ continue
509
+ if isinstance(chunk, str):
510
+ chunk = chunk.encode("utf-8")
511
+ if chunked:
512
+ self.send(b"%x\r\n%b\r\n" % (len(chunk), chunk))
513
+ else:
514
+ self.send(chunk)
515
+
516
+ # Regardless of whether we have a body or not, if we're in
517
+ # chunked mode we want to send an explicit empty chunk.
518
+ if chunked:
519
+ self.send(b"0\r\n\r\n")
520
+
521
+ def request_chunked(
522
+ self,
523
+ method: str,
524
+ url: str,
525
+ body: _TYPE_BODY | None = None,
526
+ headers: typing.Mapping[str, str] | None = None,
527
+ ) -> None:
528
+ """
529
+ Alternative to the common request method, which sends the
530
+ body with chunked encoding and not as one block
531
+ """
532
+ warnings.warn(
533
+ "HTTPConnection.request_chunked() is deprecated and will be removed "
534
+ "in urllib3 v3.0. Instead use HTTPConnection.request(..., chunked=True).",
535
+ category=FutureWarning,
536
+ stacklevel=2,
537
+ )
538
+ self.request(method, url, body=body, headers=headers, chunked=True)
539
+
540
+ def getresponse( # type: ignore[override]
541
+ self,
542
+ ) -> HTTPResponse:
543
+ """
544
+ Get the response from the server.
545
+
546
+ If the HTTPConnection is in the correct state, returns an instance of HTTPResponse or of whatever object is returned by the response_class variable.
547
+
548
+ If a request has not been sent or if a previous response has not be handled, ResponseNotReady is raised. If the HTTP response indicates that the connection should be closed, then it will be closed before the response is returned. When the connection is closed, the underlying socket is closed.
549
+ """
550
+ # Raise the same error as http.client.HTTPConnection
551
+ if self._response_options is None:
552
+ raise ResponseNotReady()
553
+
554
+ # Reset this attribute for being used again.
555
+ resp_options = self._response_options
556
+ self._response_options = None
557
+
558
+ # Since the connection's timeout value may have been updated
559
+ # we need to set the timeout on the socket.
560
+ self.sock.settimeout(self.timeout)
561
+
562
+ # This is needed here to avoid circular import errors
563
+ from .response import HTTPResponse
564
+
565
+ # Save a reference to the shutdown function before ownership is passed
566
+ # to httplib_response
567
+ # TODO should we implement it everywhere?
568
+ _shutdown = getattr(self.sock, "shutdown", None)
569
+
570
+ # Get the response from http.client.HTTPConnection
571
+ httplib_response = super().getresponse()
572
+
573
+ try:
574
+ assert_header_parsing(httplib_response.msg)
575
+ except (HeaderParsingError, TypeError) as hpe:
576
+ log.warning(
577
+ "Failed to parse headers (url=%s): %s",
578
+ _url_from_connection(self, resp_options.request_url),
579
+ hpe,
580
+ exc_info=True,
581
+ )
582
+
583
+ headers = HTTPHeaderDict(httplib_response.msg.items())
584
+
585
+ response = HTTPResponse(
586
+ body=httplib_response,
587
+ headers=headers,
588
+ status=httplib_response.status,
589
+ version=httplib_response.version,
590
+ version_string=getattr(self, "_http_vsn_str", "HTTP/?"),
591
+ reason=httplib_response.reason,
592
+ preload_content=resp_options.preload_content,
593
+ decode_content=resp_options.decode_content,
594
+ original_response=httplib_response,
595
+ enforce_content_length=resp_options.enforce_content_length,
596
+ request_method=resp_options.request_method,
597
+ request_url=resp_options.request_url,
598
+ sock_shutdown=_shutdown,
599
+ )
600
+ return response
601
+
602
+
603
+ class HTTPSConnection(HTTPConnection):
604
+ """
605
+ Many of the parameters to this constructor are passed to the underlying SSL
606
+ socket by means of :py:func:`urllib3.util.ssl_wrap_socket`.
607
+ """
608
+
609
+ default_port = port_by_scheme["https"] # type: ignore[misc]
610
+
611
+ cert_reqs: int | str | None = None
612
+ ca_certs: str | None = None
613
+ ca_cert_dir: str | None = None
614
+ ca_cert_data: None | str | bytes = None
615
+ ssl_version: int | str | None = None
616
+ ssl_minimum_version: int | None = None
617
+ ssl_maximum_version: int | None = None
618
+ assert_fingerprint: str | None = None
619
+ _connect_callback: typing.Callable[..., None] | None = None
620
+
621
+ def __init__(
622
+ self,
623
+ host: str,
624
+ port: int | None = None,
625
+ *,
626
+ timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,
627
+ source_address: tuple[str, int] | None = None,
628
+ blocksize: int = 16384,
629
+ socket_options: None | (
630
+ connection._TYPE_SOCKET_OPTIONS
631
+ ) = HTTPConnection.default_socket_options,
632
+ proxy: Url | None = None,
633
+ proxy_config: ProxyConfig | None = None,
634
+ cert_reqs: int | str | None = None,
635
+ assert_hostname: None | str | typing.Literal[False] = None,
636
+ assert_fingerprint: str | None = None,
637
+ server_hostname: str | None = None,
638
+ ssl_context: ssl.SSLContext | None = None,
639
+ ca_certs: str | None = None,
640
+ ca_cert_dir: str | None = None,
641
+ ca_cert_data: None | str | bytes = None,
642
+ ssl_minimum_version: int | None = None,
643
+ ssl_maximum_version: int | None = None,
644
+ ssl_version: int | str | None = None, # Deprecated
645
+ cert_file: str | None = None,
646
+ key_file: str | None = None,
647
+ key_password: str | None = None,
648
+ ) -> None:
649
+ super().__init__(
650
+ host,
651
+ port=port,
652
+ timeout=timeout,
653
+ source_address=source_address,
654
+ blocksize=blocksize,
655
+ socket_options=socket_options,
656
+ proxy=proxy,
657
+ proxy_config=proxy_config,
658
+ )
659
+
660
+ self.key_file = key_file
661
+ self.cert_file = cert_file
662
+ self.key_password = key_password
663
+ self.ssl_context = ssl_context
664
+ self.server_hostname = server_hostname
665
+ self.assert_hostname = assert_hostname
666
+ self.assert_fingerprint = assert_fingerprint
667
+ self.ssl_version = ssl_version
668
+ self.ssl_minimum_version = ssl_minimum_version
669
+ self.ssl_maximum_version = ssl_maximum_version
670
+ self.ca_certs = ca_certs and os.path.expanduser(ca_certs)
671
+ self.ca_cert_dir = ca_cert_dir and os.path.expanduser(ca_cert_dir)
672
+ self.ca_cert_data = ca_cert_data
673
+
674
+ # cert_reqs depends on ssl_context so calculate last.
675
+ if cert_reqs is None:
676
+ if self.ssl_context is not None:
677
+ cert_reqs = self.ssl_context.verify_mode
678
+ else:
679
+ cert_reqs = resolve_cert_reqs(None)
680
+ self.cert_reqs = cert_reqs
681
+ self._connect_callback = None
682
+
683
+ def set_cert(
684
+ self,
685
+ key_file: str | None = None,
686
+ cert_file: str | None = None,
687
+ cert_reqs: int | str | None = None,
688
+ key_password: str | None = None,
689
+ ca_certs: str | None = None,
690
+ assert_hostname: None | str | typing.Literal[False] = None,
691
+ assert_fingerprint: str | None = None,
692
+ ca_cert_dir: str | None = None,
693
+ ca_cert_data: None | str | bytes = None,
694
+ ) -> None:
695
+ """
696
+ This method should only be called once, before the connection is used.
697
+ """
698
+ warnings.warn(
699
+ "HTTPSConnection.set_cert() is deprecated and will be removed "
700
+ "in urllib3 v3.0. Instead provide the parameters to the "
701
+ "HTTPSConnection constructor.",
702
+ category=FutureWarning,
703
+ stacklevel=2,
704
+ )
705
+
706
+ # If cert_reqs is not provided we'll assume CERT_REQUIRED unless we also
707
+ # have an SSLContext object in which case we'll use its verify_mode.
708
+ if cert_reqs is None:
709
+ if self.ssl_context is not None:
710
+ cert_reqs = self.ssl_context.verify_mode
711
+ else:
712
+ cert_reqs = resolve_cert_reqs(None)
713
+
714
+ self.key_file = key_file
715
+ self.cert_file = cert_file
716
+ self.cert_reqs = cert_reqs
717
+ self.key_password = key_password
718
+ self.assert_hostname = assert_hostname
719
+ self.assert_fingerprint = assert_fingerprint
720
+ self.ca_certs = ca_certs and os.path.expanduser(ca_certs)
721
+ self.ca_cert_dir = ca_cert_dir and os.path.expanduser(ca_cert_dir)
722
+ self.ca_cert_data = ca_cert_data
723
+
724
+ def connect(self) -> None:
725
+ # Today we don't need to be doing this step before the /actual/ socket
726
+ # connection, however in the future we'll need to decide whether to
727
+ # create a new socket or re-use an existing "shared" socket as a part
728
+ # of the HTTP/2 handshake dance.
729
+ if self._tunnel_host is not None and self._tunnel_port is not None:
730
+ probe_http2_host = self._tunnel_host
731
+ probe_http2_port = self._tunnel_port
732
+ else:
733
+ probe_http2_host = self.host
734
+ probe_http2_port = self.port
735
+
736
+ # Check if the target origin supports HTTP/2.
737
+ # If the value comes back as 'None' it means that the current thread
738
+ # is probing for HTTP/2 support. Otherwise, we're waiting for another
739
+ # probe to complete, or we get a value right away.
740
+ target_supports_http2: bool | None
741
+ if "h2" in ssl_.ALPN_PROTOCOLS:
742
+ target_supports_http2 = http2_probe.acquire_and_get(
743
+ host=probe_http2_host, port=probe_http2_port
744
+ )
745
+ else:
746
+ # If HTTP/2 isn't going to be offered it doesn't matter if
747
+ # the target supports HTTP/2. Don't want to make a probe.
748
+ target_supports_http2 = False
749
+
750
+ if self._connect_callback is not None:
751
+ self._connect_callback(
752
+ "before connect",
753
+ thread_id=threading.get_ident(),
754
+ target_supports_http2=target_supports_http2,
755
+ )
756
+
757
+ try:
758
+ sock: socket.socket | ssl.SSLSocket
759
+ self.sock = sock = self._new_conn()
760
+ server_hostname: str = self.host
761
+ tls_in_tls = False
762
+
763
+ # Do we need to establish a tunnel?
764
+ if self.proxy_is_tunneling:
765
+ # We're tunneling to an HTTPS origin so need to do TLS-in-TLS.
766
+ if self._tunnel_scheme == "https":
767
+ # _connect_tls_proxy will verify and assign proxy_is_verified
768
+ self.sock = sock = self._connect_tls_proxy(self.host, sock)
769
+ tls_in_tls = True
770
+ elif self._tunnel_scheme == "http":
771
+ self.proxy_is_verified = False
772
+
773
+ # If we're tunneling it means we're connected to our proxy.
774
+ self._has_connected_to_proxy = True
775
+
776
+ self._tunnel()
777
+ # Override the host with the one we're requesting data from.
778
+ server_hostname = typing.cast(str, self._tunnel_host)
779
+
780
+ if self.server_hostname is not None:
781
+ server_hostname = self.server_hostname
782
+
783
+ is_time_off = datetime.date.today() < RECENT_DATE
784
+ if is_time_off:
785
+ warnings.warn(
786
+ (
787
+ f"System time is way off (before {RECENT_DATE}). This will probably "
788
+ "lead to SSL verification errors"
789
+ ),
790
+ SystemTimeWarning,
791
+ )
792
+
793
+ # Remove trailing '.' from fqdn hostnames to allow certificate validation
794
+ server_hostname_rm_dot = server_hostname.rstrip(".")
795
+
796
+ sock_and_verified = _ssl_wrap_socket_and_match_hostname(
797
+ sock=sock,
798
+ cert_reqs=self.cert_reqs,
799
+ ssl_version=self.ssl_version,
800
+ ssl_minimum_version=self.ssl_minimum_version,
801
+ ssl_maximum_version=self.ssl_maximum_version,
802
+ ca_certs=self.ca_certs,
803
+ ca_cert_dir=self.ca_cert_dir,
804
+ ca_cert_data=self.ca_cert_data,
805
+ cert_file=self.cert_file,
806
+ key_file=self.key_file,
807
+ key_password=self.key_password,
808
+ server_hostname=server_hostname_rm_dot,
809
+ ssl_context=self.ssl_context,
810
+ tls_in_tls=tls_in_tls,
811
+ assert_hostname=self.assert_hostname,
812
+ assert_fingerprint=self.assert_fingerprint,
813
+ )
814
+ self.sock = sock_and_verified.socket
815
+
816
+ # If an error occurs during connection/handshake we may need to release
817
+ # our lock so another connection can probe the origin.
818
+ except BaseException:
819
+ if self._connect_callback is not None:
820
+ self._connect_callback(
821
+ "after connect failure",
822
+ thread_id=threading.get_ident(),
823
+ target_supports_http2=target_supports_http2,
824
+ )
825
+
826
+ if target_supports_http2 is None:
827
+ http2_probe.set_and_release(
828
+ host=probe_http2_host, port=probe_http2_port, supports_http2=None
829
+ )
830
+ raise
831
+
832
+ # If this connection doesn't know if the origin supports HTTP/2
833
+ # we report back to the HTTP/2 probe our result.
834
+ if target_supports_http2 is None:
835
+ supports_http2 = sock_and_verified.socket.selected_alpn_protocol() == "h2"
836
+ http2_probe.set_and_release(
837
+ host=probe_http2_host,
838
+ port=probe_http2_port,
839
+ supports_http2=supports_http2,
840
+ )
841
+
842
+ # Forwarding proxies can never have a verified target since
843
+ # the proxy is the one doing the verification. Should instead
844
+ # use a CONNECT tunnel in order to verify the target.
845
+ # See: https://github.com/urllib3/urllib3/issues/3267.
846
+ if self.proxy_is_forwarding:
847
+ self.is_verified = False
848
+ else:
849
+ self.is_verified = sock_and_verified.is_verified
850
+
851
+ # If there's a proxy to be connected to we are fully connected.
852
+ # This is set twice (once above and here) due to forwarding proxies
853
+ # not using tunnelling.
854
+ self._has_connected_to_proxy = bool(self.proxy)
855
+
856
+ # Set `self.proxy_is_verified` unless it's already set while
857
+ # establishing a tunnel.
858
+ if self._has_connected_to_proxy and self.proxy_is_verified is None:
859
+ self.proxy_is_verified = sock_and_verified.is_verified
860
+
861
+ def _connect_tls_proxy(self, hostname: str, sock: socket.socket) -> ssl.SSLSocket:
862
+ """
863
+ Establish a TLS connection to the proxy using the provided SSL context.
864
+ """
865
+ # `_connect_tls_proxy` is called when self._tunnel_host is truthy.
866
+ proxy_config = typing.cast(ProxyConfig, self.proxy_config)
867
+ ssl_context = proxy_config.ssl_context
868
+ sock_and_verified = _ssl_wrap_socket_and_match_hostname(
869
+ sock,
870
+ cert_reqs=self.cert_reqs,
871
+ ssl_version=self.ssl_version,
872
+ ssl_minimum_version=self.ssl_minimum_version,
873
+ ssl_maximum_version=self.ssl_maximum_version,
874
+ ca_certs=self.ca_certs,
875
+ ca_cert_dir=self.ca_cert_dir,
876
+ ca_cert_data=self.ca_cert_data,
877
+ server_hostname=hostname,
878
+ ssl_context=ssl_context,
879
+ assert_hostname=proxy_config.assert_hostname,
880
+ assert_fingerprint=proxy_config.assert_fingerprint,
881
+ # Features that aren't implemented for proxies yet:
882
+ cert_file=None,
883
+ key_file=None,
884
+ key_password=None,
885
+ tls_in_tls=False,
886
+ )
887
+ self.proxy_is_verified = sock_and_verified.is_verified
888
+ return sock_and_verified.socket # type: ignore[return-value]
889
+
890
+
891
+ class _WrappedAndVerifiedSocket(typing.NamedTuple):
892
+ """
893
+ Wrapped socket and whether the connection is
894
+ verified after the TLS handshake
895
+ """
896
+
897
+ socket: ssl.SSLSocket | SSLTransport
898
+ is_verified: bool
899
+
900
+
901
+ def _ssl_wrap_socket_and_match_hostname(
902
+ sock: socket.socket,
903
+ *,
904
+ cert_reqs: None | str | int,
905
+ ssl_version: None | str | int,
906
+ ssl_minimum_version: int | None,
907
+ ssl_maximum_version: int | None,
908
+ cert_file: str | None,
909
+ key_file: str | None,
910
+ key_password: str | None,
911
+ ca_certs: str | None,
912
+ ca_cert_dir: str | None,
913
+ ca_cert_data: None | str | bytes,
914
+ assert_hostname: None | str | typing.Literal[False],
915
+ assert_fingerprint: str | None,
916
+ server_hostname: str | None,
917
+ ssl_context: ssl.SSLContext | None,
918
+ tls_in_tls: bool = False,
919
+ ) -> _WrappedAndVerifiedSocket:
920
+ """Logic for constructing an SSLContext from all TLS parameters, passing
921
+ that down into ssl_wrap_socket, and then doing certificate verification
922
+ either via hostname or fingerprint. This function exists to guarantee
923
+ that both proxies and targets have the same behavior when connecting via TLS.
924
+ """
925
+ default_ssl_context = False
926
+ if ssl_context is None:
927
+ default_ssl_context = True
928
+ context = create_urllib3_context(
929
+ ssl_version=resolve_ssl_version(ssl_version),
930
+ ssl_minimum_version=ssl_minimum_version,
931
+ ssl_maximum_version=ssl_maximum_version,
932
+ cert_reqs=resolve_cert_reqs(cert_reqs),
933
+ )
934
+ else:
935
+ context = ssl_context
936
+
937
+ context.verify_mode = resolve_cert_reqs(cert_reqs)
938
+
939
+ # In some cases, we want to verify hostnames ourselves
940
+ if (
941
+ # `ssl` can't verify fingerprints or alternate hostnames
942
+ assert_fingerprint
943
+ or assert_hostname
944
+ # assert_hostname can be set to False to disable hostname checking
945
+ or assert_hostname is False
946
+ # We still support OpenSSL 1.0.2, which prevents us from verifying
947
+ # hostnames easily: https://github.com/pyca/pyopenssl/pull/933
948
+ or ssl_.IS_PYOPENSSL
949
+ or not ssl_.HAS_NEVER_CHECK_COMMON_NAME
950
+ ):
951
+ context.check_hostname = False
952
+
953
+ # Try to load OS default certs if none are given. We need to do the hasattr() check
954
+ # for custom pyOpenSSL SSLContext objects because they don't support
955
+ # load_default_certs().
956
+ if (
957
+ not ca_certs
958
+ and not ca_cert_dir
959
+ and not ca_cert_data
960
+ and default_ssl_context
961
+ and hasattr(context, "load_default_certs")
962
+ ):
963
+ context.load_default_certs()
964
+
965
+ # Ensure that IPv6 addresses are in the proper format and don't have a
966
+ # scope ID. Python's SSL module fails to recognize scoped IPv6 addresses
967
+ # and interprets them as DNS hostnames.
968
+ if server_hostname is not None:
969
+ normalized = server_hostname.strip("[]")
970
+ if "%" in normalized:
971
+ normalized = normalized[: normalized.rfind("%")]
972
+ if is_ipaddress(normalized):
973
+ server_hostname = normalized
974
+
975
+ ssl_sock = ssl_wrap_socket(
976
+ sock=sock,
977
+ keyfile=key_file,
978
+ certfile=cert_file,
979
+ key_password=key_password,
980
+ ca_certs=ca_certs,
981
+ ca_cert_dir=ca_cert_dir,
982
+ ca_cert_data=ca_cert_data,
983
+ server_hostname=server_hostname,
984
+ ssl_context=context,
985
+ tls_in_tls=tls_in_tls,
986
+ )
987
+
988
+ try:
989
+ if assert_fingerprint:
990
+ _assert_fingerprint(
991
+ ssl_sock.getpeercert(binary_form=True), assert_fingerprint
992
+ )
993
+ elif (
994
+ context.verify_mode != ssl.CERT_NONE
995
+ and not context.check_hostname
996
+ and assert_hostname is not False
997
+ ):
998
+ cert: _TYPE_PEER_CERT_RET_DICT = ssl_sock.getpeercert() # type: ignore[assignment]
999
+
1000
+ # Need to signal to our match_hostname whether to use 'commonName' or not.
1001
+ # If we're using our own constructed SSLContext we explicitly set 'False'
1002
+ # because PyPy hard-codes 'True' from SSLContext.hostname_checks_common_name.
1003
+ if default_ssl_context:
1004
+ hostname_checks_common_name = False
1005
+ else:
1006
+ hostname_checks_common_name = (
1007
+ getattr(context, "hostname_checks_common_name", False) or False
1008
+ )
1009
+
1010
+ _match_hostname(
1011
+ cert,
1012
+ assert_hostname or server_hostname, # type: ignore[arg-type]
1013
+ hostname_checks_common_name,
1014
+ )
1015
+
1016
+ return _WrappedAndVerifiedSocket(
1017
+ socket=ssl_sock,
1018
+ is_verified=context.verify_mode == ssl.CERT_REQUIRED
1019
+ or bool(assert_fingerprint),
1020
+ )
1021
+ except BaseException:
1022
+ ssl_sock.close()
1023
+ raise
1024
+
1025
+
1026
+ def _match_hostname(
1027
+ cert: _TYPE_PEER_CERT_RET_DICT | None,
1028
+ asserted_hostname: str,
1029
+ hostname_checks_common_name: bool = False,
1030
+ ) -> None:
1031
+ # Our upstream implementation of ssl.match_hostname()
1032
+ # only applies this normalization to IP addresses so it doesn't
1033
+ # match DNS SANs so we do the same thing!
1034
+ stripped_hostname = asserted_hostname.strip("[]")
1035
+ if is_ipaddress(stripped_hostname):
1036
+ asserted_hostname = stripped_hostname
1037
+
1038
+ try:
1039
+ match_hostname(cert, asserted_hostname, hostname_checks_common_name)
1040
+ except CertificateError as e:
1041
+ log.warning(
1042
+ "Certificate did not match expected hostname: %s. Certificate: %s",
1043
+ asserted_hostname,
1044
+ cert,
1045
+ )
1046
+ # Add cert to exception and reraise so client code can inspect
1047
+ # the cert when catching the exception, if they want to
1048
+ e._peer_cert = cert # type: ignore[attr-defined]
1049
+ raise
1050
+
1051
+
1052
+ def _wrap_proxy_error(err: Exception, proxy_scheme: str | None) -> ProxyError:
1053
+ # Look for the phrase 'wrong version number', if found
1054
+ # then we should warn the user that we're very sure that
1055
+ # this proxy is HTTP-only and they have a configuration issue.
1056
+ error_normalized = " ".join(re.split("[^a-z]", str(err).lower()))
1057
+ is_likely_http_proxy = (
1058
+ "wrong version number" in error_normalized
1059
+ or "unknown protocol" in error_normalized
1060
+ or "record layer failure" in error_normalized
1061
+ )
1062
+ http_proxy_warning = (
1063
+ ". Your proxy appears to only use HTTP and not HTTPS, "
1064
+ "try changing your proxy URL to be HTTP. See: "
1065
+ "https://urllib3.readthedocs.io/en/latest/advanced-usage.html"
1066
+ "#https-proxy-error-http-proxy"
1067
+ )
1068
+ new_err = ProxyError(
1069
+ f"Unable to connect to proxy"
1070
+ f"{http_proxy_warning if is_likely_http_proxy and proxy_scheme == 'https' else ''}",
1071
+ err,
1072
+ )
1073
+ new_err.__cause__ = err
1074
+ return new_err
1075
+
1076
+
1077
+ def _get_default_user_agent() -> str:
1078
+ return f"python-urllib3/{__version__}"
1079
+
1080
+
1081
+ class DummyConnection:
1082
+ """Used to detect a failed ConnectionCls import."""
1083
+
1084
+
1085
+ if not ssl:
1086
+ HTTPSConnection = DummyConnection # type: ignore[misc, assignment] # noqa: F811
1087
+
1088
+
1089
+ VerifiedHTTPSConnection = HTTPSConnection
1090
+
1091
+
1092
+ def _url_from_connection(
1093
+ conn: HTTPConnection | HTTPSConnection, path: str | None = None
1094
+ ) -> str:
1095
+ """Returns the URL from a given connection. This is mainly used for testing and logging."""
1096
+
1097
+ scheme = "https" if isinstance(conn, HTTPSConnection) else "http"
1098
+
1099
+ return Url(scheme=scheme, host=conn.host, port=conn.port, path=path).url
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0/site-packages/urllib3/connectionpool.py ADDED
@@ -0,0 +1,1191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import errno
4
+ import logging
5
+ import queue
6
+ import sys
7
+ import typing
8
+ import warnings
9
+ import weakref
10
+ from socket import timeout as SocketTimeout
11
+ from types import TracebackType
12
+
13
+ from ._base_connection import _TYPE_BODY
14
+ from ._collections import HTTPHeaderDict
15
+ from ._request_methods import RequestMethods
16
+ from .connection import (
17
+ BaseSSLError,
18
+ BrokenPipeError,
19
+ DummyConnection,
20
+ HTTPConnection,
21
+ HTTPException,
22
+ HTTPSConnection,
23
+ ProxyConfig,
24
+ _wrap_proxy_error,
25
+ )
26
+ from .connection import port_by_scheme as port_by_scheme
27
+ from .exceptions import (
28
+ ClosedPoolError,
29
+ EmptyPoolError,
30
+ FullPoolError,
31
+ HostChangedError,
32
+ InsecureRequestWarning,
33
+ LocationValueError,
34
+ MaxRetryError,
35
+ NewConnectionError,
36
+ ProtocolError,
37
+ ProxyError,
38
+ ReadTimeoutError,
39
+ SSLError,
40
+ TimeoutError,
41
+ )
42
+ from .response import BaseHTTPResponse
43
+ from .util.connection import is_connection_dropped
44
+ from .util.proxy import connection_requires_http_tunnel
45
+ from .util.request import _TYPE_BODY_POSITION, set_file_position
46
+ from .util.retry import Retry
47
+ from .util.ssl_match_hostname import CertificateError
48
+ from .util.timeout import _DEFAULT_TIMEOUT, _TYPE_DEFAULT, Timeout
49
+ from .util.url import Url, _encode_target
50
+ from .util.url import _normalize_host as normalize_host
51
+ from .util.url import parse_url
52
+ from .util.util import to_str
53
+
54
+ if typing.TYPE_CHECKING:
55
+ import ssl
56
+
57
+ from typing_extensions import Self
58
+
59
+ from ._base_connection import BaseHTTPConnection, BaseHTTPSConnection
60
+
61
+ log = logging.getLogger(__name__)
62
+
63
+ _TYPE_TIMEOUT = typing.Union[Timeout, float, _TYPE_DEFAULT, None]
64
+
65
+
66
+ # Pool objects
67
+ class ConnectionPool:
68
+ """
69
+ Base class for all connection pools, such as
70
+ :class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`.
71
+
72
+ .. note::
73
+ ConnectionPool.urlopen() does not normalize or percent-encode target URIs
74
+ which is useful if your target server doesn't support percent-encoded
75
+ target URIs.
76
+ """
77
+
78
+ scheme: str | None = None
79
+ QueueCls = queue.LifoQueue
80
+
81
+ def __init__(self, host: str, port: int | None = None) -> None:
82
+ if not host:
83
+ raise LocationValueError("No host specified.")
84
+
85
+ self.host = _normalize_host(host, scheme=self.scheme)
86
+ self.port = port
87
+
88
+ # This property uses 'normalize_host()' (not '_normalize_host()')
89
+ # to avoid removing square braces around IPv6 addresses.
90
+ # This value is sent to `HTTPConnection.set_tunnel()` if called
91
+ # because square braces are required for HTTP CONNECT tunneling.
92
+ self._tunnel_host = normalize_host(host, scheme=self.scheme).lower()
93
+
94
+ def __str__(self) -> str:
95
+ return f"{type(self).__name__}(host={self.host!r}, port={self.port!r})"
96
+
97
+ def __enter__(self) -> Self:
98
+ return self
99
+
100
+ def __exit__(
101
+ self,
102
+ exc_type: type[BaseException] | None,
103
+ exc_val: BaseException | None,
104
+ exc_tb: TracebackType | None,
105
+ ) -> typing.Literal[False]:
106
+ self.close()
107
+ # Return False to re-raise any potential exceptions
108
+ return False
109
+
110
+ def close(self) -> None:
111
+ """
112
+ Close all pooled connections and disable the pool.
113
+ """
114
+
115
+
116
+ # This is taken from http://hg.python.org/cpython/file/7aaba721ebc0/Lib/socket.py#l252
117
+ _blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}
118
+
119
+
120
+ class HTTPConnectionPool(ConnectionPool, RequestMethods):
121
+ """
122
+ Thread-safe connection pool for one host.
123
+
124
+ :param host:
125
+ Host used for this HTTP Connection (e.g. "localhost"), passed into
126
+ :class:`http.client.HTTPConnection`.
127
+
128
+ :param port:
129
+ Port used for this HTTP Connection (None is equivalent to 80), passed
130
+ into :class:`http.client.HTTPConnection`.
131
+
132
+ :param timeout:
133
+ Socket timeout in seconds for each individual connection. This can
134
+ be a float or integer, which sets the timeout for the HTTP request,
135
+ or an instance of :class:`urllib3.util.Timeout` which gives you more
136
+ fine-grained control over request timeouts. After the constructor has
137
+ been parsed, this is always a `urllib3.util.Timeout` object.
138
+
139
+ :param maxsize:
140
+ Number of connections to save that can be reused. More than 1 is useful
141
+ in multithreaded situations. If ``block`` is set to False, more
142
+ connections will be created but they will not be saved once they've
143
+ been used.
144
+
145
+ :param block:
146
+ If set to True, no more than ``maxsize`` connections will be used at
147
+ a time. When no free connections are available, the call will block
148
+ until a connection has been released. This is a useful side effect for
149
+ particular multithreaded situations where one does not want to use more
150
+ than maxsize connections per host to prevent flooding.
151
+
152
+ :param headers:
153
+ Headers to include with all requests, unless other headers are given
154
+ explicitly.
155
+
156
+ :param retries:
157
+ Retry configuration to use by default with requests in this pool.
158
+
159
+ :param _proxy:
160
+ Parsed proxy URL, should not be used directly, instead, see
161
+ :class:`urllib3.ProxyManager`
162
+
163
+ :param _proxy_headers:
164
+ A dictionary with proxy headers, should not be used directly,
165
+ instead, see :class:`urllib3.ProxyManager`
166
+
167
+ :param \\**conn_kw:
168
+ Additional parameters are used to create fresh :class:`urllib3.connection.HTTPConnection`,
169
+ :class:`urllib3.connection.HTTPSConnection` instances.
170
+ """
171
+
172
+ scheme = "http"
173
+ ConnectionCls: type[BaseHTTPConnection] | type[BaseHTTPSConnection] = HTTPConnection
174
+
175
+ def __init__(
176
+ self,
177
+ host: str,
178
+ port: int | None = None,
179
+ timeout: _TYPE_TIMEOUT | None = _DEFAULT_TIMEOUT,
180
+ maxsize: int = 1,
181
+ block: bool = False,
182
+ headers: typing.Mapping[str, str] | None = None,
183
+ retries: Retry | bool | int | None = None,
184
+ _proxy: Url | None = None,
185
+ _proxy_headers: typing.Mapping[str, str] | None = None,
186
+ _proxy_config: ProxyConfig | None = None,
187
+ **conn_kw: typing.Any,
188
+ ):
189
+ ConnectionPool.__init__(self, host, port)
190
+ RequestMethods.__init__(self, headers)
191
+
192
+ if not isinstance(timeout, Timeout):
193
+ timeout = Timeout.from_float(timeout)
194
+
195
+ if retries is None:
196
+ retries = Retry.DEFAULT
197
+
198
+ self.timeout = timeout
199
+ self.retries = retries
200
+
201
+ self.pool: queue.LifoQueue[typing.Any] | None = self.QueueCls(maxsize)
202
+ self.block = block
203
+
204
+ self.proxy = _proxy
205
+ self.proxy_headers = _proxy_headers or {}
206
+ self.proxy_config = _proxy_config
207
+
208
+ # Fill the queue up so that doing get() on it will block properly
209
+ for _ in range(maxsize):
210
+ self.pool.put(None)
211
+
212
+ # These are mostly for testing and debugging purposes.
213
+ self.num_connections = 0
214
+ self.num_requests = 0
215
+ self.conn_kw = conn_kw
216
+
217
+ if self.proxy:
218
+ # Enable Nagle's algorithm for proxies, to avoid packet fragmentation.
219
+ # Defaulting `socket_options` to an empty list avoids it defaulting to
220
+ # ``HTTPConnection.default_socket_options``.
221
+ self.conn_kw.setdefault("socket_options", [])
222
+
223
+ self.conn_kw["proxy"] = self.proxy
224
+ self.conn_kw["proxy_config"] = self.proxy_config
225
+
226
+ # Do not pass 'self' as callback to 'finalize'.
227
+ # Then the 'finalize' would keep an endless living (leak) to self.
228
+ # By just passing a reference to the pool allows the garbage collector
229
+ # to free self if nobody else has a reference to it.
230
+ pool = self.pool
231
+
232
+ # Close all the HTTPConnections in the pool before the
233
+ # HTTPConnectionPool object is garbage collected.
234
+ weakref.finalize(self, _close_pool_connections, pool)
235
+
236
+ def _new_conn(self) -> BaseHTTPConnection:
237
+ """
238
+ Return a fresh :class:`HTTPConnection`.
239
+ """
240
+ self.num_connections += 1
241
+ log.debug(
242
+ "Starting new HTTP connection (%d): %s:%s",
243
+ self.num_connections,
244
+ self.host,
245
+ self.port or "80",
246
+ )
247
+
248
+ conn = self.ConnectionCls(
249
+ host=self.host,
250
+ port=self.port,
251
+ timeout=self.timeout.connect_timeout,
252
+ **self.conn_kw,
253
+ )
254
+ return conn
255
+
256
+ def _get_conn(self, timeout: float | None = None) -> BaseHTTPConnection:
257
+ """
258
+ Get a connection. Will return a pooled connection if one is available.
259
+
260
+ If no connections are available and :prop:`.block` is ``False``, then a
261
+ fresh connection is returned.
262
+
263
+ :param timeout:
264
+ Seconds to wait before giving up and raising
265
+ :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and
266
+ :prop:`.block` is ``True``.
267
+ """
268
+ conn = None
269
+
270
+ if self.pool is None:
271
+ raise ClosedPoolError(self, "Pool is closed.")
272
+
273
+ try:
274
+ conn = self.pool.get(block=self.block, timeout=timeout)
275
+
276
+ except AttributeError: # self.pool is None
277
+ raise ClosedPoolError(self, "Pool is closed.") from None # Defensive:
278
+
279
+ except queue.Empty:
280
+ if self.block:
281
+ raise EmptyPoolError(
282
+ self,
283
+ "Pool is empty and a new connection can't be opened due to blocking mode.",
284
+ ) from None
285
+ pass # Oh well, we'll create a new connection then
286
+
287
+ # If this is a persistent connection, check if it got disconnected
288
+ if conn and is_connection_dropped(conn):
289
+ log.debug("Resetting dropped connection: %s", self.host)
290
+ conn.close()
291
+
292
+ return conn or self._new_conn()
293
+
294
+ def _put_conn(self, conn: BaseHTTPConnection | None) -> None:
295
+ """
296
+ Put a connection back into the pool.
297
+
298
+ :param conn:
299
+ Connection object for the current host and port as returned by
300
+ :meth:`._new_conn` or :meth:`._get_conn`.
301
+
302
+ If the pool is already full, the connection is closed and discarded
303
+ because we exceeded maxsize. If connections are discarded frequently,
304
+ then maxsize should be increased.
305
+
306
+ If the pool is closed, then the connection will be closed and discarded.
307
+ """
308
+ if self.pool is not None:
309
+ try:
310
+ self.pool.put(conn, block=False)
311
+ return # Everything is dandy, done.
312
+ except AttributeError:
313
+ # self.pool is None.
314
+ pass
315
+ except queue.Full:
316
+ # Connection never got put back into the pool, close it.
317
+ if conn:
318
+ conn.close()
319
+
320
+ if self.block:
321
+ # This should never happen if you got the conn from self._get_conn
322
+ raise FullPoolError(
323
+ self,
324
+ "Pool reached maximum size and no more connections are allowed.",
325
+ ) from None
326
+
327
+ log.warning(
328
+ "Connection pool is full, discarding connection: %s. Connection pool size: %s",
329
+ self.host,
330
+ self.pool.qsize(),
331
+ )
332
+
333
+ # Connection never got put back into the pool, close it.
334
+ if conn:
335
+ conn.close()
336
+
337
+ def _validate_conn(self, conn: BaseHTTPConnection) -> None:
338
+ """
339
+ Called right before a request is made, after the socket is created.
340
+ """
341
+
342
+ def _prepare_proxy(self, conn: BaseHTTPConnection) -> None:
343
+ # Nothing to do for HTTP connections.
344
+ pass
345
+
346
+ def _get_timeout(self, timeout: _TYPE_TIMEOUT) -> Timeout:
347
+ """Helper that always returns a :class:`urllib3.util.Timeout`"""
348
+ if timeout is _DEFAULT_TIMEOUT:
349
+ return self.timeout.clone()
350
+
351
+ if isinstance(timeout, Timeout):
352
+ return timeout.clone()
353
+ else:
354
+ # User passed us an int/float. This is for backwards compatibility,
355
+ # can be removed later
356
+ return Timeout.from_float(timeout)
357
+
358
+ def _raise_timeout(
359
+ self,
360
+ err: BaseSSLError | OSError | SocketTimeout,
361
+ url: str,
362
+ timeout_value: _TYPE_TIMEOUT | None,
363
+ ) -> None:
364
+ """Is the error actually a timeout? Will raise a ReadTimeout or pass"""
365
+
366
+ if isinstance(err, SocketTimeout):
367
+ raise ReadTimeoutError(
368
+ self, url, f"Read timed out. (read timeout={timeout_value})"
369
+ ) from err
370
+
371
+ # See the above comment about EAGAIN in Python 3.
372
+ if hasattr(err, "errno") and err.errno in _blocking_errnos:
373
+ raise ReadTimeoutError(
374
+ self, url, f"Read timed out. (read timeout={timeout_value})"
375
+ ) from err
376
+
377
+ def _make_request(
378
+ self,
379
+ conn: BaseHTTPConnection,
380
+ method: str,
381
+ url: str,
382
+ body: _TYPE_BODY | None = None,
383
+ headers: typing.Mapping[str, str] | None = None,
384
+ retries: Retry | None = None,
385
+ timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,
386
+ chunked: bool = False,
387
+ response_conn: BaseHTTPConnection | None = None,
388
+ preload_content: bool = True,
389
+ decode_content: bool = True,
390
+ enforce_content_length: bool = True,
391
+ ) -> BaseHTTPResponse:
392
+ """
393
+ Perform a request on a given urllib connection object taken from our
394
+ pool.
395
+
396
+ :param conn:
397
+ a connection from one of our connection pools
398
+
399
+ :param method:
400
+ HTTP request method (such as GET, POST, PUT, etc.)
401
+
402
+ :param url:
403
+ The URL to perform the request on.
404
+
405
+ :param body:
406
+ Data to send in the request body, either :class:`str`, :class:`bytes`,
407
+ an iterable of :class:`str`/:class:`bytes`, or a file-like object.
408
+
409
+ :param headers:
410
+ Dictionary of custom headers to send, such as User-Agent,
411
+ If-None-Match, etc. If None, pool headers are used. If provided,
412
+ these headers completely replace any pool-specific headers.
413
+
414
+ :param retries:
415
+ Configure the number of retries to allow before raising a
416
+ :class:`~urllib3.exceptions.MaxRetryError` exception.
417
+
418
+ Pass ``None`` to retry until you receive a response. Pass a
419
+ :class:`~urllib3.util.retry.Retry` object for fine-grained control
420
+ over different types of retries.
421
+ Pass an integer number to retry connection errors that many times,
422
+ but no other types of errors. Pass zero to never retry.
423
+
424
+ If ``False``, then retries are disabled and any exception is raised
425
+ immediately. Also, instead of raising a MaxRetryError on redirects,
426
+ the redirect response will be returned.
427
+
428
+ :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.
429
+
430
+ :param timeout:
431
+ If specified, overrides the default timeout for this one
432
+ request. It may be a float (in seconds) or an instance of
433
+ :class:`urllib3.util.Timeout`.
434
+
435
+ :param chunked:
436
+ If True, urllib3 will send the body using chunked transfer
437
+ encoding. Otherwise, urllib3 will send the body using the standard
438
+ content-length form. Defaults to False.
439
+
440
+ :param response_conn:
441
+ Set this to ``None`` if you will handle releasing the connection or
442
+ set the connection to have the response release it.
443
+
444
+ :param preload_content:
445
+ If True, the response's body will be preloaded during construction.
446
+
447
+ :param decode_content:
448
+ If True, will attempt to decode the body based on the
449
+ 'content-encoding' header.
450
+
451
+ :param enforce_content_length:
452
+ Enforce content length checking. Body returned by server must match
453
+ value of Content-Length header, if present. Otherwise, raise error.
454
+ """
455
+ self.num_requests += 1
456
+
457
+ timeout_obj = self._get_timeout(timeout)
458
+ timeout_obj.start_connect()
459
+ conn.timeout = Timeout.resolve_default_timeout(timeout_obj.connect_timeout)
460
+
461
+ try:
462
+ # Trigger any extra validation we need to do.
463
+ try:
464
+ self._validate_conn(conn)
465
+ except (SocketTimeout, BaseSSLError) as e:
466
+ self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
467
+ raise
468
+
469
+ # _validate_conn() starts the connection to an HTTPS proxy
470
+ # so we need to wrap errors with 'ProxyError' here too.
471
+ except (
472
+ OSError,
473
+ NewConnectionError,
474
+ TimeoutError,
475
+ BaseSSLError,
476
+ CertificateError,
477
+ SSLError,
478
+ ) as e:
479
+ new_e: Exception = e
480
+ if isinstance(e, (BaseSSLError, CertificateError)):
481
+ new_e = SSLError(e)
482
+ # If the connection didn't successfully connect to it's proxy
483
+ # then there
484
+ if isinstance(
485
+ new_e, (OSError, NewConnectionError, TimeoutError, SSLError)
486
+ ) and (conn and conn.proxy and not conn.has_connected_to_proxy):
487
+ new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)
488
+ raise new_e
489
+
490
+ # conn.request() calls http.client.*.request, not the method in
491
+ # urllib3.request. It also calls makefile (recv) on the socket.
492
+ try:
493
+ conn.request(
494
+ method,
495
+ url,
496
+ body=body,
497
+ headers=headers,
498
+ chunked=chunked,
499
+ preload_content=preload_content,
500
+ decode_content=decode_content,
501
+ enforce_content_length=enforce_content_length,
502
+ )
503
+
504
+ # We are swallowing BrokenPipeError (errno.EPIPE) since the server is
505
+ # legitimately able to close the connection after sending a valid response.
506
+ # With this behaviour, the received response is still readable.
507
+ except BrokenPipeError:
508
+ pass
509
+ except OSError as e:
510
+ # MacOS/Linux
511
+ # EPROTOTYPE and ECONNRESET are needed on macOS
512
+ # https://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
513
+ # Condition changed later to emit ECONNRESET instead of only EPROTOTYPE.
514
+ if e.errno != errno.EPROTOTYPE and e.errno != errno.ECONNRESET:
515
+ raise
516
+
517
+ # Reset the timeout for the recv() on the socket
518
+ read_timeout = timeout_obj.read_timeout
519
+
520
+ if not conn.is_closed:
521
+ # In Python 3 socket.py will catch EAGAIN and return None when you
522
+ # try and read into the file pointer created by http.client, which
523
+ # instead raises a BadStatusLine exception. Instead of catching
524
+ # the exception and assuming all BadStatusLine exceptions are read
525
+ # timeouts, check for a zero timeout before making the request.
526
+ if read_timeout == 0:
527
+ raise ReadTimeoutError(
528
+ self, url, f"Read timed out. (read timeout={read_timeout})"
529
+ )
530
+ conn.timeout = read_timeout
531
+
532
+ # Receive the response from the server
533
+ try:
534
+ response = conn.getresponse()
535
+ except (BaseSSLError, OSError) as e:
536
+ self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
537
+ raise
538
+
539
+ # Set properties that are used by the pooling layer.
540
+ response.retries = retries
541
+ response._connection = response_conn # type: ignore[attr-defined]
542
+ response._pool = self # type: ignore[attr-defined]
543
+
544
+ log.debug(
545
+ '%s://%s:%s "%s %s %s" %s %s',
546
+ self.scheme,
547
+ self.host,
548
+ self.port,
549
+ method,
550
+ url,
551
+ response.version_string,
552
+ response.status,
553
+ response.length_remaining,
554
+ )
555
+
556
+ return response
557
+
558
+ def close(self) -> None:
559
+ """
560
+ Close all pooled connections and disable the pool.
561
+ """
562
+ if self.pool is None:
563
+ return
564
+ # Disable access to the pool
565
+ old_pool, self.pool = self.pool, None
566
+
567
+ # Close all the HTTPConnections in the pool.
568
+ _close_pool_connections(old_pool)
569
+
570
+ def is_same_host(self, url: str) -> bool:
571
+ """
572
+ Check if the given ``url`` is a member of the same host as this
573
+ connection pool.
574
+ """
575
+ if url.startswith("/"):
576
+ return True
577
+
578
+ # TODO: Add optional support for socket.gethostbyname checking.
579
+ scheme, _, host, port, *_ = parse_url(url)
580
+ scheme = scheme or "http"
581
+ if host is not None:
582
+ host = _normalize_host(host, scheme=scheme)
583
+
584
+ # Use explicit default port for comparison when none is given
585
+ if self.port and not port:
586
+ port = port_by_scheme.get(scheme)
587
+ elif not self.port and port == port_by_scheme.get(scheme):
588
+ port = None
589
+
590
+ return (scheme, host, port) == (self.scheme, self.host, self.port)
591
+
592
+ def urlopen( # type: ignore[override]
593
+ self,
594
+ method: str,
595
+ url: str,
596
+ body: _TYPE_BODY | None = None,
597
+ headers: typing.Mapping[str, str] | None = None,
598
+ retries: Retry | bool | int | None = None,
599
+ redirect: bool = True,
600
+ assert_same_host: bool = True,
601
+ timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,
602
+ pool_timeout: int | None = None,
603
+ release_conn: bool | None = None,
604
+ chunked: bool = False,
605
+ body_pos: _TYPE_BODY_POSITION | None = None,
606
+ preload_content: bool = True,
607
+ decode_content: bool = True,
608
+ **response_kw: typing.Any,
609
+ ) -> BaseHTTPResponse:
610
+ """
611
+ Get a connection from the pool and perform an HTTP request. This is the
612
+ lowest level call for making a request, so you'll need to specify all
613
+ the raw details.
614
+
615
+ .. note::
616
+
617
+ More commonly, it's appropriate to use a convenience method
618
+ such as :meth:`request`.
619
+
620
+ .. note::
621
+
622
+ `release_conn` will only behave as expected if
623
+ `preload_content=False` because we want to make
624
+ `preload_content=False` the default behaviour someday soon without
625
+ breaking backwards compatibility.
626
+
627
+ :param method:
628
+ HTTP request method (such as GET, POST, PUT, etc.)
629
+
630
+ :param url:
631
+ The URL to perform the request on.
632
+
633
+ :param body:
634
+ Data to send in the request body, either :class:`str`, :class:`bytes`,
635
+ an iterable of :class:`str`/:class:`bytes`, or a file-like object.
636
+
637
+ :param headers:
638
+ Dictionary of custom headers to send, such as User-Agent,
639
+ If-None-Match, etc. If None, pool headers are used. If provided,
640
+ these headers completely replace any pool-specific headers.
641
+
642
+ :param retries:
643
+ Configure the number of retries to allow before raising a
644
+ :class:`~urllib3.exceptions.MaxRetryError` exception.
645
+
646
+ If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a
647
+ :class:`~urllib3.util.retry.Retry` object for fine-grained control
648
+ over different types of retries.
649
+ Pass an integer number to retry connection errors that many times,
650
+ but no other types of errors. Pass zero to never retry.
651
+
652
+ If ``False``, then retries are disabled and any exception is raised
653
+ immediately. Also, instead of raising a MaxRetryError on redirects,
654
+ the redirect response will be returned.
655
+
656
+ :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.
657
+
658
+ :param redirect:
659
+ If True, automatically handle redirects (status codes 301, 302,
660
+ 303, 307, 308). Each redirect counts as a retry. Disabling retries
661
+ will disable redirect, too.
662
+
663
+ :param assert_same_host:
664
+ If ``True``, will make sure that the host of the pool requests is
665
+ consistent else will raise HostChangedError. When ``False``, you can
666
+ use the pool on an HTTP proxy and request foreign hosts.
667
+
668
+ :param timeout:
669
+ If specified, overrides the default timeout for this one
670
+ request. It may be a float (in seconds) or an instance of
671
+ :class:`urllib3.util.Timeout`.
672
+
673
+ :param pool_timeout:
674
+ If set and the pool is set to block=True, then this method will
675
+ block for ``pool_timeout`` seconds and raise EmptyPoolError if no
676
+ connection is available within the time period.
677
+
678
+ :param bool preload_content:
679
+ If True, the response's body will be preloaded into memory.
680
+
681
+ :param bool decode_content:
682
+ If True, will attempt to decode the body based on the
683
+ 'content-encoding' header.
684
+
685
+ :param release_conn:
686
+ If False, then the urlopen call will not release the connection
687
+ back into the pool once a response is received (but will release if
688
+ you read the entire contents of the response such as when
689
+ `preload_content=True`). This is useful if you're not preloading
690
+ the response's content immediately. You will need to call
691
+ ``r.release_conn()`` on the response ``r`` to return the connection
692
+ back into the pool. If None, it takes the value of ``preload_content``
693
+ which defaults to ``True``.
694
+
695
+ :param bool chunked:
696
+ If True, urllib3 will send the body using chunked transfer
697
+ encoding. Otherwise, urllib3 will send the body using the standard
698
+ content-length form. Defaults to False.
699
+
700
+ :param int body_pos:
701
+ Position to seek to in file-like body in the event of a retry or
702
+ redirect. Typically this won't need to be set because urllib3 will
703
+ auto-populate the value when needed.
704
+ """
705
+ # Ensure that the URL we're connecting to is properly encoded
706
+ if url.startswith("/"):
707
+ # URLs starting with / are inherently schemeless.
708
+ url = to_str(_encode_target(url))
709
+ destination_scheme = None
710
+ else:
711
+ parsed_url = parse_url(url)
712
+ destination_scheme = parsed_url.scheme
713
+ url = to_str(parsed_url.url)
714
+
715
+ if headers is None:
716
+ headers = self.headers
717
+
718
+ if not isinstance(retries, Retry):
719
+ retries = Retry.from_int(retries, redirect=redirect, default=self.retries)
720
+
721
+ if release_conn is None:
722
+ release_conn = preload_content
723
+
724
+ # Check host
725
+ if assert_same_host and not self.is_same_host(url):
726
+ raise HostChangedError(self, url, retries)
727
+
728
+ conn = None
729
+
730
+ # Track whether `conn` needs to be released before
731
+ # returning/raising/recursing. Update this variable if necessary, and
732
+ # leave `release_conn` constant throughout the function. That way, if
733
+ # the function recurses, the original value of `release_conn` will be
734
+ # passed down into the recursive call, and its value will be respected.
735
+ #
736
+ # See issue #651 [1] for details.
737
+ #
738
+ # [1] <https://github.com/urllib3/urllib3/issues/651>
739
+ release_this_conn = release_conn
740
+
741
+ http_tunnel_required = connection_requires_http_tunnel(
742
+ self.proxy, self.proxy_config, destination_scheme
743
+ )
744
+
745
+ # Merge the proxy headers. Only done when not using HTTP CONNECT. We
746
+ # have to copy the headers dict so we can safely change it without those
747
+ # changes being reflected in anyone else's copy.
748
+ if not http_tunnel_required:
749
+ headers = headers.copy() # type: ignore[attr-defined]
750
+ headers.update(self.proxy_headers) # type: ignore[union-attr]
751
+
752
+ # Must keep the exception bound to a separate variable or else Python 3
753
+ # complains about UnboundLocalError.
754
+ err = None
755
+
756
+ # Keep track of whether we cleanly exited the except block. This
757
+ # ensures we do proper cleanup in finally.
758
+ clean_exit = False
759
+
760
+ # Rewind body position, if needed. Record current position
761
+ # for future rewinds in the event of a redirect/retry.
762
+ body_pos = set_file_position(body, body_pos)
763
+
764
+ try:
765
+ # Request a connection from the queue.
766
+ timeout_obj = self._get_timeout(timeout)
767
+ conn = self._get_conn(timeout=pool_timeout)
768
+
769
+ conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]
770
+
771
+ # Is this a closed/new connection that requires CONNECT tunnelling?
772
+ if self.proxy is not None and http_tunnel_required and conn.is_closed:
773
+ try:
774
+ self._prepare_proxy(conn)
775
+ except (BaseSSLError, OSError, SocketTimeout) as e:
776
+ self._raise_timeout(
777
+ err=e, url=self.proxy.url, timeout_value=conn.timeout
778
+ )
779
+ raise
780
+
781
+ # If we're going to release the connection in ``finally:``, then
782
+ # the response doesn't need to know about the connection. Otherwise
783
+ # it will also try to release it and we'll have a double-release
784
+ # mess.
785
+ response_conn = conn if not release_conn else None
786
+
787
+ # Make the request on the HTTPConnection object
788
+ response = self._make_request(
789
+ conn,
790
+ method,
791
+ url,
792
+ timeout=timeout_obj,
793
+ body=body,
794
+ headers=headers,
795
+ chunked=chunked,
796
+ retries=retries,
797
+ response_conn=response_conn,
798
+ preload_content=preload_content,
799
+ decode_content=decode_content,
800
+ **response_kw,
801
+ )
802
+
803
+ # Everything went great!
804
+ clean_exit = True
805
+
806
+ except EmptyPoolError:
807
+ # Didn't get a connection from the pool, no need to clean up
808
+ clean_exit = True
809
+ release_this_conn = False
810
+ raise
811
+
812
+ except (
813
+ TimeoutError,
814
+ HTTPException,
815
+ OSError,
816
+ ProtocolError,
817
+ BaseSSLError,
818
+ SSLError,
819
+ CertificateError,
820
+ ProxyError,
821
+ ) as e:
822
+ # Discard the connection for these exceptions. It will be
823
+ # replaced during the next _get_conn() call.
824
+ clean_exit = False
825
+ new_e: Exception = e
826
+ if isinstance(e, (BaseSSLError, CertificateError)):
827
+ new_e = SSLError(e)
828
+ if isinstance(
829
+ new_e,
830
+ (
831
+ OSError,
832
+ NewConnectionError,
833
+ TimeoutError,
834
+ SSLError,
835
+ HTTPException,
836
+ ),
837
+ ) and (conn and conn.proxy and not conn.has_connected_to_proxy):
838
+ new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)
839
+ elif isinstance(new_e, (OSError, HTTPException)):
840
+ new_e = ProtocolError("Connection aborted.", new_e)
841
+
842
+ retries = retries.increment(
843
+ method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
844
+ )
845
+ retries.sleep()
846
+
847
+ # Keep track of the error for the retry warning.
848
+ err = e
849
+
850
+ finally:
851
+ if not clean_exit:
852
+ # We hit some kind of exception, handled or otherwise. We need
853
+ # to throw the connection away unless explicitly told not to.
854
+ # Close the connection, set the variable to None, and make sure
855
+ # we put the None back in the pool to avoid leaking it.
856
+ if conn:
857
+ conn.close()
858
+ conn = None
859
+ release_this_conn = True
860
+
861
+ if release_this_conn:
862
+ # Put the connection back to be reused. If the connection is
863
+ # expired then it will be None, which will get replaced with a
864
+ # fresh connection during _get_conn.
865
+ self._put_conn(conn)
866
+
867
+ if not conn:
868
+ # Try again
869
+ log.warning(
870
+ "Retrying (%r) after connection broken by '%r': %s", retries, err, url
871
+ )
872
+ return self.urlopen(
873
+ method,
874
+ url,
875
+ body,
876
+ headers,
877
+ retries,
878
+ redirect,
879
+ assert_same_host,
880
+ timeout=timeout,
881
+ pool_timeout=pool_timeout,
882
+ release_conn=release_conn,
883
+ chunked=chunked,
884
+ body_pos=body_pos,
885
+ preload_content=preload_content,
886
+ decode_content=decode_content,
887
+ **response_kw,
888
+ )
889
+
890
+ # Handle redirect?
891
+ redirect_location = redirect and response.get_redirect_location()
892
+ if redirect_location:
893
+ if response.status == 303:
894
+ # Change the method according to RFC 9110, Section 15.4.4.
895
+ method = "GET"
896
+ # And lose the body not to transfer anything sensitive.
897
+ body = None
898
+ headers = HTTPHeaderDict(headers)._prepare_for_method_change()
899
+
900
+ # Strip headers marked as unsafe to forward to the redirected location.
901
+ # Check remove_headers_on_redirect to avoid a potential network call within
902
+ # self.is_same_host() which may use socket.gethostbyname() in the future.
903
+ if retries.remove_headers_on_redirect and not self.is_same_host(
904
+ redirect_location
905
+ ):
906
+ new_headers = headers.copy() # type: ignore[union-attr]
907
+ for header in headers:
908
+ if header.lower() in retries.remove_headers_on_redirect:
909
+ new_headers.pop(header, None)
910
+ headers = new_headers
911
+
912
+ try:
913
+ retries = retries.increment(method, url, response=response, _pool=self)
914
+ except MaxRetryError:
915
+ if retries.raise_on_redirect:
916
+ response.drain_conn()
917
+ raise
918
+ return response
919
+
920
+ response.drain_conn()
921
+ retries.sleep_for_retry(response)
922
+ log.debug("Redirecting %s -> %s", url, redirect_location)
923
+ return self.urlopen(
924
+ method,
925
+ redirect_location,
926
+ body,
927
+ headers,
928
+ retries=retries,
929
+ redirect=redirect,
930
+ assert_same_host=assert_same_host,
931
+ timeout=timeout,
932
+ pool_timeout=pool_timeout,
933
+ release_conn=release_conn,
934
+ chunked=chunked,
935
+ body_pos=body_pos,
936
+ preload_content=preload_content,
937
+ decode_content=decode_content,
938
+ **response_kw,
939
+ )
940
+
941
+ # Check if we should retry the HTTP response.
942
+ has_retry_after = bool(response.headers.get("Retry-After"))
943
+ if retries.is_retry(method, response.status, has_retry_after):
944
+ try:
945
+ retries = retries.increment(method, url, response=response, _pool=self)
946
+ except MaxRetryError:
947
+ if retries.raise_on_status:
948
+ response.drain_conn()
949
+ raise
950
+ return response
951
+
952
+ response.drain_conn()
953
+ retries.sleep(response)
954
+ log.debug("Retry: %s", url)
955
+ return self.urlopen(
956
+ method,
957
+ url,
958
+ body,
959
+ headers,
960
+ retries=retries,
961
+ redirect=redirect,
962
+ assert_same_host=assert_same_host,
963
+ timeout=timeout,
964
+ pool_timeout=pool_timeout,
965
+ release_conn=release_conn,
966
+ chunked=chunked,
967
+ body_pos=body_pos,
968
+ preload_content=preload_content,
969
+ decode_content=decode_content,
970
+ **response_kw,
971
+ )
972
+
973
+ return response
974
+
975
+
976
+ class HTTPSConnectionPool(HTTPConnectionPool):
977
+ """
978
+ Same as :class:`.HTTPConnectionPool`, but HTTPS.
979
+
980
+ :class:`.HTTPSConnection` uses one of ``assert_fingerprint``,
981
+ ``assert_hostname`` and ``host`` in this order to verify connections.
982
+ If ``assert_hostname`` is False, no verification is done.
983
+
984
+ The ``key_file``, ``cert_file``, ``cert_reqs``, ``ca_certs``,
985
+ ``ca_cert_dir``, ``ssl_version``, ``key_password`` are only used if :mod:`ssl`
986
+ is available and are fed into :meth:`urllib3.util.ssl_wrap_socket` to upgrade
987
+ the connection socket into an SSL socket.
988
+ """
989
+
990
+ scheme = "https"
991
+ ConnectionCls: type[BaseHTTPSConnection] = HTTPSConnection
992
+
993
+ def __init__(
994
+ self,
995
+ host: str,
996
+ port: int | None = None,
997
+ timeout: _TYPE_TIMEOUT | None = _DEFAULT_TIMEOUT,
998
+ maxsize: int = 1,
999
+ block: bool = False,
1000
+ headers: typing.Mapping[str, str] | None = None,
1001
+ retries: Retry | bool | int | None = None,
1002
+ _proxy: Url | None = None,
1003
+ _proxy_headers: typing.Mapping[str, str] | None = None,
1004
+ key_file: str | None = None,
1005
+ cert_file: str | None = None,
1006
+ cert_reqs: int | str | None = None,
1007
+ key_password: str | None = None,
1008
+ ca_certs: str | None = None,
1009
+ ssl_version: int | str | None = None,
1010
+ ssl_minimum_version: ssl.TLSVersion | None = None,
1011
+ ssl_maximum_version: ssl.TLSVersion | None = None,
1012
+ assert_hostname: str | typing.Literal[False] | None = None,
1013
+ assert_fingerprint: str | None = None,
1014
+ ca_cert_dir: str | None = None,
1015
+ **conn_kw: typing.Any,
1016
+ ) -> None:
1017
+ super().__init__(
1018
+ host,
1019
+ port,
1020
+ timeout,
1021
+ maxsize,
1022
+ block,
1023
+ headers,
1024
+ retries,
1025
+ _proxy,
1026
+ _proxy_headers,
1027
+ **conn_kw,
1028
+ )
1029
+
1030
+ self.key_file = key_file
1031
+ self.cert_file = cert_file
1032
+ self.cert_reqs = cert_reqs
1033
+ self.key_password = key_password
1034
+ self.ca_certs = ca_certs
1035
+ self.ca_cert_dir = ca_cert_dir
1036
+ self.ssl_version = ssl_version
1037
+ self.ssl_minimum_version = ssl_minimum_version
1038
+ self.ssl_maximum_version = ssl_maximum_version
1039
+ self.assert_hostname = assert_hostname
1040
+ self.assert_fingerprint = assert_fingerprint
1041
+
1042
+ def _prepare_proxy(self, conn: HTTPSConnection) -> None: # type: ignore[override]
1043
+ """Establishes a tunnel connection through HTTP CONNECT."""
1044
+ if self.proxy and self.proxy.scheme == "https":
1045
+ tunnel_scheme = "https"
1046
+ else:
1047
+ tunnel_scheme = "http"
1048
+
1049
+ conn.set_tunnel(
1050
+ scheme=tunnel_scheme,
1051
+ host=self._tunnel_host,
1052
+ port=self.port,
1053
+ headers=self.proxy_headers,
1054
+ )
1055
+ conn.connect()
1056
+
1057
+ def _new_conn(self) -> BaseHTTPSConnection:
1058
+ """
1059
+ Return a fresh :class:`urllib3.connection.HTTPConnection`.
1060
+ """
1061
+ self.num_connections += 1
1062
+ log.debug(
1063
+ "Starting new HTTPS connection (%d): %s:%s",
1064
+ self.num_connections,
1065
+ self.host,
1066
+ self.port or "443",
1067
+ )
1068
+
1069
+ if not self.ConnectionCls or self.ConnectionCls is DummyConnection: # type: ignore[comparison-overlap]
1070
+ raise ImportError(
1071
+ "Can't connect to HTTPS URL because the SSL module is not available."
1072
+ )
1073
+
1074
+ actual_host: str = self.host
1075
+ actual_port = self.port
1076
+ if self.proxy is not None and self.proxy.host is not None:
1077
+ actual_host = self.proxy.host
1078
+ actual_port = self.proxy.port
1079
+
1080
+ return self.ConnectionCls(
1081
+ host=actual_host,
1082
+ port=actual_port,
1083
+ timeout=self.timeout.connect_timeout,
1084
+ cert_file=self.cert_file,
1085
+ key_file=self.key_file,
1086
+ key_password=self.key_password,
1087
+ cert_reqs=self.cert_reqs,
1088
+ ca_certs=self.ca_certs,
1089
+ ca_cert_dir=self.ca_cert_dir,
1090
+ assert_hostname=self.assert_hostname,
1091
+ assert_fingerprint=self.assert_fingerprint,
1092
+ ssl_version=self.ssl_version,
1093
+ ssl_minimum_version=self.ssl_minimum_version,
1094
+ ssl_maximum_version=self.ssl_maximum_version,
1095
+ **self.conn_kw,
1096
+ )
1097
+
1098
+ def _validate_conn(self, conn: BaseHTTPConnection) -> None:
1099
+ """
1100
+ Called right before a request is made, after the socket is created.
1101
+ """
1102
+ super()._validate_conn(conn)
1103
+
1104
+ # Force connect early to allow us to validate the connection.
1105
+ if conn.is_closed:
1106
+ conn.connect()
1107
+
1108
+ # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791
1109
+ if not conn.is_verified and not conn.proxy_is_verified:
1110
+ warnings.warn(
1111
+ (
1112
+ f"Unverified HTTPS request is being made to host '{conn.host}'. "
1113
+ "Adding certificate verification is strongly advised. See: "
1114
+ "https://urllib3.readthedocs.io/en/latest/advanced-usage.html"
1115
+ "#tls-warnings"
1116
+ ),
1117
+ InsecureRequestWarning,
1118
+ )
1119
+
1120
+
1121
+ def connection_from_url(url: str, **kw: typing.Any) -> HTTPConnectionPool:
1122
+ """
1123
+ Given a url, return an :class:`.ConnectionPool` instance of its host.
1124
+
1125
+ This is a shortcut for not having to parse out the scheme, host, and port
1126
+ of the url before creating an :class:`.ConnectionPool` instance.
1127
+
1128
+ :param url:
1129
+ Absolute URL string that must include the scheme. Port is optional.
1130
+
1131
+ :param \\**kw:
1132
+ Passes additional parameters to the constructor of the appropriate
1133
+ :class:`.ConnectionPool`. Useful for specifying things like
1134
+ timeout, maxsize, headers, etc.
1135
+
1136
+ Example::
1137
+
1138
+ >>> conn = connection_from_url('http://google.com/')
1139
+ >>> r = conn.request('GET', '/')
1140
+ """
1141
+ scheme, _, host, port, *_ = parse_url(url)
1142
+ scheme = scheme or "http"
1143
+ port = port or port_by_scheme.get(scheme, 80)
1144
+ if scheme == "https":
1145
+ return HTTPSConnectionPool(host, port=port, **kw) # type: ignore[arg-type]
1146
+ else:
1147
+ return HTTPConnectionPool(host, port=port, **kw) # type: ignore[arg-type]
1148
+
1149
+
1150
+ @typing.overload
1151
+ def _normalize_host(host: None, scheme: str | None) -> None: ...
1152
+
1153
+
1154
+ @typing.overload
1155
+ def _normalize_host(host: str, scheme: str | None) -> str: ...
1156
+
1157
+
1158
+ def _normalize_host(host: str | None, scheme: str | None) -> str | None:
1159
+ """
1160
+ Normalize hosts for comparisons and use with sockets.
1161
+ """
1162
+
1163
+ host = normalize_host(host, scheme)
1164
+
1165
+ # httplib doesn't like it when we include brackets in IPv6 addresses
1166
+ # Specifically, if we include brackets but also pass the port then
1167
+ # httplib crazily doubles up the square brackets on the Host header.
1168
+ # Instead, we need to make sure we never pass ``None`` as the port.
1169
+ # However, for backward compatibility reasons we can't actually
1170
+ # *assert* that. See http://bugs.python.org/issue28539
1171
+ if host and host.startswith("[") and host.endswith("]"):
1172
+ host = host[1:-1]
1173
+ return host
1174
+
1175
+
1176
+ def _url_from_pool(
1177
+ pool: HTTPConnectionPool | HTTPSConnectionPool, path: str | None = None
1178
+ ) -> str:
1179
+ """Returns the URL from a given connection pool. This is mainly used for testing and logging."""
1180
+ return Url(scheme=pool.scheme, host=pool.host, port=pool.port, path=path).url
1181
+
1182
+
1183
+ def _close_pool_connections(pool: queue.LifoQueue[typing.Any]) -> None:
1184
+ """Drains a queue of connections and closes each one."""
1185
+ try:
1186
+ while True:
1187
+ conn = pool.get(block=False)
1188
+ if conn:
1189
+ conn.close()
1190
+ except queue.Empty:
1191
+ pass # Done.