← mined_oracle

requests_6498

failed WRONG_FIX UNSUBMITTED wrong_fix_unsubmitted(None) · None tool calls · 0 s · psf/requests

Task input

(not found in data/tasks.jsonl)

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Patch

--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,7 +2,7 @@ exclude: 'docs/|ext/'
 
 repos:
 - repo: https://github.com/pre-commit/pre-commit-hooks
-  rev: v4.0.1
+  rev: v4.4.0
   hooks:
   - id: check-yaml
   - id: debug-statements
@@ -13,16 +13,16 @@ repos:
   hooks:
     - id: isort
 - repo: https://github.com/psf/black
-  rev: 22.3.0
+  rev: 23.7.0
   hooks:
     - id: black
       exclude: tests/test_lowlevel.py
 - repo: https://github.com/asottile/pyupgrade
-  rev: v2.31.1
+  rev: v3.10.1
   hooks:
     - id: pyupgrade
       args: [--py37-plus]
 - repo: https://github.com/PyCQA/flake8
-  rev: 6.0.0
+  rev: 6.1.0
   hooks:
     - id: flake8
--- a/requests/adapters.py
+++ b/requests/adapters.py
@@ -247,7 +247,6 @@ class HTTPAdapter(BaseAdapter):
         :param cert: The SSL certificate to verify.
         """
         if url.lower().startswith("https") and verify:
-
             cert_loc = None
 
             # Allow self-specified cert location.
--- a/requests/auth.py
+++ b/requests/auth.py
@@ -258,7 +258,6 @@ class HTTPDigestAuth(AuthBase):
         s_auth = r.headers.get("www-authenticate", "")
 
         if "digest" in s_auth.lower() and self._thread_local.num_401_calls < 2:
-
             self._thread_local.num_401_calls += 1
             pat = re.compile(r"digest ", flags=re.IGNORECASE)
             self._thread_local.chal = parse_dict_header(pat.sub("", s_auth, count=1))
--- a/requests/models.py
+++ b/requests/models.py
@@ -170,7 +170,7 @@ class RequestEncodingMixin:
                         )
                     )
 
-        for (k, v) in files:
+        for k, v in files:
             # support for explicit filename
             ft = None
             fh = None
@@ -268,7 +268,6 @@ class Request(RequestHooksMixin):
         hooks=None,
         json=None,
     ):
-
         # Default empty dicts for dict params.
         data = [] if data is None else data
         files = [] if files is None else files
@@ -277,7 +276,7 @@ class Request(RequestHooksMixin):
         hooks = {} if hooks is None else hooks
 
         self.hooks = default_hooks()
-        for (k, v) in list(hooks.items()):
+        for k, v in list(hooks.items()):
             self.register_hook(event=k, hook=v)
 
         self.method = method
@@ -865,7 +864,6 @@ class Response:
         for chunk in self.iter_content(
             chunk_size=chunk_size, decode_unicode=decode_unicode
         ):
-
             if pending is not None:
                 chunk = pending + chunk
 
--- a/requests/sessions.py
+++ b/requests/sessions.py
@@ -262,7 +262,6 @@ class SessionRedirectMixin:
             if yield_requests:
                 yield req
             else:
-
                 resp = self.send(
                     req,
                     stream=stream,
@@ -389,7 +388,6 @@ class Session(SessionRedirectMixin):
     ]
 
     def __init__(self):
-
         #: A case-insensitive dictionary of headers to be sent on each
         #: :class:`Request <Request>` sent from this
         #: :class:`Session <Session>`.
@@ -713,7 +711,6 @@ class Session(SessionRedirectMixin):
 
         # Persist cookies
         if r.history:
-
             # If the hooks create history then we want those cookies too
             for resp in r.history:
                 extract_cookies_to_jar(self.cookies, resp.request, resp.raw)
@@ -761,7 +758,7 @@ class Session(SessionRedirectMixin):
             # Set environment's proxies.
             no_proxy = proxies.get("no_proxy") if proxies is not None else None
             env_proxies = get_environ_proxies(url, no_proxy=no_proxy)
-            for (k, v) in env_proxies.items():
+            for k, v in env_proxies.items():
                 proxies.setdefault(k, v)
 
             # Look for requests environment configuration
@@ -787,8 +784,7 @@ class Session(SessionRedirectMixin):
 
         :rtype: requests.adapters.BaseAdapter
         """
-        for (prefix, adapter) in self.adapters.items():
-
+        for prefix, adapter in self.adapters.items():
             if url.lower().startswith(prefix.lower()):
                 return adapter
 
