Skip to content

bpo-46434: Handle missing docstring in pdb help #30705

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

Merged
merged 5 commits into from
Jan 21, 2022

Conversation

sparrowt
Copy link
Contributor

@sparrowt sparrowt commented Jan 19, 2022

Proposed fix for https://bugs.python.org/issue46434

When using embeddable windows distribution of python, __doc__ strings are missing so help CMD in pdb explodes without this patch.

This is my first contribution, apologies I wasn't sure whether I should update Docs, Misc/ACKS or Misc/NEWS.d

https://bugs.python.org/issue46434

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@sparrowt

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@zooba
Copy link
Member

zooba commented Jan 19, 2022

If you click the "Details" link next to the failed check, it will help you add a NEWS entry. If you'd like to add yourself to ACKS, feel free to do it as part of this PR. I don't think we need a docs update for this.

@zooba zooba added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Jan 19, 2022
Comment on lines 1 to 2
pdb help now gracefully handles any case where __doc__ is missing, for
example when run from a windows embeddable package
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pdb help now gracefully handles any case where __doc__ is missing, for
example when run from a windows embeddable package
:mod:`pdb` now gracefully handles any case where :attr:`__doc__` is missing, for
example when run with pregenerated optimized ``.pyc`` files.

FYI, I found the special references by searching the Doc folder for other examples. These will turn them into links in the final doc.

Copy link
Contributor Author

@sparrowt sparrowt Jan 20, 2022

Choose a reason for hiding this comment

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

Ah cool thank you, good to know! Maybe it's not important but should we retain a reference to help in there given it's the help command within pdb which has been fixed? Otherwise "any case" without the scope of 'help' feels like a bit of an overstatement (!)

Copy link
Contributor Author

@sparrowt sparrowt Jan 20, 2022

Choose a reason for hiding this comment

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

Hopefully ba2053d is ok

@sparrowt sparrowt requested a review from zooba January 21, 2022 13:25
@zooba zooba merged commit 60705cf into python:main Jan 21, 2022
@miss-islington
Copy link
Contributor

Thanks @sparrowt for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @sparrowt and @zooba, I had trouble checking out the 3.10 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 60705cff70576482fea31dcafbf8a37cbb751ea5 3.10

@zooba zooba removed the needs backport to 3.10 only security fixes label Jan 21, 2022
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Jan 21, 2022
@bedevere-bot
Copy link

GH-30754 is a backport of this pull request to the 3.9 branch.

@zooba zooba added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Jan 21, 2022
@miss-islington
Copy link
Contributor

Thanks @sparrowt for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @sparrowt for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 21, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 21, 2022
@bedevere-bot
Copy link

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

Hi! The buildbot ARM64 macOS 3.x has failed when building commit 60705cf.

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/all/#builders/725/builds/789) and take a look at the build logs.
  4. Check if the failure is related to this commit (60705cf) 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/all/#builders/725/builds/789

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

== Tests result: ENV CHANGED ==

411 tests OK.

10 slowest tests:

  • test_concurrent_futures: 3 min 43 sec
  • test_multiprocessing_spawn: 2 min 31 sec
  • test_multiprocessing_forkserver: 1 min 46 sec
  • test_unparse: 1 min 28 sec
  • test_asyncio: 1 min 20 sec
  • test_tokenize: 1 min 14 sec
  • test_nntplib: 1 min 1 sec
  • test_lib2to3: 52.5 sec
  • test_capi: 50.2 sec
  • test_logging: 49.5 sec

1 test altered the execution environment:
test_ftplib

17 tests skipped:
test_dbm_gnu test_devpoll test_epoll test_gdb test_ioctl
test_msilib test_multiprocessing_fork test_ossaudiodev test_spwd
test_startfile test_tix test_tk test_ttk_guionly test_winconsoleio
test_winreg test_winsound test_zipfile64

Total duration: 8 min 41 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncore.py", line 90, in read
    obj.handle_read_event()
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ftplib.py", line 384, in handle_read_event
    self._do_ssl_handshake()
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ftplib.py", line 345, in _do_ssl_handshake
    self.socket.do_handshake()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/ssl.py", line 1345, in do_handshake
    self._sslobj.do_handshake()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:998)


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/multiprocessing/resource_tracker.py", line 209, in main
    cache[rtype].remove(name)
    ^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '/psm_604fa827'


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/multiprocessing/resource_tracker.py", line 209, in main
    cache[rtype].remove(name)
    ^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '/psm_6027030c'


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/threading.py", line 1031, in _bootstrap_inner
    self.run()
    ^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ftplib.py", line 298, in run
    asyncore.loop(timeout=0.1, count=1)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncore.py", line 214, in loop
    poll_fun(timeout, map)
    ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncore.py", line 157, in poll
    read(obj)
    ^^^^^^^^^
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncore.py", line 94, in read
    obj.handle_error()
    ^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ftplib.py", line 421, in handle_error
    raise Exception
    ^^^^^^^^^^^^^^^
Exception
k

miss-islington added a commit that referenced this pull request Jan 21, 2022
(cherry picked from commit 60705cf)

Co-authored-by: Tom Sparrow <[email protected]>
@zooba zooba added needs backport to 3.10 only security fixes and removed needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Jan 21, 2022
@miss-islington
Copy link
Contributor

Thanks @sparrowt for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@zooba zooba added needs backport to 3.10 only security fixes and removed needs backport to 3.10 only security fixes labels Jan 21, 2022
@miss-islington
Copy link
Contributor

Thanks @sparrowt for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-30759 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Jan 21, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 21, 2022
miss-islington added a commit that referenced this pull request Jan 21, 2022
(cherry picked from commit 60705cf)

Co-authored-by: Tom Sparrow <[email protected]>
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants