Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 9d2af2a

Browse files
committed
chatbot
1 parent 7635478 commit 9d2af2a

File tree

7,182 files changed

+1277220
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,182 files changed

+1277220
-105
lines changed
26.9 KB
Binary file not shown.
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import sys
2+
import os
3+
import re
4+
import importlib
5+
import warnings
6+
7+
8+
is_pypy = '__pypy__' in sys.builtin_module_names
9+
10+
11+
warnings.filterwarnings('ignore',
12+
r'.+ distutils\b.+ deprecated',
13+
DeprecationWarning)
14+
15+
16+
def warn_distutils_present():
17+
if 'distutils' not in sys.modules:
18+
return
19+
if is_pypy and sys.version_info < (3, 7):
20+
# PyPy for 3.6 unconditionally imports distutils, so bypass the warning
21+
# https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250
22+
return
23+
warnings.warn(
24+
"Distutils was imported before Setuptools, but importing Setuptools "
25+
"also replaces the `distutils` module in `sys.modules`. This may lead "
26+
"to undesirable behaviors or errors. To avoid these issues, avoid "
27+
"using distutils directly, ensure that setuptools is installed in the "
28+
"traditional way (e.g. not an editable install), and/or make sure "
29+
"that setuptools is always imported before distutils.")
30+
31+
32+
def clear_distutils():
33+
if 'distutils' not in sys.modules:
34+
return
35+
warnings.warn("Setuptools is replacing distutils.")
36+
mods = [name for name in sys.modules if re.match(r'distutils\b', name)]
37+
for name in mods:
38+
del sys.modules[name]
39+
40+
41+
def enabled():
42+
"""
43+
Allow selection of distutils by environment variable.
44+
"""
45+
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
46+
return which == 'local'
47+
48+
49+
def ensure_local_distutils():
50+
clear_distutils()
51+
distutils = importlib.import_module('setuptools._distutils')
52+
distutils.__name__ = 'distutils'
53+
sys.modules['distutils'] = distutils
54+
55+
# sanity check that submodules load as expected
56+
core = importlib.import_module('distutils.core')
57+
assert '_distutils' in core.__file__, core.__file__
58+
59+
60+
def do_override():
61+
"""
62+
Ensure that the local copy of distutils is preferred over stdlib.
63+
64+
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
65+
for more motivation.
66+
"""
67+
if enabled():
68+
warn_distutils_present()
69+
ensure_local_distutils()
70+
71+
72+
class DistutilsMetaFinder:
73+
def find_spec(self, fullname, path, target=None):
74+
if path is not None:
75+
return
76+
77+
method_name = 'spec_for_{fullname}'.format(**locals())
78+
method = getattr(self, method_name, lambda: None)
79+
return method()
80+
81+
def spec_for_distutils(self):
82+
import importlib.abc
83+
import importlib.util
84+
85+
class DistutilsLoader(importlib.abc.Loader):
86+
87+
def create_module(self, spec):
88+
return importlib.import_module('setuptools._distutils')
89+
90+
def exec_module(self, module):
91+
pass
92+
93+
return importlib.util.spec_from_loader('distutils', DistutilsLoader())
94+
95+
def spec_for_pip(self):
96+
"""
97+
Ensure stdlib distutils when running under pip.
98+
See pypa/pip#8761 for rationale.
99+
"""
100+
if self.pip_imported_during_build():
101+
return
102+
clear_distutils()
103+
self.spec_for_distutils = lambda: None
104+
105+
@staticmethod
106+
def pip_imported_during_build():
107+
"""
108+
Detect if pip is being imported in a build script. Ref #2355.
109+
"""
110+
import traceback
111+
return any(
112+
frame.f_globals['__file__'].endswith('setup.py')
113+
for frame, line in traceback.walk_stack(None)
114+
)
115+
116+
117+
DISTUTILS_FINDER = DistutilsMetaFinder()
118+
119+
120+
def add_shim():
121+
sys.meta_path.insert(0, DISTUTILS_FINDER)
122+
123+
124+
def remove_shim():
125+
try:
126+
sys.meta_path.remove(DISTUTILS_FINDER)
127+
except ValueError:
128+
pass
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('_distutils_hack').do_override()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
This package contains a modified version of ca-bundle.crt:
2+
3+
ca-bundle.crt -- Bundle of CA Root Certificates
4+
5+
Certificate data from Mozilla as of: Thu Nov 3 19:04:19 2011#
6+
This is a bundle of X.509 certificates of public Certificate Authorities
7+
(CA). These were automatically extracted from Mozilla's root certificates
8+
file (certdata.txt). This file can be found in the mozilla source tree:
9+
http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1#
10+
It contains the certificates in PEM format and therefore
11+
can be directly used with curl / libcurl / php_curl, or with
12+
an Apache+mod_ssl webserver for SSL client authentication.
13+
Just configure this file as the SSLCACertificateFile.#
14+
15+
***** BEGIN LICENSE BLOCK *****
16+
This Source Code Form is subject to the terms of the Mozilla Public License,
17+
v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain
18+
one at http://mozilla.org/MPL/2.0/.
19+
20+
***** END LICENSE BLOCK *****
21+
@(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Metadata-Version: 2.1
2+
Name: certifi
3+
Version: 2022.6.15
4+
Summary: Python package for providing Mozilla's CA Bundle.
5+
Home-page: https://github.com/certifi/python-certifi
6+
Author: Kenneth Reitz
7+
Author-email: [email protected]
8+
License: MPL-2.0
9+
Project-URL: Source, https://github.com/certifi/python-certifi
10+
Platform: UNKNOWN
11+
Classifier: Development Status :: 5 - Production/Stable
12+
Classifier: Intended Audience :: Developers
13+
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
14+
Classifier: Natural Language :: English
15+
Classifier: Programming Language :: Python
16+
Classifier: Programming Language :: Python :: 3
17+
Classifier: Programming Language :: Python :: 3.6
18+
Classifier: Programming Language :: Python :: 3.7
19+
Classifier: Programming Language :: Python :: 3.8
20+
Classifier: Programming Language :: Python :: 3.9
21+
Classifier: Programming Language :: Python :: 3.10
22+
Requires-Python: >=3.6
23+
License-File: LICENSE
24+
25+
Certifi: Python SSL Certificates
26+
================================
27+
28+
Certifi provides Mozilla's carefully curated collection of Root Certificates for
29+
validating the trustworthiness of SSL certificates while verifying the identity
30+
of TLS hosts. It has been extracted from the `Requests`_ project.
31+
32+
Installation
33+
------------
34+
35+
``certifi`` is available on PyPI. Simply install it with ``pip``::
36+
37+
$ pip install certifi
38+
39+
Usage
40+
-----
41+
42+
To reference the installed certificate authority (CA) bundle, you can use the
43+
built-in function::
44+
45+
>>> import certifi
46+
47+
>>> certifi.where()
48+
'/usr/local/lib/python3.7/site-packages/certifi/cacert.pem'
49+
50+
Or from the command line::
51+
52+
$ python -m certifi
53+
/usr/local/lib/python3.7/site-packages/certifi/cacert.pem
54+
55+
Enjoy!
56+
57+
1024-bit Root Certificates
58+
~~~~~~~~~~~~~~~~~~~~~~~~~~
59+
60+
Browsers and certificate authorities have concluded that 1024-bit keys are
61+
unacceptably weak for certificates, particularly root certificates. For this
62+
reason, Mozilla has removed any weak (i.e. 1024-bit key) certificate from its
63+
bundle, replacing it with an equivalent strong (i.e. 2048-bit or greater key)
64+
certificate from the same CA. Because Mozilla removed these certificates from
65+
its bundle, ``certifi`` removed them as well.
66+
67+
In previous versions, ``certifi`` provided the ``certifi.old_where()`` function
68+
to intentionally re-add the 1024-bit roots back into your bundle. This was not
69+
recommended in production and therefore was removed at the end of 2018.
70+
71+
.. _`Requests`: https://requests.readthedocs.io/en/master/
72+
73+
Addition/Removal of Certificates
74+
--------------------------------
75+
76+
Certifi does not support any addition/removal or other modification of the
77+
CA trust store content. This project is intended to provide a reliable and
78+
highly portable root of trust to python deployments. Look to upstream projects
79+
for methods to use alternate trust.
80+
81+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
certifi-2022.6.15.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2+
certifi-2022.6.15.dist-info/LICENSE,sha256=vp2C82ES-Hp_HXTs1Ih-FGe7roh4qEAEoAEXseR1o-I,1049
3+
certifi-2022.6.15.dist-info/METADATA,sha256=1sLjV7SjXkcGhJr631JUqCLCDnqgTyFoFe-tRLxakTE,2804
4+
certifi-2022.6.15.dist-info/RECORD,,
5+
certifi-2022.6.15.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
6+
certifi-2022.6.15.dist-info/top_level.txt,sha256=KMu4vUCfsjLrkPbSNdgdekS-pVJzBAJFO__nI8NF6-U,8
7+
certifi/__init__.py,sha256=SuZ3iYmzdRyUv-PiaZkquUgXtWZ16ICUKgymlEBspx0,94
8+
certifi/__main__.py,sha256=xBBoj905TUWBLRGANOcf7oi6e-3dMP4cEoG9OyMs11g,243
9+
certifi/__pycache__/__init__.cpython-310.pyc,,
10+
certifi/__pycache__/__main__.cpython-310.pyc,,
11+
certifi/__pycache__/core.cpython-310.pyc,,
12+
certifi/cacert.pem,sha256=pZ_eiDoO-ddKudrQCWieABc9KFlbV0FsmLLugygMbkw,285222
13+
certifi/core.py,sha256=G5LqCBr4o8bozzzlYBE8nsd_ziB6XcxJiuMV4llFeYY,2515
14+
certifi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Wheel-Version: 1.0
2+
Generator: bdist_wheel (0.37.0)
3+
Root-Is-Purelib: true
4+
Tag: py3-none-any
5+

0 commit comments

Comments
 (0)