failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · psf/requests
(not found in data/tasks.jsonl)
| # | Tool | Arguments | Result |
|---|---|---|---|
| No trace captured. | |||
ts.TestRequests object at 0x1037dae40>
httpbin = <function prepare_url.<locals>.inner at 0x1045db7e0>
def test_header_with_subclass_types(self, httpbin):
"""If the subclasses does not behave *exactly* like
the base bytes/str classes, this is not supported.
This test is for backwards compatibility.
"""
class MyString(str):
pass
class MyBytes(bytes):
pass
> r_str = requests.get(httpbin("get"), headers={MyString("x-custom"): "myheader"})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_requests.py:1767:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
requests/api.py:73: in get
return request("get", url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
requests/api.py:59: in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
requests/sessions.py:573: in request
prep = self.prepare_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^
requests/sessions.py:484: in prepare_request
p.prepare(
requests/models.py:369: in prepare
self.prepare_headers(headers)
requests/models.py:491: in prepare_headers
check_header_validity(header)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
header = ('x-custom', 'myheader')
def check_header_validity(header):
"""Verifies that header parts don't contain leading whitespace
reserved characters, or return characters.
:param header: tuple, in the format (name, value).
"""
name, value = header
for part in header:
if type(part) not in HEADER_VALIDATORS:
> raise InvalidHeader(
f"Header part ({part!r}) from {{{name!r}: {value!r}}} must be "
f"of type str or bytes, not {type(part)}"
)
E requests.exceptions.InvalidHeader: Header part ('x-custom') from {'x-custom': 'myheader'} must be of type str or bytes, not <class 'tests.test_requests.TestRequests.test_header_with_subclass_types.<locals>.MyString'>
requests/utils.py:1037: InvalidHeader
=============================== warnings summary ===============================
requests/__init__.py:109
/private/tmp/swe_work/mined_baseline/requests_6356/workspace/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (2.8.0) or chardet (None)/charset_normalizer (3.5.1) doesn't match a supported version!
warnings.warn(
../../../../../../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: 91 warnings
/Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/requests/lib/python3.13/site-packages/urllib3/poolmanager.py:331: FutureWarning: The 'strict' parameter is no longer needed on Python 3+. This will raise an error in urllib3 v3.0.
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_baseline/requests_6356/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_baseline/requests_6356/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_baseline/requests_6356/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_baseline/requests_6356/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, 194 passed, 1 skipped, 101 warnings in 1.50s
[2026-09-23 20:56:51,161] 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:56:51] "POST /post HTTP/1.1" 200 363
127.0.0.1 - - [23/Sep/2026 20:56:51] "GET /cookies HTTP/1.1" 200 40
127.0.0.1 - - [23/Sep/2026 20:56:51] "GET /user-agent HTTP/1.1" 200 60
127.0.0.1 - - [23/Sep/2026 20:56:52] "POST /post HTTP/1.1" 200 416
127.0.0.1 - - [23/Sep/2026 20:56:52] "GET /get?f%C3%B8%C3%B8=f%C3%B8%C3%B8 HTTP/1.1" 200 340
127.0.0.1 - - [23/Sep/2026 20:56:52] "GET /%C3%B8?foo=foo HTTP/1.1" 404 207
127.0.0.1 - - [23/Sep/2026 20:56:52] "GET /get?foo=bar&FOO=bar HTTP/1.1" 200 326