[Pulse demo] psf/requests PR #6048: Fixing unicode surrogates in POST data lead to exception - #29
[Pulse demo] psf/requests PR #6048: Fixing unicode surrogates in POST data lead to exception#29dominic097 wants to merge 1 commit into
Conversation
| "changeType": "MODIFIED", | ||
| "deletions": 0, | ||
| "path": "tests/test_requests.py" | ||
| } |
There was a problem hiding this comment.
🐞 correctness · 🟠 Major
PR claims a surrogate-handling bug fix, but no production code is changed
This PR is titled and described as fixing 'unicode surrogates' in POST data, but the actual repository diff does not modify any runtime code. The only substantive addition here is metadata that references upstream changes in requests/adapters.py and requests/models.py (files array in this JSON), while this PR itself changes neither of those files; the only other changed file in the diff is tests/test_requests.py, and it only adds a comment. As a result, the bug described by the PR remains present and merging this would incorrectly signal that issue psf#6008 is fixed. Please include the actual library code changes in the request preparation/encoding path (and any required adapter handling) rather than only recording upstream PR metadata.
P2 · Impact high (4/5) · Confidence high
🤖 Prompt for AI agents
Port the real surrogate-handling implementation into the affected runtime files in this repository, ensuring the POST data preparation path no longer raises the reported exception for unpaired surrogates. Keep the metadata file only if desired, but do not rely on it as the fix.
🔒 Secure confirmation — opens an authenticated page; the fix is attributed to you. Or reply @aziron fix finding:root-issue-not-implemented
| deserialized_error = pickle.loads(pickle.dumps(json_decode_error)) | ||
| assert repr(json_decode_error) == repr(deserialized_error) | ||
|
|
||
| # Pulse demo seed 2026-06-24: metadata from psf/requests PR #6048 |
There was a problem hiding this comment.
🧪 test · 🟡 Moderate
No executable regression test was added for the surrogate POST-data failure
The only change in tests/test_requests.py is a comment (# Pulse demo seed 2026-06-24: metadata from psf/requests PR #6048), so this PR adds no runnable coverage for the issue it claims to fix. Given the PR title/body say POST data with Unicode surrogates previously raised an exception, there should be a regression test that exercises that exact input through request preparation/sending and asserts the intended non-crashing behavior. Without such a test, the bug is neither demonstrated nor protected against future regressions.
P3 · Impact medium (3/5) · Confidence high
🤖 Prompt for AI agents
Add a focused regression test in `tests/test_requests.py` that constructs POST data containing an unpaired Unicode surrogate, runs it through the affected Requests code path, and asserts the expected behavior instead of the prior exception. Include any necessary companion test updates if the fix changes request-preparation semantics.
🔒 Secure confirmation — opens an authenticated page; the fix is attributed to you. Or reply @aziron fix finding:missing-regression-test
🔍 Aziron Pulse Review
This PR does not implement the referenced surrogate-handling fix in the library code; it only adds a demo metadata JSON file and a comment in an existing test file. As submitted, the root issue described by the PR title/body remains unaddressed and no validating tests were added. Confidence Score: 2/5 The diff is extremely small and fully visible: it adds one metadata JSON file and one comment line block, with no production-code modifications. That makes it clear the described bug fix is not implemented in this PR. 💬 Pre-merge checks · ✅ 1 · ❌ 3❌ Failed checks
✅ Passed checks
📝 WalkthroughEngineering ReviewWhat changed: The diff adds a new metadata file at Correctness: The change is not correct relative to the stated purpose. The added JSON says the upstream PR fixes 'unicode surrogates' by modifying Completeness: The PR is incomplete for its stated scope. A complete fix would require the production code changes in the request preparation/adapter path plus regression tests exercising POST data containing unpaired Unicode surrogates. Instead, the diff only records upstream metadata in Risks: Primary risk is merge-time false confidence: the PR title/body indicate a bug fix, but the repository would ship unchanged runtime behavior. This can mislead maintainers or downstream users into believing the surrogate exception path has been addressed when it has not. There is no direct runtime regression from the comment/metadata additions themselves, but there is a process/traceability risk because the repository state would claim closure of an issue without corresponding code. Missing tests: A regression test should be added in Follow-up work: Apply the actual upstream code changes (or an equivalent local fix) in the real affected runtime files, not just metadata. Add targeted regression coverage for surrogate-containing POST bodies. If Decision — REQUEST_CHANGES: Per the decision criteria, 📁 Files changedImportant Files Changed
Actionable comments posted: 2 (0 suggested change(s), 2 fix-session candidate(s)) Fix all findings: comment 📋 Reviewed against: lint (python): Aziron Pulse — sandbox + MCP-assisted LLM review with native code intelligence. |
|
🪄 Autofix — generate a fix for all Aziron Pulse findings on this PR:
Tick the box above (or comment |
requests/models.py(MODIFIED)tests/test_requests.py(MODIFIED)Fixing the unicode surrogates issue