test(json_decoder): guard simplejson encoding-kwarg tolerance (unblocks v6.0.2)#15
Merged
cloudingenium-automation[bot] merged 1 commit intoJun 24, 2026
Conversation
…erance Guards the e49c9cb fix that swallows simplejson's obsolete encoding= kwarg (injected by requests via simplejson on Python 3.9+, rejected by stdlib json.JSONDecoder). The fix was untested until now; a live BfxLendingBot deploy of v6.0.1 (which predates e49c9cb) crashed on init with this exact TypeError, motivating a v6.0.2 release plus this guard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cloudingenium-automation
Bot
deleted the
fix/jsondecoder-simplejson-encoding
branch
June 24, 2026 20:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a regression test guarding the
JSONDecodersimplejson-encoding-kwarg tolerance fix (commite49c9cb, already onmaster).Why
requestsroutesresponse.json(cls=JSONDecoder)throughsimplejsonwheneverpython3-simplejsonis importable (it's an apt system package on several CloudIngenium hosts).simplejson.loadsinjects an obsoleteencoding=kwarg that stdlibjson.JSONDecoder.__init__rejects on Python 3.9+:e49c9cbfixed this bykwargs.pop("encoding", None), but the fix was untested and — critically — never released in a tag.v6.0.1(2026-03-31) predates the fix (2026-04-24). A live BfxLendingBot deploy that pip-installed@v6.0.1crashed on init with this exactTypeErroron a host withpython3-simplejson; CI never caught it because CI's clean env has no system simplejson.This PR adds the missing guard so the fix can't silently regress. It clears the path to a v6.0.2 release that BfxLendingBot can pin to (replacing the temporary site-package hotfix currently keeping the live bot up).
Test
test_tolerates_simplejson_encoding_kwargconstructsJSONDecoder(encoding="utf-8")and asserts a clean decode. Without the fix this raisesTypeError(verified). 13/13 decoder tests pass.🤖 Generated with Claude Code