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-143756: Avoid borrowed reference in SSL code by colesbury · Pull Request #143816 · python/cpython

Conversation

@colesbury

@colesbury colesbury commented Jan 13, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

GET_SOCKET() returned a borrowed reference, which was potentially unsafe with free threading. Also, refactor out some common code.

  • Issue: Data races in OpenSSL bindings #143756

Sorry, something went wrong.

Uh oh!

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

All reactions
@colesbury
pythongh-143756: Avoid borrowed reference in SSL code
28e9ed4
GET_SOCKET() returned a borrowed reference, which was potentially
unsafe. Also, refactor out some common code.
@colesbury
colesbury requested a review from ZeroIntensity January 13, 2026 20:34
@colesbury
colesbury requested review from gpshead and picnixz as code owners January 13, 2026 20:34
@colesbury colesbury added the skip news label Jan 13, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jan 13, 2026
Data races in OpenSSL bindings #143756
Open
@bedevere-app bedevere-app Bot added the awaiting core review label Jan 13, 2026
@colesbury colesbury added the topic-SSL label Jan 13, 2026
ZeroIntensity
ZeroIntensity approved these changes Jan 13, 2026
View reviewed changes
Comment thread Modules/_ssl.c
Comment on lines +777 to +778
get_socket(PySSLSocket *obj, PySocketSockObject **out_sock,
const char *filename, int lineno)

@ZeroIntensity ZeroIntensity Jan 13, 2026

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.

It would significantly simplify usage if this were a macro that automatically passed __FILE__ and __LINE__.

Sorry, something went wrong.

Uh oh!

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

All reactions

@picnixz picnixz Jan 19, 2026 •
edited
Loading

Uh oh!

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

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.

If we have a macro, AFAIR, it expands to something that will not be visually helpful (on the IDE the reported line would mismatch, but I may be wrong here).

So we also could well remove all file/lineno reports and add a description of what we were doing instead, or the involved function.

The file/lineno is only for us to know what happened when someone reports a bug. But the file is likely to always be the same...

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jan 13, 2026
picnixz
picnixz reviewed Jan 19, 2026
View reviewed changes
Comment thread Modules/_ssl.c Resolved

Uh oh!

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

picnixz
picnixz approved these changes Jan 20, 2026
View reviewed changes

@picnixz picnixz left a comment •
edited
Loading

Uh oh!

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

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.

The design choices of this module are hard to comply with but well... better to have small changes for now.

Sorry, something went wrong.

Uh oh!

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

All reactions
@colesbury
colesbury merged commit ee4e14a into python:main Jan 22, 2026
55 checks passed

Uh oh!

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

@colesbury
colesbury deleted the gh-143756-weakref branch January 22, 2026 19:02
@bedevere-app bedevere-app Bot removed the awaiting merge label Jan 22, 2026
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
@colesbury @thunder-coding
pythongh-143756: Avoid borrowed reference in SSL code (pythongh-143816)
26ecab6
GET_SOCKET() returned a borrowed reference, which was potentially
unsafe. Also, refactor out some common code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz approved these changes
@ZeroIntensity ZeroIntensity ZeroIntensity approved these changes
@gpshead gpshead Awaiting requested review from gpshead gpshead is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

skip news topic-SSL

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.

3 participants

@colesbury @picnixz @ZeroIntensity
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.