[3.12] gh-113877: Fix Tkinter method winfo_pathname() on 64-bit Windows (GH-113900) (GH-113901)

winfo_id() converts the result of "winfo id" command to integer, but
"winfo pathname" command requires an argument to be a hexadecimal number
on Win64.
(cherry picked from commit 1b7e0024a1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-01-10 11:53:27 +01:00 committed by GitHub
parent 159e3db1f7
commit 7530c612d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View file

@ -1181,6 +1181,8 @@ class Misc:
def winfo_pathname(self, id, displayof=0):
"""Return the pathname of the widget given by ID."""
if isinstance(id, int):
id = hex(id)
args = ('winfo', 'pathname') \
+ self._displayof(displayof) + (id,)
return self.tk.call(args)