Skip to content

google_photos: the -m launch froze on Windows CPython - #141

Merged
bdbarnett merged 1 commit into
mainfrom
gphotos-m-freeze
Sep 23, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
gphotos-m-freeze

Conversation

@bdbarnett

Copy link
Copy Markdown
Collaborator

Launched as python -m examples.google_photos on 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 with time.sleep(0.05). On Windows, multimer's timer fires only while that thread is in an alertable wait (SleepEx), so time.sleep starved it. Nothing ticked and the window was never serviced. A faulthandler dump of the real -m path showed the main thread parked at that line. The loop now sleeps with multimer.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.py crashed with a bare StopIteration when run from a git worktree, because it looked for the sibling pydevices/tools one 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_photos exits after about 2 s, on main as well. That's filed separately.

…ows keeps the window alive

gallery_generator: find the sibling pydevices/tools from a git worktree too
@bdbarnett
bdbarnett merged commit 3c52757 into main Sep 23, 2026
4 checks passed
@bdbarnett
bdbarnett deleted the gphotos-m-freeze branch September 23, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant