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 — gh-126890: Restore stripped `ssl` docstrings by ZeroIntensity · Pull Request #127281 · python/cpython

Conversation

@ZeroIntensity

@ZeroIntensity ZeroIntensity commented Nov 26, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

In GH-124993, I forgot to carry over some of the docstrings to AC. This adds all of them back.

  • Issue: Restore docstrings in ssl #126890

Sorry, something went wrong.

Uh oh!

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

All reactions
ZeroIntensity added 12 commits November 25, 2024 19:33
@ZeroIntensity
Restore docstring for context.
5eee04d
@ZeroIntensity
Restore docstring for owner and session.
f11f7ed
@ZeroIntensity
Restore docstring for num_tickets.
7812935
@ZeroIntensity
Restore docstring for security_level.
a405d15
@ZeroIntensity
Restore docstring for sni_callback.
a309206
@ZeroIntensity
Restore docstring for time.
84dc0ab
@ZeroIntensity
Restore docstring for timeout.
15342e7
@ZeroIntensity
Restore docstring for id.
3907c38
@ZeroIntensity
Restore docstring for ticket_lifetime_hint.
4fa89c1
@ZeroIntensity
Run clinic.
c80c80d
@ZeroIntensity
Restore docstring for has_ticket
e699235
@ZeroIntensity
Run clinic.
0623512
@ZeroIntensity ZeroIntensity added the skip news label Nov 26, 2024
@ZeroIntensity
ZeroIntensity requested review from JelleZijlstra and encukou November 26, 2024 01:20
@bedevere-app bedevere-app Bot mentioned this pull request Nov 26, 2024
Restore docstrings in ssl #126890
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Nov 26, 2024
@encukou

encukou commented Nov 26, 2024

Copy link
Copy Markdown
Member

