TinyCircuits-Thumby-Code-Editor icon indicating copy to clipboard operation
TinyCircuits-Thumby-Code-Editor copied to clipboard

Changing the current working directory causes errors in the menu/API

Open transistortester opened this issue 3 years ago • 1 comments

To reproduce, make a game containing the following: from os import chdir chdir("/Games")

After running, the system freezes when it tries to return to the menu. Trying to import thumby after changing the directory also causes a crash, though not a full hang.

This appears to be caused by parts of the menu/API using relative paths when loading resources from file. In my poking around it looks like adding leading slashes to filenames fixes it. Setting the CWD/rebooting after a game finishes might not be a bad idea too, though I'm not sure the best approach.

transistortester avatar Mar 17 '22 17:03 transistortester

Hi! main.py now resets the Thumby after a game exits so the chdir issue breaking the menu might now be fixed.

fuglaro avatar Aug 27 '22 10:08 fuglaro

Yup, this looks to be fixed.

ghost avatar Mar 15 '23 15:03 ghost