Title: Python implementation of `json.loads()` accepts non-ascii digits · Issue #125682 · python/cpython · GitHub
Open Graph Title: Python implementation of `json.loads()` accepts non-ascii digits · Issue #125682 · python/cpython
X Title: Python implementation of `json.loads()` accepts non-ascii digits · Issue #125682 · python/cpython
Description: Bug report Bug description: You should be careful when matching unicode regexes: cpython/Lib/json/scanner.py Lines 11 to 13 in a0f5c8e NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTILINE | re....
Open Graph Description: Bug report Bug description: You should be careful when matching unicode regexes: cpython/Lib/json/scanner.py Lines 11 to 13 in a0f5c8e NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?...
X Description: Bug report Bug description: You should be careful when matching unicode regexes: cpython/Lib/json/scanner.py Lines 11 to 13 in a0f5c8e NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][...
Opengraph URL: https://github.com/python/cpython/issues/125682
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python implementation of `json.loads()` accepts non-ascii digits","articleBody":"# Bug report\n\n### Bug description:\n\nYou should be careful when matching unicode regexes:\n\nhttps://github.com/python/cpython/blob/a0f5c8e6272a1fd5422892d773923b138e77ae5f/Lib/json/scanner.py#L11-L13\n\n```python\n>>> import sys\n>>> sys.modules[\"_json\"] = None\n>>> import json\n>>> json.loads(\"[1\\uff10, 0.\\uff10, 0e\\uff10]\")\n[10, 0.0, 0.0]\n```\n\nI think it's safer to use `[0-9]` instead of `\\d` here.\n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-125687\n* gh-125692\n* gh-125693\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/nineteendo","@type":"Person","name":"nineteendo"},"datePublished":"2024-10-18T07:45:47Z","url":"https://github.com/python/cpython/issues/125682"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e9b07584-c04a-9792-a0bc-6250c068fb38 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D8BA:7189C:1A32CB:2268E9:6B024A53 |
| html-safe-nonce | 47f287ed019a44c9d1b388b13d9dc6f6c925972467ce925d64a35d019ad06ad9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOEJBOjcxODlDOjFBMzJDQjoyMjY4RTk6NkIwMjRBNTMiLCJ2aXNpdG9yX2lkIjoiMTI3MDg4NDg2NjI0NTkzNzc0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e39465c8cacb6af5ee0ae69fdb3a69a30acf3667037fb63e3a235086a8f9e4e0 |
| hovercard-subject-tag | issue:2596726178 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/125682/issue_layout |
| twitter:image | https://opengraph.githubassets.com/15faaa45d3e081f54a85d43c29b34f9869b64c2f0912a52659415a974fb402bf/python/cpython/issues/125682 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/15faaa45d3e081f54a85d43c29b34f9869b64c2f0912a52659415a974fb402bf/python/cpython/issues/125682 |
| og:image:alt | Bug report Bug description: You should be careful when matching unicode regexes: cpython/Lib/json/scanner.py Lines 11 to 13 in a0f5c8e NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nineteendo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width