cpython
cpython copied to clipboard
gh-59598: Ignore leading whitespace in `JSONDecoder.raw_decode`
Based on Bayard's patch in https://bugs.python.org/issue15393 Fixes #59598
- Issue: gh-59598
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.
If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.
If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.
Updated the code to make the matching function an argument and removed the extra call.
@crazymerlyn Thanks for the updates. Your pr still requires a news entry. The easiest way to add this is to use click on the Details button next to the failing bedevere/news in the list of CI checks.
Also see https://devguide.python.org/core-developers/committing/#how-to-add-a-news-entry
added a news entry
@eendebakpt Updated with the suggested change.
@crazymerlyn I read the corresponding issue and opinions on whether we should make this change or not (at least back in 2016!) are not unanimous. A core developer should decide whether to accept this or not. The code in the PR looks good to me.
Since this PR is not backwards compatible and there has been some discussion it is good to update the documentation (e.g. here https://docs.python.org/3/library/json.html#json.JSONDecoder.raw_decode) and add a Changed in version x.xx section (for an example see https://docs.python.org/3/library/bisect.html#bisect.bisect)