Skip to content

Replace stale signature lines in getopt docstrings with summaries - #162202

Merged
StanFromIreland merged 3 commits into
python:mainfrom
farisbasha:fix-gnu-getopt-docstring
Nov 18, 2026
Merged

StanFromIreland merged 3 commits into
python:mainfrom
farisbasha:fix-gnu-getopt-docstring

Conversation

@farisbasha

@farisbasha farisbasha commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

The first line of the getopt() and gnu_getopt() docstrings showed a stale signature, getopt(args, options[, long_options]) -> opts, args: the real parameters are shortopts and longopts, and the gnu_getopt() copy even named the wrong function. Since help() already shows the actual signature, this removes those lines from both docstrings (as suggested in review).

Trivial docstring fix, so no issue (as the PR template allows for typo-level changes). It was found and checked against Lib/getopt.py with the help of an AI assistant.

It was copied from getopt() and named the wrong function, so
help(getopt.gnu_getopt) showed "getopt(args, options[, long_options])".
Comment thread Lib/getopt.py Outdated

def gnu_getopt(args, shortopts, longopts = []):
"""getopt(args, options[, long_options]) -> opts, args
"""gnu_getopt(args, options[, long_options]) -> opts, args

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The corrected line is still wrong, since the real parameters are shortopts and longopts, not options and long_options (getopt() has the same stale line). As help() already shows the actual signature, let's remove them from both docstrings instead.

@farisbasha farisbasha changed the title Fix the signature line in the gnu_getopt() docstring Remove stale signature lines from the getopt() and gnu_getopt() docstrings Nov 18, 2026
@farisbasha

Copy link
Copy Markdown
Contributor Author

Good point, thanks. I've removed the signature line from both the getopt() and gnu_getopt() docstrings, so help() shows only the real signature, and updated the title.

@StanFromIreland StanFromIreland changed the title Remove stale signature lines from the getopt() and gnu_getopt() docstrings Replace stale signature lines in getopt docstrings with summaries Nov 18, 2026
@StanFromIreland StanFromIreland added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Nov 18, 2026
@StanFromIreland
StanFromIreland merged commit ddd88c7 into python:main Nov 18, 2026
59 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @farisbasha for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Nov 18, 2026

Copy link
Copy Markdown

GH-162232 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 18, 2026
@bedevere-app

bedevere-app Bot commented Nov 18, 2026

Copy link
Copy Markdown

GH-162233 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 18, 2026
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Windows PGO 3.x (tier-1) has failed when building commit ddd88c7.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1620/builds/4951) and take a look at the build logs.
  4. Check if the failure is related to this commit (ddd88c7) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1620/builds/4951

Failed tests:

  • test_zipimport

Failed subtests:

  • testZip64LargeFile - test.test_zipimport.UncompressedZipImportTestCase.testZip64LargeFile
  • testZip64LargeFile - test.test_zipimport.ZStdCompressedZipImportTestCase.testZip64LargeFile

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (test.test_zipimport.ZStdCompressedZipImportTestCase.testTraceback) ... ok


Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows10.pgo\build\Lib\test\test_zipimport.py", line 1072, in testZip64LargeFile
    with open(TEMP_ZIP, "wb") as f:
         ~~~~^^^^^^^^^^^^^^^^
OSError: [Errno 28] No space left on device


Traceback (test.test_zipimport.UncompressedZipImportTestCase.testTraceback) ... ok


Traceback (test.test_zipimport.DeflateCompressedZipImportTestCase.testTraceback) ... ok


Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows10.pgo\build\Lib\test\test_zipimport.py", line 1009, in testZip64LargeFile
    with open(os_helper.TESTFN, "wb") as f:
         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 28] No space left on device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants