Skip to content

Commit 22a261e

Browse files
authored
Merge pull request #173 from advanced-security/update-deps-06
Update and Vendor Deps
2 parents 4914793 + 38ce6b8 commit 22a261e

File tree

6 files changed

+37
-33
lines changed

6 files changed

+37
-33
lines changed

Pipfile.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/ghastoolkit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
__name__ = "ghastoolkit"
44
__title__ = "GHAS Toolkit"
55

6-
__version__ = "0.17.6"
6+
__version__ = "0.17.7"
77

88
__description__ = "GitHub Advanced Security Python Toolkit"
99
__summary__ = """\

vendor/requests/__version__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
__title__ = "requests"
66
__description__ = "Python HTTP for Humans."
77
__url__ = "https://requests.readthedocs.io"
8-
__version__ = "2.32.3"
9-
__build__ = 0x023203
8+
__version__ = "2.32.4"
9+
__build__ = 0x023204
1010
__author__ = "Kenneth Reitz"
1111
__author_email__ = "[email protected]"
1212
__license__ = "Apache-2.0"

vendor/requests/compat.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010
import importlib
1111
import sys
1212

13+
# -------
14+
# urllib3
15+
# -------
16+
from urllib3 import __version__ as urllib3_version
17+
18+
# Detect which major version of urllib3 is being used.
19+
try:
20+
is_urllib3_1 = int(urllib3_version.split(".")[0]) == 1
21+
except (TypeError, AttributeError):
22+
# If we can't discern a version, prefer old functionality.
23+
is_urllib3_1 = True
24+
1325
# -------------------
1426
# Character Detection
1527
# -------------------

vendor/requests/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,9 @@ def text(self):
945945
return content
946946

947947
def json(self, **kwargs):
948-
r"""Returns the json-encoded content of a response, if any.
948+
r"""Decodes the JSON response body (if any) as a Python object.
949+
950+
This may return a dictionary, list, etc. depending on what is in the response.
949951
950952
:param \*\*kwargs: Optional arguments that ``json.loads`` takes.
951953
:raises requests.exceptions.JSONDecodeError: If the response body does not

vendor/requests/utils.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
getproxies,
3939
getproxies_environment,
4040
integer_types,
41+
is_urllib3_1,
4142
)
4243
from .compat import parse_http_list as _parse_list_header
4344
from .compat import (
@@ -136,7 +137,9 @@ def super_len(o):
136137
total_length = None
137138
current_position = 0
138139

139-
if isinstance(o, str):
140+
if not is_urllib3_1 and isinstance(o, str):
141+
# urllib3 2.x+ treats all strings as utf-8 instead
142+
# of latin-1 (iso-8859-1) like http.client.
140143
o = o.encode("utf-8")
141144

142145
if hasattr(o, "__len__"):
@@ -216,14 +219,7 @@ def get_netrc_auth(url, raise_errors=False):
216219
netrc_path = None
217220

218221
for f in netrc_locations:
219-
try:
220-
loc = os.path.expanduser(f)
221-
except KeyError:
222-
# os.path.expanduser can fail when $HOME is undefined and
223-
# getpwuid fails. See https://bugs.python.org/issue20164 &
224-
# https://github.com/psf/requests/issues/1846
225-
return
226-
222+
loc = os.path.expanduser(f)
227223
if os.path.exists(loc):
228224
netrc_path = loc
229225
break
@@ -233,13 +229,7 @@ def get_netrc_auth(url, raise_errors=False):
233229
return
234230

235231
ri = urlparse(url)
236-
237-
# Strip port numbers from netloc. This weird `if...encode`` dance is
238-
# used for Python 3.2, which doesn't support unicode literals.
239-
splitstr = b":"
240-
if isinstance(url, str):
241-
splitstr = splitstr.decode("ascii")
242-
host = ri.netloc.split(splitstr)[0]
232+
host = ri.hostname
243233

244234
try:
245235
_netrc = netrc(netrc_path).authenticators(host)

0 commit comments

Comments
 (0)