google_photos: the -m launch froze on Windows CPython - #141
Merged
Merged
Conversation
…ows keeps the window alive gallery_generator: find the sibling pydevices/tools from a git worktree too
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Launched as
python -m examples.google_photoson Windows CPython, the window stayed white and Windows marked it "Not Responding". This happened in both simulator and real mode; launched as a script, it was fine.The cause is the launcher's keep-alive loop for
-m, which held the main thread withtime.sleep(0.05). On Windows, multimer's timer fires only while that thread is in an alertable wait (SleepEx), sotime.sleepstarved it. Nothing ticked and the window was never serviced. A faulthandler dump of the real-mpath showed the main thread parked at that line. The loop now sleeps withmultimer.auto.sleep_ms, the same call appdev's own loop uses.Checked with Windows' Responding flag after 15 s. Before the fix: simulator False, real False. After: simulator True, real True. Under
-m, Linux micropython, circuitpython and CPython still stay up, and the 27 engine tests pass.Also here:
scripts/gallery_generator.pycrashed with a bare StopIteration when run from a git worktree, because it looked for the siblingpydevices/toolsone level up only. That broke the pre-commit hook for any commit touching Python from.worktrees/. It now walks up the parent directories, and says what's missing if nothing is found.Not fixed here:
micropython.exe -m examples.google_photosexits after about 2 s, on main as well. That's filed separately.