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
IDLE: adjust DPI before Tk() for htests. #78156
Comments
bpo-33656 patched PyShell to call SetProcessDpiAwareness on Windows nearly first thing, *at module level*, well before calling tkinter.Tk(). The Microsoft docs warn that making the Windows API call after starting the graphics system may not work as expected. With tk 8.6,8, the result is sharp, but small type -- perhaps 7 points instead of 10. This issue is about avoiding type shrinkage, both when running the htest suite as a whole and when running the test for an individual file after running the unittests. To do that in any process, pyshell must be imported before Tk() is called. The patch adds the following to htest.py. I will add the same where needed to the top of if __name__ == '__main__': clauses in idlelib modules, before running unittests. |
Because of import caching, subsequent pyshell imports, after the first, do not re-call the Windows API. Apparently, 'root.destroy()' undoes a previous 'root = Tk()', but not a previous pyshell import. Since IDLE unittests always destroy roots, a unittest before an htest does not require anything more to work right. Since part of the purpose of human-viewed tests is to determine that widgets look right, it is important that they look the same for testing |
Both PRs have been merged. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: