Bump certifi from 2021.10.8 to 2022.5.18.1 (#1748)

* Bump certifi from 2021.10.8 to 2022.5.18.1

Bumps [certifi](https://github.com/certifi/python-certifi) from 2021.10.8 to 2022.5.18.1.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2021.10.08...2022.05.18.1)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update certifi==2022.5.18.1

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>

[skip ci]
This commit is contained in:
dependabot[bot] 2022-05-20 10:57:24 -07:00 committed by GitHub
parent 9967786997
commit 010377870d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 415 additions and 238 deletions

View file

@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
"""
certifi.py
~~~~~~~~~~
@ -7,6 +5,8 @@ certifi.py
This module returns the installation location of cacert.pem or its contents.
"""
import os
import types
from typing import Union
try:
from importlib.resources import path as get_path, read_text
@ -14,7 +14,7 @@ try:
_CACERT_CTX = None
_CACERT_PATH = None
def where():
def where() -> str:
# This is slightly terrible, but we want to delay extracting the file
# in cases where we're inside of a zipimport situation until someone
# actually calls where(), but we don't want to re-extract the file
@ -40,21 +40,29 @@ try:
except ImportError:
Package = Union[types.ModuleType, str]
Resource = Union[str, "os.PathLike"]
# This fallback will work for Python versions prior to 3.7 that lack the
# importlib.resources module but relies on the existing `where` function
# so won't address issues with environments like PyOxidizer that don't set
# __file__ on modules.
def read_text(_module, _path, encoding="ascii"):
with open(where(), "r", encoding=encoding) as data:
def read_text(
package: Package,
resource: Resource,
encoding: str = 'utf-8',
errors: str = 'strict'
) -> str:
with open(where(), encoding=encoding) as data:
return data.read()
# If we don't have importlib.resources, then we will just do the old logic
# of assuming we're on the filesystem and munge the path directly.
def where():
def where() -> str:
f = os.path.dirname(__file__)
return os.path.join(f, "cacert.pem")
def contents():
def contents() -> str:
return read_text("certifi", "cacert.pem", encoding="ascii")