Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._vendor.requests.help Namespace Reference

Functions

 _implementation ()
 
 info ()
 
 main ()
 

Variables

 charset_normalizer = None
 
 chardet = None
 
 pyopenssl = None
 
 OpenSSL = None
 
 cryptography = None
 

Detailed Description

Module containing bug report helper(s).

Function Documentation

◆ _implementation()

_implementation ( )
protected
Return a dict with the Python implementation and version.

Provide both the name and the version of the Python implementation
currently running. For example, on CPython 3.10.3 it will return
{'name': 'CPython', 'version': '3.10.3'}.

This function works best on CPython and PyPy: in particular, it probably
doesn't work for Jython or IronPython. Future investigation should be done
to work out the correct shape of the code for those platforms.

Definition at line 31 of file help.py.

31def _implementation():
32 """Return a dict with the Python implementation and version.
33
34 Provide both the name and the version of the Python implementation
35 currently running. For example, on CPython 3.10.3 it will return
36 {'name': 'CPython', 'version': '3.10.3'}.
37
38 This function works best on CPython and PyPy: in particular, it probably
39 doesn't work for Jython or IronPython. Future investigation should be done
40 to work out the correct shape of the code for those platforms.
41 """
42 implementation = platform.python_implementation()
43
44 if implementation == "CPython":
45 implementation_version = platform.python_version()
46 elif implementation == "PyPy":
47 implementation_version = "{}.{}.{}".format(
51 )
53 implementation_version = "".join(
54 [implementation_version, sys.pypy_version_info.releaselevel]
55 )
56 elif implementation == "Jython":
57 implementation_version = platform.python_version() # Complete Guess
58 elif implementation == "IronPython":
59 implementation_version = platform.python_version() # Complete Guess
60 else:
61 implementation_version = "Unknown"
62
63 return {"name": implementation, "version": implementation_version}
64
65
for i

References i.

Referenced by pip._vendor.requests.help.info().

Here is the caller graph for this function:

◆ info()

info ( )
Generate information for a bug report.

Definition at line 66 of file help.py.

66def info():
67 """Generate information for a bug report."""
68 try:
69 platform_info = {
70 "system": platform.system(),
71 "release": platform.release(),
72 }
73 except OSError:
74 platform_info = {
75 "system": "Unknown",
76 "release": "Unknown",
77 }
78
79 implementation_info = _implementation()
80 urllib3_info = {"version": urllib3.__version__}
81 charset_normalizer_info = {"version": None}
82 chardet_info = {"version": None}
83 if charset_normalizer:
84 charset_normalizer_info = {"version": charset_normalizer.__version__}
85 if chardet:
86 chardet_info = {"version": chardet.__version__}
87
88 pyopenssl_info = {
89 "version": None,
90 "openssl_version": "",
91 }
92 if OpenSSL:
93 pyopenssl_info = {
94 "version": OpenSSL.__version__,
95 "openssl_version": f"{OpenSSL.SSL.OPENSSL_VERSION_NUMBER:x}",
96 }
97 cryptography_info = {
98 "version": getattr(cryptography, "__version__", ""),
99 }
100 idna_info = {
101 "version": getattr(idna, "__version__", ""),
102 }
103
104 system_ssl = ssl.OPENSSL_VERSION_NUMBER
105 system_ssl_info = {"version": f"{system_ssl:x}" if system_ssl is not None else ""}
106
107 return {
108 "platform": platform_info,
109 "implementation": implementation_info,
110 "system_ssl": system_ssl_info,
111 "using_pyopenssl": pyopenssl is not None,
112 "using_charset_normalizer": chardet is None,
113 "pyOpenSSL": pyopenssl_info,
114 "urllib3": urllib3_info,
115 "chardet": chardet_info,
116 "charset_normalizer": charset_normalizer_info,
117 "cryptography": cryptography_info,
118 "idna": idna_info,
119 "requests": {
120 "version": requests_version,
121 },
122 }
123
124

References pip._vendor.requests.help._implementation(), and i.

Referenced by pip._vendor.requests.help.main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

main ( )
Pretty-print the bug information as JSON.

Definition at line 125 of file help.py.

125def main():
126 """Pretty-print the bug information as JSON."""
127 print(json.dumps(info(), sort_keys=True, indent=2))
128
129

References i, pip._vendor.requests.help.info(), and pip._vendor.requests.help.main().

Referenced by pip._vendor.requests.help.main().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ chardet

chardet = None

Definition at line 18 of file help.py.

◆ charset_normalizer

charset_normalizer = None

Definition at line 13 of file help.py.

◆ cryptography

cryptography = None

Definition at line 25 of file help.py.

◆ OpenSSL

OpenSSL = None

Definition at line 24 of file help.py.

◆ pyopenssl

pyopenssl = None

Definition at line 23 of file help.py.