Skip to content

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Jan 13, 2026

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

GET_SOCKET() returned a borrowed reference, which was potentially
unsafe. Also, refactor out some common code.
Comment on lines +777 to +778
get_socket(PySSLSocket *obj, PySocketSockObject **out_sock,
const char *filename, int lineno)
Copy link
Member

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__.

Copy link
Member

@picnixz picnixz Jan 19, 2026

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...

Copy link
Member

@picnixz picnixz left a 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.

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.

3 participants