[Pulse demo] psf/requests PR #5486: Allow for autodection of encoding for scalar values - #26
dominic097 wants to merge 1 commit into
Conversation
dominic097
left a comment
There was a problem hiding this comment.
Aziron Pulse PR Review
This PR purports to port psf/requests PR psf#5486 (autodetect encoding for scalar JSON values) but the actual diff only adds a metadata JSON file and a trailing comment to tests/test_utils.py. None of the described source changes (requests/models.py, requests/utils.py) or the 18 lines of new tests are present.
Confidence Score: 5/5
The full diff is small and fully visible: it is unambiguously just a metadata JSON file and a trailing comment, with none of the source/test changes described in the PR metadata.
| Field | Value |
|---|---|
| Verdict | request_changes |
| Confidence | high |
| Changed files | 2 |
1 actionable finding(s) were posted inline on the diff (0 suggested change(s), 1 fix-session candidate(s)).
To generate one fix PR for all Pulse findings, comment:
@aziron fix
Aziron Pulse generated this from sandbox/MCP-assisted LLM review with native code intelligence context.
| monkeypatch.setattr(winreg, "QueryValueEx", QueryValueEx) | ||
| assert should_bypass_proxies("http://example.com/", None) is False | ||
|
|
||
| # Pulse demo seed 2026-06-24: metadata from psf/requests PR #5486 |
There was a problem hiding this comment.
error: This PR claims to port psf/requests PR psf#5486 (autodetect encoding for scalar JSON values), but the only change to source is this trailing comment plus a blank line — no implementation. The upstream metadata in upstream-pr-5486.json lists edits to requests/utils.py (guess_json_utf, +5/-6), requests/models.py (+5/-5), and 18 new test lines, none of which appear in this diff. Impact: the guess_json_utf bug for UTF-16/UTF-32 scalar values (single digit, quoted string with first char >255) remains unfixed while the PR appears to resolve it. Fix direction: actually add the guess_json_utf/models.py changes and add TestGuessJSONUTF cases for scalar values, and remove this stray demo comment from the test file.
Confidence: high
This requires a sandbox fix session.
Fix task: Port psf/requests PR psf#5486: update requests/utils.py guess_json_utf to handle RFC 7158 scalar JSON values where the first two bytes are not both ASCII (e.g. a single digit or a quoted string whose first char has Unicode value >255 in utf-16/utf-32 BE/LE), update requests/models.py accordingly, add corresponding cases to TestGuessJSONUTF in tests/test_utils.py asserting correct encoding detection, and remove the stray '# Pulse demo seed' comment.
To generate a fix PR, comment:
@aziron fix finding:missing-implementation
requests/utils.py(MODIFIED)tests/test_utils.py(MODIFIED)The JSON Unicode detection algorithm in "requests" assumes that the first two characters are always ASCII. That is not true anymore.
Therefore the current detection fails in at least these two edge cases
Also autodetection by chardet returns the wrong encoding.
This change detects the encoding in case of those two edge cases.