At a first glance at those warnings, it looks like this might need some changes in clinic :(
Shout if you want me to help.

ZeroIntensity reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@neonene

neonene commented Nov 26, 2024

Copy link
Copy Markdown
Contributor

Please add a docstring for _ssl.MemoryBIO.pending.

I think the warnings are related to the following regression:

3.12 on Windows:

>>> help(_ssl._SSLSocket.context)
Help on getset descriptor _ssl._SSLSocket.context:

context
    _setter_context(ctx)
    This changes the context associated with the SSLSocket. This is typically
    used from within a callback function set by the sni_callback
    on the SSLContext to change the certificate information associated with the
    SSLSocket before the cryptographic exchange handshake messages
>>>

This PR:

>>> help(_ssl._SSLSocket.context)
Help on getset descriptor _ssl._SSLSocket.context:

context

>>>
All reactions

Sorry, something went wrong.

Uh oh!

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

@ZeroIntensity

ZeroIntensity commented Nov 26, 2024

Copy link
Copy Markdown
Member Author

As far as I can tell, the warnings are a clinic bug.

All reactions

Sorry, something went wrong.

Uh oh!

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

ZeroIntensity added 4 commits November 26, 2024 16:06
@ZeroIntensity
Don't redefine docstrings macros in clinic.
f4973d1
@ZeroIntensity
Simplify the preprocessor case.
72c475e
@ZeroIntensity
Regenerate clinic test file.
9ec0ba9
@ZeroIntensity
Restore docstring for pending.
013abed
@ZeroIntensity
ZeroIntensity requested a review from erlend-aasland as a code owner November 26, 2024 21:29
@erlend-aasland

erlend-aasland commented Nov 26, 2024

Copy link
Copy Markdown
Contributor

Can we tear out the Argument Clinic bug fix as a separate PR?

JelleZijlstra and ZeroIntensity reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

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

@ZeroIntensity

ZeroIntensity commented Nov 26, 2024

Copy link
Copy Markdown
Member Author

Yeah, I'll do that. A fair warning: it might take me a little while to get the PR up; I'm currently on a slow connection and GitHub takes forever.

erlend-aasland and encukou reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

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

ZeroIntensity added 3 commits November 29, 2024 11:36
@ZeroIntensity
Revert "Regenerate clinic test file."
375f9d4
This reverts commit 9ec0ba9.
@ZeroIntensity
Fix merge conflicts.
218e724
@ZeroIntensity
Revert the original clinic fix.
d5dafd1
@ZeroIntensity
Rebase against main.
67c91ba
erlend-aasland
erlend-aasland reviewed Nov 30, 2024
View reviewed changes
Comment thread Modules/_ssl.c Resolved

Uh oh!

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

@neonene

neonene commented Dec 1, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Thanks. I confirmed the following 16 PyDoc_STRVAR()s' migration on this PR:

PyDoc_STRVAR(PySSL_set_context_doc, ...)
PyDoc_STRVAR(PySSL_get_server_side_doc, ...)
PyDoc_STRVAR(PySSL_get_server_hostname_doc, ...)
PyDoc_STRVAR(PySSL_get_owner_doc, ...)
PyDoc_STRVAR(PySSL_set_session_doc, ...)
PyDoc_STRVAR(PySSL_get_session_reused_doc, ...)
PyDoc_STRVAR(PySSLContext_num_tickets_doc, ...)
PyDoc_STRVAR(PySSLContext_security_level_doc, ...)
PyDoc_STRVAR(PySSLContext_sni_callback_doc, ...)
PyDoc_STRVAR(PySSL_memory_bio_pending_doc, ...)
PyDoc_STRVAR(PySSL_memory_bio_eof_doc, ...)
PyDoc_STRVAR(PySSLSession_get_time_doc, ...)
PyDoc_STRVAR(PySSLSession_get_timeout_doc, ...)
PyDoc_STRVAR(PySSLSession_get_ticket_lifetime_hint_doc, ...)
PyDoc_STRVAR(PySSLSession_get_session_id_doc, ...)
PyDoc_STRVAR(PySSLSession_get_has_ticket_doc, ...)
Details
>>> help(_ssl._SSLSocket.context)
Help on getset descriptor _ssl._SSLSocket.context:

context
    This changes the context associated with the SSLSocket.

    This is typically used from within a callback function set by the sni_callback
    on the SSLContext to change the certificate information associated with the
    SSLSocket before the cryptographic exchange handshake messages.

>>> help(_ssl._SSLSocket.server_side)
Help on getset descriptor _ssl._SSLSocket.server_side:

server_side
    Whether this is a server-side socket.

>>> help(_ssl._SSLSocket.server_hostname)
Help on getset descriptor _ssl._SSLSocket.server_hostname:

server_hostname
    The currently set server hostname (for SNI).

>>> help(_ssl._SSLSocket.owner)
Help on getset descriptor _ssl._SSLSocket.owner:

owner
    The Python-level owner of this object.

    Passed as "self" in servername callback.

>>> help(_ssl._SSLSocket.session)
Help on getset descriptor _ssl._SSLSocket.session:

session
    The underlying SSLSession object.

>>> help(_ssl._SSLSocket.session_reused)
Help on getset descriptor _ssl._SSLSocket.session_reused:

session_reused
    Was the client session reused during handshake?

>>> help(_ssl._SSLContext.num_tickets)
Help on getset descriptor _ssl._SSLContext.num_tickets:

num_tickets
    Control the number of TLSv1.3 session tickets.

>>> help(_ssl._SSLContext.security_level)
Help on getset descriptor _ssl._SSLContext.security_level:

security_level
    The current security level.

>>> help(_ssl._SSLContext.sni_callback)
Help on getset descriptor _ssl._SSLContext.sni_callback:

sni_callback
    Set a callback that will be called when a server name is provided by the SSL/TLS client in the SNI extension.

    If the argument is None then the callback is disabled. The method is called
    with the SSLSocket, the server name as a string, and the SSLContext object.

    See RFC 6066 for details of the SNI extension.

>>> help(_ssl.MemoryBIO.pending)
Help on getset descriptor _ssl.MemoryBIO.pending:

pending
    The number of bytes pending in the memory BIO.

>>> help(_ssl.MemoryBIO.eof)
Help on getset descriptor _ssl.MemoryBIO.eof:

eof
    Whether the memory BIO is at EOF.

>>> help(_ssl.SSLSession.time)
Help on getset descriptor _ssl.SSLSession.time:

time
    Session creation time (seconds since epoch).

>>> help(_ssl.SSLSession.timeout)
Help on getset descriptor _ssl.SSLSession.timeout:

timeout
    Session timeout (delta in seconds).

>>> help(_ssl.SSLSession.ticket_lifetime_hint)
Help on getset descriptor _ssl.SSLSession.ticket_lifetime_hint:

ticket_lifetime_hint
    Ticket life time hint.

>>> help(_ssl.SSLSession.id)
Help on getset descriptor _ssl.SSLSession.id:

id
    Session ID.

>>> help(_ssl.SSLSession.has_ticket)
Help on getset descriptor _ssl.SSLSession.has_ticket:

has_ticket
    Does the session contain a ticket?

>>>
ZeroIntensity reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@encukou
encukou merged commit c112de1 into python:main Dec 2, 2024
@bedevere-app bedevere-app Bot removed the awaiting review label Dec 2, 2024
@encukou

encukou commented Dec 2, 2024

Copy link
Copy Markdown
Member

Thank you for following up!

ZeroIntensity reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

@ZeroIntensity
ZeroIntensity deleted the restore-stripped-ssl-docstrings branch December 2, 2024 13:12
@ZeroIntensity

ZeroIntensity commented Dec 2, 2024

Copy link
Copy Markdown
Member Author

@encukou, the 3.13 backport (GH-125780) just got merged for the original thread safety fix, so we have to backport this as well.

All reactions

Sorry, something went wrong.

Uh oh!

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

@ZeroIntensity ZeroIntensity added the needs backport to 3.13 only security fixes label Dec 2, 2024
@miss-islington-app

miss-islington-app Bot commented Dec 2, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app

miss-islington-app Bot commented Dec 2, 2024

Copy link
Copy Markdown

Sorry, @ZeroIntensity and @encukou, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker c112de1da2d18e3b5c2ea30b0e409f18e574efd8 3.13
All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app miss-islington-app Bot assigned encukou Dec 2, 2024
@ZeroIntensity

ZeroIntensity commented Dec 2, 2024

Copy link
Copy Markdown
Member Author

I figured that might happen :(. I'll look into it.

All reactions

Sorry, something went wrong.

Uh oh!

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

ZeroIntensity added a commit to ZeroIntensity/cpython that referenced this pull request Dec 2, 2024
@ZeroIntensity
[3.13] pythongh-126890: Restore stripped ssl docstrings (pythonGH-1…
f6584de
…27281)

(cherry picked from commit c112de1)

Co-authored-by: Peter Bierma <[email protected]>
@bedevere-app

bedevere-app Bot commented Dec 2, 2024

Copy link
Copy Markdown

GH-127513 is a backport of this pull request to the 3.13 branch.

encukou reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Dec 2, 2024
Yhg1s pushed a commit that referenced this pull request Dec 2, 2024
@ZeroIntensity
[3.13] gh-126890: Restore stripped ssl docstrings (GH-127281) (#127513
cab2ef5
)

(cherry picked from commit c112de1)

Co-authored-by: Peter Bierma <[email protected]>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
@ZeroIntensity @srinivasreddy
pythongh-126890: Restore stripped ssl docstrings (pythonGH-127281)
4a694af
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
@ZeroIntensity @ebonnal
pythongh-126890: Restore stripped ssl docstrings (pythonGH-127281)
db48344
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland erlend-aasland left review comments
@encukou encukou Awaiting requested review from encukou
@JelleZijlstra JelleZijlstra Awaiting requested review from JelleZijlstra

Uh oh!

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

Assignees

@encukou encukou

Labels

skip news

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.

4 participants

@ZeroIntensity @encukou @neonene @erlend-aasland
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.