Skip to content

Conversation

mdehoon
Copy link
Contributor

@mdehoon mdehoon commented Oct 12, 2025

The macro TCL_WIN_SOCKET used in Modules/_tkinter.c is a Tcl 7.x legacy macro that is no longer defined in Tcl ≥ 8.0.
As Python now requires Tcl 8.5.12, the code path is now unreachable, and can safely be removed.

The macro FHANDLETYPE defined in Modules/_tkinter.c then always evaluates to TCL_UNIX_FD, and can also be removed.

@bedevere-app

This comment was marked as resolved.

@picnixz
Copy link
Member

picnixz commented Oct 12, 2025

Please open an issue and link the Tcl documentation as well; TiA.

@mdehoon
Copy link
Contributor Author

mdehoon commented Oct 12, 2025

See https://www.tcl-lang.org/man/tcl7.6/TclLib/GetFile.3.html for a description of these macros in Tcl 7.6.
The macros TCL_WIN_SOCKET and TCL_UNIX_FD were used in Tcl_GetFile, which was removed in Tcl 8.0.

See generic/tcl.h in the Tcl 7.6 source code for the definition of these two macros:

#define TCL_UNIX_FD	1
#define TCL_WIN_SOCKET	6

These macros are not defined in generic/tcl.h of Tcl 8.0, or mentioned anywhere else in the Tcl 8.0 source code.

@picnixz picnixz changed the title Remove obsolete TCL_WIN_SOCKET macro (from Tcl 7.x) from _tkinter.c gh-140001: Remove obsolete TCL_WIN_SOCKET macro (from Tcl 7.x) from _tkinter.c Oct 12, 2025
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Should not WAIT_FOR_STDIN be removed too?

@mdehoon
Copy link
Contributor Author

mdehoon commented Oct 12, 2025

WAIT_FOR_STDIN is not always defined: it remains undefined if __CYGWIN__ is defined.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM. 👍

@serhiy-storchaka serhiy-storchaka merged commit a00655b into python:main Oct 13, 2025
51 checks passed
@mdehoon mdehoon deleted the remove_tcl_win_socket branch October 13, 2025 11:27
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