GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-29553: Fixed ArgumentParses format_usage for mutually exclusive groups by andrewnester · Pull Request #117 · python/cpython

Conversation

@andrewnester

@andrewnester andrewnester commented Feb 15, 2017

Copy link
Copy Markdown
Contributor

Fix for https://bugs.python.org/issue29553

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 15, 2017
@andrewnester andrewnester mentioned this pull request Feb 15, 2017
Alternarive for bpo-29553 - Fixed ArgumentParses format_usage for mutually exclusive groups #120
Closed
berkerpeksag
berkerpeksag requested changes Feb 19, 2017
View reviewed changes

@berkerpeksag berkerpeksag left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just did a quick review and the PR looks good in general, thank you. We also need an entry in Misc/NEWS (should be in "Library" section)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_argparse.py Outdated

@berkerpeksag berkerpeksag Feb 19, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you can't use the existing test infrastructure? I think it's possible to convert these tests to follow the style of TestMutuallyExclusiveOptionalAndPositional: https://github.com/python/cpython/blob/82e38bd80113ecfc7aff2fb3edaf2802fe21c1fb/Lib/test/test_argparse.py#L2560

We can define a get_parser() method and use usage_when_required and usage_when_not_required to check output of parser.format_help().

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@berkerpeksag berkerpeksag changed the title bpo-29553 - Fixed ArgumentParses format_usage for mutually exclusive groups bpo-29553: Fixed ArgumentParses format_usage for mutually exclusive groups Feb 19, 2017
andrewnester added 3 commits February 19, 2017 20:21
@andrewnester
bpo-29553 - Fixed ArgumentParses format_usage for mutually exclusive …
d01e2ee
…groups
@andrewnester
Updated test for ArgumentParser
12677f8
@andrewnester
Updated MISC/NEWS
882091b
@andrewnester

andrewnester commented Feb 19, 2017

Copy link
Copy Markdown
Contributor Author

@berkerpeksag thanks! just updated my PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: fix a reference leak to Py_None in generator.throw()
494f2c2
Fix the first of several leaks. This one affects generator objects, which
get finalised without being exhausted.

https://bitbucket.org/stackless-dev/stackless/issues/117
(grafted from 7e86b49712ae5228edcdd822cb4b7e633d7c4363)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117)
28e4aa6
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117)
f050cf2
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: Code cleanup: move function slp_run_tasklet from sc…
0d3af5e
…heduling.c to stacklesseval.c

This change makes a few functions "static". This improves the readability of the code.
(grafted from b04162d33bed4125633dbaca6c2f9a8ec13edb4f)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: Code cleanup: simplify the anti-link-optimiser code…
d5696be
… in slp_eval_frame_*()

This change simplifies the code, that prevents the link optimiser to optimise away the identical functions slp_eval_frame_*(). The new code is simpler, faster and makes the overall reference counting less hard to understand.
(grafted from 72d9447daf24f9441289784714c307f4e1d5e79f)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: fix a reference leak in stackless.threads
052bcb8
Fix two reference leaks in the C-implementation of stackless.threads.

https://bitbucket.org/stackless-dev/stackless/issues/117
(grafted from 0ed22581e9fc255195d9116446ab9b20bcf99ac8)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: fix a reference leak in tasklet.__setstate__()
119ca9b
Fix two reference leaks in the C-implementation of tasklet.__setstate__(). This fix depends on the previous commit. Without the new frame reference counting logic, it could lead to a negative reference count.
Probably issue python#117 is now completely fixed.

https://bitbucket.org/stackless-dev/stackless/issues/117
(grafted from a89093b495d7d9a7c2420001f674077fb6c586d1)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: bring the handling of caught exceptions in line wit…
0ad0eac
…h C-Python

Exception handling now follows suit the code of sys.exc_clear() and ceval.c set_exc_info().
This change helps to rule out reference leaks caused by inappropriate handling of traceback objects.

https://bitbucket.org/stackless-dev/stackless/issues/117
(grafted from 36fc9e84a48999378a73173c179ba6beeabcf821)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: add a way to access tstate->st.watchdogs from Pytho…
af595e2
…n code

This feature makes it possible to write tests for leaks caused by the watchdog list.
The feature is intentionally undocumented, because it depends on implementation
details.

https://bitbucket.org/stackless-dev/stackless/issues/117
(grafted from 926f8eb7666730436799f19923852a7d16ae83ed)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: improve the test suite
5ea55fe
This commit adds tests to detect resources leaks and changes of global state. Additionally it adds utility functions for debugging and tests, which inevitably leak references.

- StacklessTestCase now tests for watchdog list leaks. The setUp() and tearDown() method now assert that the watchdog list of all threads is empty. Fortunately, this new test didn't reveal unknown problems.
- StacklessTestCase tearDown now kills blocked tasklets with C-state. Such tasklets may be kept alive by a reference to a transient bound-method object, which referenced by a C-function.
- StacklessTestCase tearDown now checks that the switch-trap level is 0 and resets the level, if it was different.
- StacklessTestCase now checks that no error-handler is registered at the end of a test and eventually removes the error handler.
- Add a decorator for tests, which leak references. A test case, which creates a C-stack without a thread, inevitably leak all references hold by local C-variables in this stack slice. The decorator skips decorated test-cases during "huntrleaks"-runs (option "-R:").

Debugging additions:
- StacklessTestCase got two (experimental) methods to trace tasklet switching.