--- a/requests/utils.py
+++ b/requests/utils.py
@@ -763,6 +763,7 @@ def should_bypass_proxies(url, no_proxy):
 
     :rtype: bool
     """
+
     # Prioritize lowercase environment variables over uppercase
     # to keep a consistent behaviour with other http projects (curl, wget).
     def get_proxy(key):

Test output

show
.................................... [ 89%]
....................F
=================================== FAILURES ===================================
_ TestPreparingURLs.test_redirecting_to_bad_url[http://localhost:-1-InvalidURL] _

self = <tests.test_requests.TestPreparingURLs object at 0x1067a73e0>
httpbin = <function prepare_url.<locals>.inner at 0x1058a47c0>
url = 'http://localhost:-1'
exception = <class 'requests.exceptions.InvalidURL'>

    @pytest.mark.parametrize("url, exception", (("http://localhost:-1", InvalidURL),))
    def test_redirecting_to_bad_url(self, httpbin, url, exception):
>       with pytest.raises(exception):
             ^^^^^^^^^^^^^^^^^^^^^^^^
E       Failed: DID NOT RAISE InvalidURL

tests/test_requests.py:2708: Failed
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/Users/jp/.local/share/uv/python/cpython-3.13.15-macos-aarch64-none/lib/python3.13/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
                  ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/requests/lib/python3.13/site-packages/flask/app.py", line 1536, in __call__
    return self.wsgi_app(environ, start_response)
           ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/requests/lib/python3.13/site-packages/flask/app.py", line 1518, in wsgi_app
    return response(environ, start_response)
  File "/Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/requests/lib/python3.13/site-packages/werkzeug/wrappers/response.py", line 576, in __call__
    app_iter, status, headers = self.get_wsgi_response(environ)
                                ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/requests/lib/python3.13/site-packages/werkzeug/wrappers/response.py", line 562, in get_wsgi_response
    headers = self.get_wsgi_headers(environ)
  File "/Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/requests/lib/python3.13/site-packages/werkzeug/wrappers/response.py", line 481, in get_wsgi_headers
    location = iri_to_uri(location)
  File "/Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/requests/lib/python3.13/site-packages/werkzeug/urls.py", line 153, in iri_to_uri
    if parts.port:
       ^^^^^^^^^^
  File "/Users/jp/.local/share/uv/python/cpython-3.13.15-macos-aarch64-none/lib/python3.13/urllib/parse.py", line 182, in port
    raise ValueError(f"Port could not be cast to integer value as {port!r}")
ValueError: Port could not be cast to integer value as '-1'
127.0.0.1 - - [23/Sep/2026 20:55:42] "GET /redirect-to?url=http%3A%2F%2Flocalhost%3A-1 HTTP/1.1" 500 59
=============================== warnings summary ===============================
../../../../../../../Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/requests/lib/python3.13/site-packages/_pytest/config/__init__.py:1464
  /Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/requests/lib/python3.13/site-packages/_pytest/config/__init__.py:1464: PytestConfigWarning: Unknown config option: timeout
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
  /private/tmp/swe_work/mined_oracle/requests_6498/b/workspace/requests/auth.py:36: DeprecationWarning: Non-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (42) to a string or bytes object in the near future to avoid problems.
    warnings.warn(

tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
  /private/tmp/swe_work/mined_oracle/requests_6498/b/workspace/requests/auth.py:46: DeprecationWarning: Non-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (<class 'int'>) to a string or bytes object in the near future to avoid problems.
    warnings.warn(

tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
  /private/tmp/swe_work/mined_oracle/requests_6498/b/workspace/requests/auth.py:36: DeprecationWarning: Non-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (None) to a string or bytes object in the near future to avoid problems.
    warnings.warn(

tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
  /private/tmp/swe_work/mined_oracle/requests_6498/b/workspace/requests/auth.py:46: DeprecationWarning: Non-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (<class 'NoneType'>) to a string or bytes object in the near future to avoid problems.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed, 306 passed, 1 skipped, 1 xfailed, 9 warnings in 31.52s
[2026-09-23 20:55:11,832] WARNING in core: flasgger is not installed; serving the static landing page at / and skipping the Swagger UI and /spec.json.
127.0.0.1 - - [23/Sep/2026 20:55:12] "GET /get HTTP/1.1" 200 208
127.0.0.1 - - [23/Sep/2026 20:55:12] "GET /get HTTP/1.1" 200 272
127.0.0.1 - - [23/Sep/2026 20:55:12] "GET /basic-auth/user/pass HTTP/1.1" 401 0
127.0.0.1 - - [23/Sep/2026 20:55:12] "GET /digest-auth/auth/user/pass/SHA-512 HTTP/1.1" 401 0
127.0.0.1 - - [23/Sep/2026 20:55:12] "GET /%C3%B8?foo=foo HTTP/1.1" 404 207
127.0.0.1 - - [23/Sep/2026 20:55:12] "POST /post HTTP/1.1" 200 104514
127.0.0.1 - - [23/Sep/2026 20:55:12] "GET /get HTTP/1.1" 200 272