Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main branch code cleanups for int_max_str_digits non-backportable TODOs #96512

Closed
2 of 4 tasks
gpshead opened this issue Sep 2, 2022 · 2 comments
Closed
2 of 4 tasks
Assignees
Labels
3.12 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@gpshead
Copy link
Member

gpshead commented Sep 2, 2022

I had some post-merge TODOs ready in #96499 for improvements specific to the main (3.12) branch. This is a rollup issue for those, they're all small:

  • Cleanup: Move int_max_str_digits into PyConfig in 3.12.
  • Use int32_t or Py_ssize_t instead of int for the max digits value internally.
  • Minor feature: add PEP-578 PySys_Audit hook calls at the new ValueError raise spots.
  • Once this ships in 3.11.0: Update the version notes about it in the 3.12 docs to say 3.11 and remove the 3.12 whatsnew text about it. The original PR was created not knowing exactly when we'd be able to merge.
@gpshead gpshead added type-feature A feature request or enhancement interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.12 bugs and security fixes labels Sep 2, 2022
@gpshead gpshead self-assigned this Sep 2, 2022
@isuruf
Copy link
Contributor

isuruf commented Sep 18, 2022

Could the limit be a configuration option, so that people who build from source can configure the limit?

@gpshead
Copy link
Member Author

gpshead commented Sep 19, 2022

Could the limit be a configuration option, so that people who build from source can configure the limit?

Lets have that be its own issue if someone comes up with a compelling use case for it.

My thinking in not including a configure flag to start with is that anyone who builds from source likely also carries patches to their sources so there isn't a good reason to offer a configure option. We don't want to encourage interpreters built and shipped in different environments to have different limits as that can create compatibility headaches for application and library authors potentially expanding their test matrix.

gpshead added a commit to gpshead/cpython that referenced this issue Sep 19, 2022
It was unknown if it'd be before 3.11.0 when creating the original
changes.  It's in 3.11rc2, so 3.11 it is.
gpshead added a commit that referenced this issue Sep 19, 2022
It was unknown if it'd be before 3.11.0 when creating the original
changes.  It's in 3.11rc2, so 3.11 it is.
gpshead added a commit to gpshead/cpython that referenced this issue Sep 20, 2022
It had to live as a global outside of PyConfig for stable ABI reasons in
the pre-3.12 backports.

This removes the `_Py_global_config_int_max_str_digits` and gets rid of
the equivalent field in the internal `struct _is PyInterpreterState` as
code can just use the existing nested config struct within that.
gpshead added a commit that referenced this issue Oct 3, 2022
It had to live as a global outside of PyConfig for stable ABI reasons in
the pre-3.12 backports.

This removes the `_Py_global_config_int_max_str_digits` and gets rid of
the equivalent field in the internal `struct _is PyInterpreterState` as
code can just use the existing nested config struct within that.

Adds tests to verify unique settings and configs in subinterpreters.
@gpshead gpshead closed this as completed Oct 3, 2022
carljm added a commit to carljm/cpython that referenced this issue Oct 3, 2022
* main: (2069 commits)
  pythongh-96512: Move int_max_str_digits setting to PyConfig (python#96944)
  pythongh-94808: Coverage: Check picklablability of calliter (python#95923)
  pythongh-94808: Add test coverage for PyObject_HasAttrString (python#96627)
  pythongh-94732: Fix KeyboardInterrupt race in asyncio run_forever() (python#97765)
  Fix typos in `bltinmodule.c`. (pythonGH-97766)
  pythongh-94808: `_PyLineTable_StartsLine` was not used (pythonGH-96609)
  pythongh-97681: Remove Tools/demo/ directory (python#97682)
  Fix typo in unittest docs (python#97742)
  pythongh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE converter (pythonGH-97729)
  pythongh-95913: Fix PEP number in PEP 678 What's New ref label (python#97739)
  pythongh-95913: Copyedit/improve New Modules What's New section (python#97721)
  pythongh-97740: Fix bang in Sphinx C domain ref target syntax (python#97741)
  pythongh-96819: multiprocessing.resource_tracker: check if length of pipe write <= 512 (python#96890)
  pythongh-97706: multiprocessing tests: Delete unused variable `rand` (python#97707)
  pythonGH-85447: Clarify docs about awaiting future multiple times (python#97738)
  [docs] Update logging cookbook with recipe for using a logger like an output… (pythonGH-97730)
  pythongh-97607: Fix content parsing in the impl-detail reST directive (python#97652)
  pythongh-95975: Move except/*/finally ref labels to more precise locations (python#95976)
  pythongh-97591: In `Exception.__setstate__()` acquire strong references before calling `tp_hash` slot (python#97700)
  pythongh-95588: Drop the safety claim from `ast.literal_eval` docs. (python#95919)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants