Skip to content

GH-100807: 🔥 Drop unused BADF def from stdlib socket #100807

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

Closed

Conversation

webknjaz
Copy link
Contributor

@webknjaz webknjaz commented Jan 6, 2023

This variable is unused and is leftover from the decade-old cleanup/refactoring. It was initially hardcoded in Python 2.2 via e5e50591. Then, almost two years later, in Python 2.3, it was replaced with this constant via 70d566be. Four years after that, Python 2.7 had a substantial refactoring of the socket module which removed the use of this constant in
7d0a8264 and during almost 16 following years it remained unused.

This patch removes it as it's not really necessary to keep it  1�7 it shouldn't be exposed via socket.EBADF in addition to errno.EBADF.

@webknjaz webknjaz changed the title 🔥 Drop unused BADF def from stdlib socket GH-100807: 🔥 Drop unused BADF def from stdlib socket Jan 6, 2023
@webknjaz
Copy link
Contributor Author

webknjaz commented Jan 6, 2023

(it doesn't seem like this needs a news fragment)

This variable is unused and is leftover from the decade-old
cleanup/refactoring. It was initially hardcoded in Python 2.2 via
python@e5e50591. Then, almost two
years later, in Python 2.3, it was replaced with this constant via
python@70d566be. Four years after
that, Python 2.7 had a substantial refactoring of the `socket` module
which removed the use of this constant in
python@7d0a8264 and during almost 16
following years it remained unused.

This patch removes it as it's not really necessary to keep it  1�7 it
shouldn't be exposed via `socket.EBADF` in addition to `errno.EBADF`.
@webknjaz webknjaz force-pushed the maintenance/socket-module-errno.EBADF branch from e59fb27 to c39f6c2 Compare January 6, 2023 19:19
@hauntsaninja
Copy link
Contributor

hauntsaninja commented Jan 6, 2023

Thanks for the PR and trying to help keep things clean. This would definitely need a news fragment (and an issue, since news fragments are keyed by issue)

Here's a couple instances of socket.EBADF being used in the wild: https://grep.app/search?q=socket.EBADF&filter[lang][0]=Python . I think it might be hard to make the argument that this is not a clearly private API, in which case the removal would need to go through a deprecation period (as per PEP 387)

@hauntsaninja hauntsaninja added the pending The issue will be closed if no feedback is provided label Jan 29, 2023
@arhadthedev
Copy link
Member

I agree with @hauntsaninja that this requires a deprecation first because the constant is used even being private. Thus closing this PR after five weeks of pending [removal] status.

@arhadthedev arhadthedev closed this Mar 4, 2023
@AA-Turner AA-Turner removed the pending The issue will be closed if no feedback is provided label Apr 6, 2025
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.

5 participants