https://bitbucket.org/stackless-dev/stackless/issues/117
(grafted from b2fc5542b34542abb275f8d1bc33691b0113bcaf)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: fix various reference leaks
8450bb9
- channelobject.c: Fix two reference leaks in the C-implementations of channel.send_throw() and channel.send_exception().
- stacklessmodule.c: Fix a reference leak in PyStackless_CallErrorHandler(), if Stackless runs a user defined error-handler.
- ceval.c: Fix a reference leak in PyEval_EvalFrameEx_slp(), if a profile or trace function fails.
- prickelpit.c and test_pickle.py: Fix reference leaks, if stackless._wrap.frame.__setstate__() fails, due to an invalid state. Add a test case.

https://bitbucket.org/stackless-dev/stackless/issues/117
(grafted from f5d4ba8df893949daa6938b7161786783fb0c149)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: test suite: fix test cases with runAll.py option -R:
3555a21
This commit fixes problems in the Stackless test suite at Python level. It does not fix failures caused by reference leaks.
- Fix failures, which occurred during a second or further run of the test.
- Mark test-cases, which inevitably leak references. These tests leave a C-stack without thread. No chance to clean the references.

https://bitbucket.org/stackless-dev/stackless/issues/117
(grafted from 7ae818842aa4783eb33be6a6085535ba18db97bc)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
Issue python#117: fix various reference leaks to frames.
d0ff48c
Stackless used to leak references to frames / C-frames, if a tasklet didn't run to its end, or various other conditions.

This part of the fix changes the Stackless reference counting for frames to follow the general rules for Python objects. The concept of an "execute reference" no longer exists.
Frames no longer eat their reference. See Stackless/core/stackless_impl.h for a detailed explanation.

This patch adds a special frame reference counting debug mode, which can be enabled in stackless_tstate.h.

https://bitbucket.org/stackless-dev/stackless/issues/117
(grafted from 9e9a2cea45059e87d025a1867beb8b0e3369262d)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117, code cleanup)
efbee92
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117, code cleanup)
32d50a2
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117, ceval.c cleanup)
33080ce
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117, ceval.c cleanup)
462f201
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117, exception handling)
230c713
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117, exception handling)
231c0e2
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117, stackless.threads)
bf7284a
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117, stackless.threads)
344e682
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117, st.watchdogs)
efa2504
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117, st.watchdogs)
e13d0e6
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117, StacklessTestCase)
e0f01d1
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117, StacklessTestCase)
298c15f
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117, fix test cases)
dc3cfaf
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117, fix test cases)
922a6f0
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117, fix various reference leaks)
cdf9d54
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117, fix various reference leaks)
a3d95de
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117, fix frame reference leaks)
405a9cd
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117, fix frame reference leaks)
3272cdf
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.3-slp (Stackless python#117, tasklet.__setstate__())
da776ec
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
Anselm Kruis
merge 3.4-slp (Stackless python#117, tasklet.__setstate__())
fb4997d
@Mariatta Mariatta added needs rebase and removed needs rebase labels Oct 9, 2017
@brettcannon

brettcannon commented Feb 21, 2018

Copy link
Copy Markdown
Member

To try and help move older pull requests forward, we are going through and backfilling 'awaiting' labels on pull requests that are lacking the label. Based on the current reviews, the best we can tell in an automated fashion is that a core developer requested changes to be made to this pull request.

If/when the requested changes have been made, please leave a comment that says, I have made the requested changes; please review again. That will trigger a bot to flag this pull request as ready for a follow-up review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon brettcannon added the awaiting changes label Feb 21, 2018
akruis added a commit to akruis/cpython that referenced this pull request Nov 1, 2018
@akruis
Stackless issue python#177: Fix prickelpit.c function slp_cannot_exec…
5a574b8
…ute()

I missed the C-fame case, when I changed the frame-function ref counting
in Stackless issue python#117.
@flavianh flavianh mentioned this pull request Jul 27, 2019
bpo-29553: Fixed ArgumentParses format_usage for mutually exclusive groups #14976
Merged
@flavianh

flavianh commented Jul 27, 2019

Copy link
Copy Markdown

Recreated at #14976

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeros

aeros commented Aug 22, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Since this PR has not received a response from the author since the awaiting changes label was added on Feb 20, 2018 and was recreated at #14976, I'm closing it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeros aeros closed this Aug 22, 2019
@aeros aeros mentioned this pull request Aug 23, 2019
Write guidelines about closing PR/issue by triagers python/devguide#527
Closed
jaraco pushed a commit that referenced this pull request Dec 2, 2022
@pyup-bot @Mariatta
Update celery from 4.2.0 to 4.2.1 (#117)
1a36e90
@gvanrossum gvanrossum mentioned this pull request Aug 22, 2023
heap-use-after-free in _PyFunction_LookupByVersion #108253
Closed
This was referenced Feb 11, 2025
segmentfault when pip installing setuptools #129992
Closed
segmentfault when pip installing setuptools #129993
Closed
@sergey-miryanov sergey-miryanov mentioned this pull request Dec 18, 2025
Observed memory leak in ssl library: Python 3.14 GC issue #142516
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@berkerpeksag berkerpeksag berkerpeksag requested changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting changes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@andrewnester @brettcannon @flavianh @aeros @berkerpeksag @Mariatta @the-knights-who-say-ni
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.