Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grammar fixes #6718

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ Please be aware of the following things when filing bug reports:
ship patches on top of the code we supply.

If you do not provide all of these things, it will take us much longer to
fix your problem. If we ask you to clarify these and you never respond, we
fix your problem. If we ask you to clarify these, and you never respond, we
will close your issue without fixing it.
8 changes: 4 additions & 4 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ profiles above if desired.

If English is not your first language, please try to describe the
problem and its impact to the best of your ability. For greater detail,
please use your native language and we will try our best to translate it
please use your native language, and we will try our best to translate it
using online services.

Please also include the code you used to find the problem and the
Expand Down Expand Up @@ -65,11 +65,11 @@ number if one is required, providing you with full credit for the
discovery. We will also decide on a planned release date, and let you
know when it is. This release date will *always* be on a weekday.

At this point we will reach out to our major downstream packagers to
notify them of an impending security-related patch so they can make
At this point, we will reach out to our major downstream packagers to
notify them of an impending security-related patch, so they can make
arrangements. In addition, these packagers will be provided with the
intended patch ahead of time, to ensure that they are able to promptly
release their downstream packages. Currently the list of people we
release their downstream packages. Currently, the list of people we
actively contact *ahead of a public release* is:

- Jeremy Cline, Red Hat (@jeremycline)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
# a pull request, then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
# The scheme of the identifier. Typical schemes are ISBN or URL.
# epub_scheme = ''

# The unique identifier of the text. This can be a ISBN number
# The unique identifier of the text. This can be an ISBN
# or the project homepage.
# epub_identifier = ''

Expand Down
4 changes: 2 additions & 2 deletions src/requests/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def get_connection_with_tls_context(self, request, verify, proxies=None, cert=No
**host_params, pool_kwargs=pool_kwargs
)
else:
# Only scheme should be lower case
# Only scheme should be lowercase
conn = self.poolmanager.connection_from_host(
**host_params, pool_kwargs=pool_kwargs
)
Expand Down Expand Up @@ -448,7 +448,7 @@ def get_connection(self, url, proxies=None):
proxy_manager = self.proxy_manager_for(proxy)
conn = proxy_manager.connection_from_url(url)
else:
# Only scheme should be lower case
# Only scheme should be lowercase
parsed = urlparse(url)
url = parsed.geturl()
conn = self.poolmanager.connection_from_url(url)
Expand Down
2 changes: 1 addition & 1 deletion src/requests/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _basic_auth_str(username, password):
"""Returns a Basic Auth string."""

# "I want us to put a big-ol' comment on top of it that
# says that this behaviour is dumb but we need to preserve
# says that this behaviour is dumb, but we need to preserve
# it because people are relying on it."
# - Lukasa
#
Expand Down
8 changes: 4 additions & 4 deletions src/requests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def prepare_url(self, url, params):
url = url.lstrip()

# Don't do any URL preparation for non-HTTP schemes like `mailto`,
# `data` etc to work around exceptions from `url_parse`, which
# `data` etc. to work around exceptions from `url_parse`, which
# handles RFC 3986 only.
if ":" in url and not url.lower().startswith("http"):
self.url = url
Expand Down Expand Up @@ -494,8 +494,8 @@ def prepare_headers(self, headers):
def prepare_body(self, data, files, json=None):
"""Prepares the given HTTP body data."""

# Check if file, fo, generator, iterator.
# If not, run through normal process.
# Check if it's a file, fo, generator, iterator.
# If not, run through the normal process.

# Nottin' on you.
body = None
Expand Down Expand Up @@ -956,7 +956,7 @@ def json(self, **kwargs):
# No encoding set. JSON RFC 4627 section 3 states we should expect
# UTF-8, -16 or -32. Detect which one to use; If the detection or
# decoding fails, fall back to `self.text` (using charset_normalizer to make
# a best guess).
# the best guess).
encoding = guess_json_utf(self.content)
if encoding is not None:
try:
Expand Down
2 changes: 1 addition & 1 deletion src/requests/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def __init__(self):
self.trust_env = True

#: A CookieJar containing all currently outstanding cookies set on this
#: session. By default it is a
#: session. By default, it is a
#: :class:`RequestsCookieJar <requests.cookies.RequestsCookieJar>`, but
#: may be any other ``cookielib.CookieJar`` compatible object.
self.cookies = cookiejar_from_dict({})
Expand Down
2 changes: 1 addition & 1 deletion src/requests/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CaseInsensitiveDict(MutableMapping):
case of the last key to be set, and ``iter(instance)``,
``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()``
will contain case-sensitive keys. However, querying and contains
testing is case insensitive::
testing is case-insensitive::

