[issue45681] tkinter breaks on high resolution screen after ctypes SetProcessDPIAware()
New submission from Gabe : In the following code: ```py import tkinter as tk from tkinter import ttk import ctypes ctypes.windll.user32.SetProcessDPIAware() w = tk.Tk() ttk.Checkbutton(w, text = "Checkbox").grid() w.mainloop() ``` The checkbox begins as normal size, but after hovering over it, it becomes small. See attached gif. The issue does not occur without the SetProcessDPIAware call. I am running Windows 11, and my screen resolution is 2560x1440. My Settings>System>Display>Custom Scaling is set to 150%. I believe that this is relevant because SetProcessDPIAware() directly affects the dpi awareness (aka 'custom scaling') of the program, according to Microsoft documentation. -- components: Tkinter files: KwUqCTWl58.gif messages: 405401 nosy: GabeMillikan priority: normal severity: normal status: open title: tkinter breaks on high resolution screen after ctypes SetProcessDPIAware() type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50413/KwUqCTWl58.gif ___ Python tracker <https://bugs.python.org/issue45681> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45681] tkinter breaks on high resolution screen after ctypes SetProcessDPIAware()
Gabe added the comment: The exact same effect happens with SetProcessDPIAware(1). The IDLE checkboxes are in fact affected; they're tiny. I discovered that I was able to prevent the issue by using `ctypes.windll.shcore.SetProcessDpiAwareness(0)`. This prevents the issue only if it is called prior to the SetProcessDPIAware call. This code does not have any issues (everything is correctly scaled) ``` import tkinter as tk from tkinter import ttk import ctypes ctypes.windll.shcore.SetProcessDpiAwareness(0) ctypes.windll.user32.SetProcessDPIAware() w = tk.Tk() ttk.Checkbutton(w, text = "Checkbox").grid() w.mainloop() ``` If the SetProcessDpiAwareness call comes after the SetProcessDPIAware call, then the error persists. I believe that this is because Windows only listens to the first DPI configuration call, so it ignores subsequent calls. I was unable to find documentation to support this though. -- ___ Python tracker <https://bugs.python.org/issue45681> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45681] tkinter breaks on high resolution screen after ctypes SetProcessDPIAware()
Gabe added the comment: I should add - the reason why this is an issue is because pyautogui calls this function, and I would like to use pyautogui in my tkinter app, but I currently cannot without sacrificing my checkbuttons. (Well, pyautogui uses pyscreeze for screenshots and pyscreeze calls it: https://github.com/asweigart/pyscreeze/blob/master/pyscreeze/__init__.py#L69) -- ___ Python tracker <https://bugs.python.org/issue45681> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45616] Python Launcher Matches 3.10 instead of 3.1
New submission from Gabe R. : I have both Python 3.1-64 and 3.10-64 installed on the same Windows machine. If I attempt to launch Python 3.1 using the command `py -3.1-64`, the launcher incorrectly starts Python 3.10. -- components: Windows messages: 405054 nosy: Marsfan, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python Launcher Matches 3.10 instead of 3.1 type: behavior versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue45616> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38851] UDPLITE tests fail on android
Gabe Appleton added the comment: Also, isn't this just a permissions error? I wouldn't think that would indicate a failure of the feature, but instead one of the testing environment. On December 10, 2019 7:47:10 AM UTC, Xavier de Gaye wrote: > >Xavier de Gaye added the comment: > >Not interested anymore in android stuff. > >-- > >___ >Python tracker ><https://bugs.python.org/issue38851> >___ -- ___ Python tracker <https://bugs.python.org/issue38851> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37345] Add formal support for UDPLITE protococl
New submission from Gabe Appleton : At the moment you can definitely use UDPLITE sockets on Linux systems, but it would be good if this support were formalized such that you can detect support at runtime easily. At the moment, to make and use a UDPLITE socket requires something like the following code: >>> import socket >>> a = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 136) >>> b = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 136) >>> a.bind(('localhost', 4)) >>> b.sendto(b'test'*256, ('localhost', 4)) >>> b.setsockopt(136, 10, 16) >>> b.sendto(b'test'*256, ('localhost', 4)) >>> b.setsockopt(136, 10, 32) >>> b.sendto(b'test'*256, ('localhost', 4)) >>> b.setsockopt(136, 10, 64) >>> b.sendto(b'test'*256, ('localhost', 4)) If you look at this through Wireshark, you can see that the packets are different in that the checksums and checksum coverages change. With the pull request that I am submitting momentarily, you could do the following code instead: >>> import socket >>> a = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE) >>> b = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE) >>> a.bind(('localhost', 4)) >>> b.sendto(b'test'*256, ('localhost', 4)) >>> b.set_send_checksum_coverage(16) >>> b.sendto(b'test'*256, ('localhost', 4)) >>> b.set_send_checksum_coverage(32) >>> b.sendto(b'test'*256, ('localhost', 4)) >>> b.set_send_checksum_coverage(64) >>> b.sendto(b'test'*256, ('localhost', 4)) One can also detect support for UDPLITE just by checking >>> hasattr(socket, 'IPPROTO_UDPLITE') -- components: Library (Lib) messages: 346103 nosy: gappleto97 priority: normal severity: normal status: open title: Add formal support for UDPLITE protococl type: enhancement versions: Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue37345> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37345] Add formal support for UDPLITE protococl
Change by Gabe Appleton : -- keywords: +patch pull_requests: +14088 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14258 ___ Python tracker <https://bugs.python.org/issue37345> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37345] Add formal support for UDPLITE protococl
Gabe Appleton added the comment: Its true that this doesnt exist at the C level, however I worry that having it purely through getsockopt() and setsockopt() would make things more confusing, so I added it as a helper function. I can remove it in lieu of documentation if that would block merging, though I dont think that is the right move here. On June 20, 2019 10:54:58 AM UTC, Andrew Svetlov wrote: > >Andrew Svetlov added the comment: > >Adding new constants like socket.IPPROTO_UDPLITE is fine. >The question is: why we need a new function? >There is no set_send_checksum_coverage() on C level IIRC > >-- >nosy: +asvetlov > >___ >Python tracker ><https://bugs.python.org/issue37345> >___ -- ___ Python tracker <https://bugs.python.org/issue37345> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37345] Add formal support for UDPLITE protococl
Gabe Appleton added the comment: I just want to be explicit so I don't mess up on protocol, since I am new to this project. Does that mean that you want me to remove the helper function and put documentation in about that sockopt, or that an exception could be made in this case? -- ___ Python tracker <https://bugs.python.org/issue37345> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37345] Add formal support for UDPLITE protococl
Gabe Appleton added the comment: Okay, I removed the helper functions and added some additional documentation. Does that look okay now? -- versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue37345> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37345] Add formal support for UDPLITE protocol
Gabe Appleton added the comment: I didn't realize that when I submitted this the first time, but I corrected that in the documentation when someone else removed it from the tags. If I re-added it it was by mistake. I notice that my browser had that auto-highlighted. Should be fixed now. -- ___ Python tracker <https://bugs.python.org/issue37345> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string
New submission from Gabe Appleton : Currently it has a __repr__() which returns `Fraction(x, y)`, and a __str__() which returns `x/y`. I have a ready pull request to change this to a scheme where both return unicode fractions. -- components: Library (Lib) messages: 316026 nosy: gappleto97 priority: normal severity: normal status: open title: Change the fractions.Fraction class to convert to a unicode fraction string type: enhancement versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue33402> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string
Change by Gabe Appleton : -- keywords: +patch pull_requests: +6372 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33402> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string
Gabe Appleton added the comment: Would it be workable if I instead just changed the __str__() method? I'm willing to go either way, but I feel like it's a bit nicer to have it output a nice fraction that way. -- ___ Python tracker <https://bugs.python.org/issue33402> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string
Change by Gabe Appleton : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue33402> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com