-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Fix argparse double color #141588
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
Closed
chillakalyan
wants to merge
1,427
commits into
python:main
from
chillakalyan:fix-argparse-double-color
Closed
Fix argparse double color #141588
chillakalyan
wants to merge
1,427
commits into
python:main
from
chillakalyan:fix-argparse-double-color
Conversation
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
…) (python#140113) Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
pythongh-139340) (pythongh-140110) pythongh-101828: Fix `jisx0213` codecs removing null characters (pythongh-139340) (cherry picked from commit 87eadce) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…odules (pythonGH-139755) (pythonGH-140117) Revert pythonGH-131993. Fix swallowing some syntax warnings in different modules if they accidentally have the same message and are emitted from the same line. Fix duplicated warnings in the "finally" block. (cherry picked from commit 279db6b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * Update 2025-10-06-10-03-37.gh-issue-139640.gY5oTb.rst --------- Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…on#140088) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…onGH-140134) (python#140143) Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
…ck if objects are uniquely referenced (pythongh-140062) (pythongh-140157) The previous `Py_REFCNT(x) == 1` checks can have data races in the free threaded build. `_PyObject_IsUniquelyReferenced(x)` is a more conservative check that is safe in the free threaded build and is identical to `Py_REFCNT(x) == 1` in the default GIL-enabled build. (cherry picked from commit 32c2649) Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
….11-3.13 (pythonGH-140158) (python#140164) pythongh-140153: Fix Py_REFCNT() definition on limited C API 3.11-3.13 (pythonGH-140158) (cherry picked from commit 728d239) Co-authored-by: Victor Stinner <vstinner@python.org>
…when ABI flags are present (pythonGH-140178) (python#140180) Use sysconfig to determine the full name of libpython, rather than hardcoding a library name that doesn't have ABI flags. (cherry picked from commit 7f371ed) Co-authored-by: Malcolm Smith <smith@chaquo.com>
…zeros in floating point numbers (pythonGH-140066) (pythonGH-140167) (cherry picked from commit 1624c64) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…ython#140198) pythongh-140170: Fix test_site with -s flag (pythonGH-140179) Commit (cherry picked from commit 7ac94fc) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…ython#140217) pythongh-140078: fix typo in tkinter docs (pythonGH-140081) Remove extraneous word. (cherry picked from commit 5f357f3) Co-authored-by: wangxiaolei <fatelei@gmail.com>
…ythonGH-140225) (cherry picked from commit 2ebd0cd)
… lists … (pythonGH-138868) (python#140207) pythongh-138859: Account for `ParamSpec` defaults that are not lists … (pythonGH-138868) (cherry picked from commit 379fd02) Co-authored-by: bzoracler <50305397+bzoracler@users.noreply.github.com>
…honGH-140188) (python#140192) pythongh-140120: Refresh HACL* to fix an hmac memory leak (pythonGH-140188) This pulls an updated version of HACL* that fixes the memory leak reported in pythonGH-140120, via an upstream fix. (cherry picked from commit 3a81313) Co-authored-by: Jonathan Protzenko <jonathan.protzenko+github@gmail.com>
…GH-131787) (python#137737) pythongh-131788: make resource_tracker re-entrant safe (pythonGH-131787) * make resource_tracker re-entrant safe * Update Lib/multiprocessing/resource_tracker.py * trim trailing whitespace * use f-string and args = [x, *y, z] * raise self._reentrant_call_error --------- (cherry picked from commit f24a012) Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
…ythonGH-140240) (pythonGH-140246) (cherry picked from commit fbf0843) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…ading (pythonGH-140068) (python#140229) pythongh-116738: test `uuid` module thread safety in free-threading (pythonGH-140068) (cherry picked from commit 9a87ce8) Co-authored-by: Alper <alperyoney@fb.com>
…Python 3.13 (pythonGH-133831) (python#140276) pythonGH-133789: Fix unpickling of pathlib objects pickled in Python 3.13 (pythonGH-133831) In Python 3.13 (but not 3.12 or 3.14), pathlib classes are defined in `pathlib._local` rather than `pathlib`. In hindsight this was a mistake, but it was difficult to predict how the abstract/local split would pan out. In this patch we re-introduce `pathlib._local` as a stub module that re-exports the classes from `pathlib`. This allows path objects pickled in 3.13 to be unpicked in 3.14+ (cherry picked from commit f4e51f2) Co-authored-by: Barney Gale <barney.gale@gmail.com>
…GH-140274) (pythonGH-140285) (cherry picked from commit f937468) Co-authored-by: Shamil <ashm.tech@proton.me>
…ythonGH-140290) (pythonGH-140291) (cherry picked from commit 936de25) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…of warnings.warn_explicit() (pythonGH-140242) (pythonGH-140292) (cherry picked from commit 78e1d65) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
…tion (pythonGH-140265) (python#140294) pythongh-140257: fix data race on eval_breaker during finalization (pythonGH-140265) (cherry picked from commit c8729c9) Co-authored-by: Shamil <ashm.tech@proton.me>
…ythonGH-140111) (python#140118) * [3.14] pythongh-140067: Fix memory leak in sub-interpreter creation (pythonGH-140111) Fix memory leak in sub-interpreter creation caused by overwriting of the previously used `_malloced` field. Now the pointer is stored in the first word of the memory block to avoid it being overwritten accidentally. (cherry picked from commit 59547a2) Co-authored-by: Shamil <ashm.tech@proton.me> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
…H-139974) (python#140309) Closes pythonGH-128571 (cherry picked from commit 920de7c) Co-authored-by: Parham MohammadAlizadeh <prhmma@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…er docs (pythonGH-139023) (python#140319) pythongh-138997: Remove false justify `fill` option from Tkinter docs (pythonGH-139023) (cherry picked from commit 115a04b) Co-authored-by: Marat Khagazheev <marathagazeev@gmail.com> Co-authored-by: marat <khagazheev@artlebedev.ru>
…icate code (pythonGH-140259) (python#140322) `Lib/idlelib/idle_test/__init__.py`: remove commented out duplicate code (pythonGH-140259) (cherry picked from commit 790cdae) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…H-139898) * Support non-UTF-8 shebang and comments if non-UTF-8 encoding is specified. * Detect decoding error in comments for UTF-8 encoding. * Include the decoding error position for default encoding in SyntaxError. (cherry picked from commit 5c942f1) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…ndling (pythonGH-140307) (pythonGH-140338) (cherry picked from commit f932321) Co-authored-by: Shamil <ashm.tech@proton.me>
…ython#140275) Standardize translation of `Doc/bugs.rst` (pythonGH-137449) (cherry picked from commit 869bb69) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Member
|
Please create a new branch with a correct history |
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.
Fixes: #141571
The color initialization logic in argparse currently calls
_set_color()twice when creating a formatter:
HelpFormatter.init() calls
_set_color(color)immediately,with
color=Trueby default.Later, _get_formatter() calls
_set_color(self.color)again.This results in unnecessary repeated environment lookups and duplicate
calls to
_colorize.can_colorize(), especially when color=False.This patch removes the early
_set_color(color)call insideHelpFormatter.init and replaces it with a simple attribute assignment:
The actual color initialization continues to happen once in
_get_formatter(), maintaining all existing behavior while avoidingredundant work.
📚 Documentation preview 📚: https://cpython-previews--141588.org.readthedocs.build/