cid = CaseInsensitiveDict()
cid['Accept'] = 'application/json'
Expand Down
22 changes: 11 additions & 11 deletions src/requests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,16 +449,16 @@ def unquote_header_value(value, is_filename=False):
"""
if value and value[0] == value[-1] == '"':
# this is not the real unquoting, but fixing this so that the
# RFC is met will result in bugs with internet explorer and
# probably some other browsers as well. IE for example is
# RFC is met will result in bugs with Internet Explorer and
# probably some other browsers as well. IE, for example, is
# uploading files with "C:\foo\bar.txt" as filename
value = value[1:-1]

# if this is a filename and the starting characters look like
# a UNC path, then just return the value without quotes. Using the
# If this is a filename and the starting characters look like
# a UNC path, then just return the value without quotes. Using the
# replace sequence below on a UNC path has the effect of turning
# the leading double slash into a single slash and then
# _fix_ie_filename() doesn't work correctly. See #458.
# _fix_ie_filename() doesn't work correctly. See #458.
if not is_filename or value[:2] != "\\\\":
return value.replace("\\\\", "\\").replace('\\"', '"')
return value
Expand Down Expand Up @@ -675,7 +675,7 @@ def requote_uri(uri):
except InvalidURL:
# We couldn't unquote the given URI, so let's try quoting it, but
# there may be unquoted '%'s in the URI. We need to make sure they're
# properly quoted so they do not cause issues elsewhere.
# properly quoted, so they do not cause issues elsewhere.
return quote(uri, safe=safe_without_percent)


Expand Down Expand Up @@ -1004,7 +1004,7 @@ def prepend_scheme_if_needed(url, new_scheme):
netloc, path = path, netloc

if auth:
# parse_url doesn't provide the netloc with auth
# parse_url doesn't provide the netloc with auth,
# so we'll add it ourselves.
netloc = "@".join([auth, netloc])
if scheme is None:
Expand All @@ -1016,8 +1016,8 @@ def prepend_scheme_if_needed(url, new_scheme):


def get_auth_from_url(url):
"""Given a url with authentication components, extract them into a tuple of
username,password.
"""Given a URL with authentication components, extract them into a tuple of
(username, password).

:rtype: (str,str)
"""
Expand Down Expand Up @@ -1063,7 +1063,7 @@ def _validate_header_part(header, header_part, header_validator_index):

def urldefragauth(url):
"""
Given a url remove the fragment and the authentication part.
Given a URL remove the fragment and the authentication part.

:rtype: str
"""
Expand All @@ -1079,7 +1079,7 @@ def urldefragauth(url):


def rewind_body(prepared_request):
"""Move file pointer back to its recorded starting position
"""Move file pointer back to its recorded starting position,
so it can be read again on redirect.
"""
body_seek = getattr(prepared_request.body, "seek", None)
Expand Down
2 changes: 1 addition & 1 deletion tests/certs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ behaviour.
The certificates include:

* [expired](./expired) server certificate with a valid certificate authority
* [mtls](./mtls) provides a valid client certificate with a 2 year validity
* [mtls](./mtls) provides a valid client certificate with 2-year validity
* [valid](./valid) has a valid server certificate
12 changes: 6 additions & 6 deletions tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def test_errors(self, url, exception):
requests.get(url, timeout=1)

def test_proxy_error(self):
# any proxy related error (address resolution, no route to host, etc) should result in a ProxyError
# any proxy related error (address resolution, no route to host, etc.) should result in a ProxyError
with pytest.raises(ProxyError):
requests.get(
"http://localhost:1", proxies={"http": "non-resolvable-address"}
Expand Down Expand Up @@ -1470,7 +1470,7 @@ def test_response_chunk_size_type(self):
def test_iter_content_wraps_exceptions(self, httpbin, exception, args, expected):
r = requests.Response()
r.raw = mock.Mock()
# ReadTimeoutError can't be initialized by mock
# ReadTimeoutError can't be initialized by mock,
# so we'll manually create the instance with args
r.raw.stream.side_effect = exception(*args)

Expand Down Expand Up @@ -2216,7 +2216,7 @@ def get_redirect_target(self, resp):
# default behavior
if resp.is_redirect:
return resp.headers["location"]
# edge case - check to see if 'location' is in headers anyways
# edge case - check to see if 'location' is in headers anyway
location = resp.headers.get("location")
if location and (location != resp.url):
return location
Expand Down Expand Up @@ -2431,7 +2431,7 @@ def test_max_age_valid_int(self):
assert isinstance(cookie.expires, int)

def test_max_age_invalid_str(self):
"""Test case where a invalid max age is passed."""
"""Test case where an invalid max age is passed."""

morsel = Morsel()
morsel["max-age"] = "woops"
Expand Down Expand Up @@ -2465,7 +2465,7 @@ def test_none_timeout(self, httpbin, timeout):
To actually test this behavior, we'd want to check that setting the
timeout to None actually lets the request block past the system default
timeout. However, this would make the test suite unbearably slow.
Instead we verify that setting the timeout to None does not prevent the
Instead, we verify that setting the timeout to None does not prevent the
request from succeeding.
"""
r = requests.get(httpbin("get"), timeout=timeout)
Expand Down Expand Up @@ -2887,7 +2887,7 @@ def response_handler(sock):
r1 = s.get(url, verify=False)
assert r1.status_code == 200

# Has right trust bundle, but certificate expired
# Has the right trust bundle, but the certificate is expired
with pytest.raises(requests.exceptions.SSLError):
s.get(url, verify="tests/certs/expired/ca/ca.crt")

Expand Down