When extracting zip archives, os.mkdir() could raise [Errno 17] EEXIST
in two places:
1. makedirs() - A directory might already exist between the path_exists
check and the os.mkdir() call, or be created by a prior extraction step.
2. _extract_member() - makedirs() may have already created a directory
when building parent paths for a file entry, and then a separate
directory entry for the same path triggers os.mkdir() again.
Wrap both os.mkdir() calls in try/except OSError to handle this
gracefully.
Co-authored-by: Richard Taylor <RT@MacBookPro.lan>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
install_mpk() would fail with EEXIST if the destination folder already
existed from a previous (possibly partial) install, or if a dangling
symlink occupied the path (e.g. a dev symlink whose target was removed).
Before extracting, now remove the destination if it is:
- A real directory (via shutil.rmtree)
- A regular file (via os.remove)
- A symlink, including broken ones (via os.remove as a fallback)
This enables clean reinstalls, updates, and recovery from failed
installs.
Co-authored-by: Richard Taylor <RT@MacBookPro.lan>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Setup the "Buzzer" and play intro and outro ;) Don't know if "I2S audio" is possible.
Battery "settings": I tested to run ODROID-GO as long as it's possible. The min. raw ADC value on
ODROID-GO i have seen is 210. So update the calculation.
Fix the boot by moving ODROID-GO below `fri3d_2024` because the device will hard crash on
`fail_save_i2c(sda=9, scl=18)` like:
```
MicroPythonOS 0.8.1 running lib/mpos/main.py
matouch_esp32_s3_spi_ips_2_8_with_camera_ov3660 ?
Try to I2C initialized on sda=39 scl=38
OK
Attempt to write a single byte to I2C bus address 0x14...
No device at this address: [Errno 116] ETIMEDOUT
Attempt to write a single byte to I2C bus address 0x5d...
No device at this address: [Errno 116] ETIMEDOUT
waveshare_esp32_s3_touch_lcd_2 ?
Try to I2C initialized on sda=48 scl=47
Failed: invalid pin
m5stack_fire ?
Try to I2C initialized on sda=21 scl=22
OK
Attempt to write a single byte to I2C bus address 0x68...
No device at this address: [Errno 19] ENODEV
fri3d_2024 ?
Try to I2C initialized on sda=9 scl=18
OK
A fatal error occurred. The crash dump printed below may be used to help
determine what caused it. If you are not already running the most recent
version of MicroPython, consider upgrading. New versions often fix bugs.
To learn more about how to debug and/or report this crash visit the wiki
page at: https://github.com/micropython/micropython/wiki/ESP32-debugging
LVGL MicroPython
IDF version : v5.4
Machine : Generic ESP32 module with SPIRAM with ESP32
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x401b04dd PS : 0x00060830 A0 : 0x801b0944 A1 : 0x3ffdb390
A2 : 0x3f80d2b0 A3 : 0x00000054 A4 : 0x3f8105e8 A5 : 0x3f54b240
A6 : 0x00000001 A7 : 0xaaaaae2a A8 : 0x00000019 A9 : 0x3ffdb370
A10 : 0xaaaaae2a A11 : 0x00000063 A12 : 0x3ffc7ccc A13 : 0x00000000
A14 : 0x3f4464f4 A15 : 0x00000001 SAR : 0x00000020 EXCCAUSE: 0x0000001c
EXCVADDR: 0xaaaaae37 LBEG : 0x401d2964 LEND : 0x401d296d LCOUNT : 0x00000000
Backtrace: 0x401b04da:0x3ffdb390 0x401b0941:0x3ffdb3b0 0x40086719:0x3ffdb3d0 0x401a90da:0x3ffdb460
0x401b07ba:0x3ffdb490 0x40085de9:0x3ffdb4b0 0x401a90da:0x3ffdb540 0x401b07ba:0x3ffdb5b0
0x40085de9:0x3ffdb5d0 0x401a90da:0x3ffdb660 0x401b07ba:0x3ffdb690 0x401b083a:0x3ffdb6b0
0x401d35c1:0x3ffdb6f0 0x401d3809:0x3ffdb730 0x401b0919:0x3ffdb830 0x40085b59:0x3ffdb870
0x401a90da:0x3ffdb900 0x401b07ba:0x3ffdb970 0x401b07e2:0x3ffdb990 0x401e8d02:0x3ffdb9b0
0x401e90c9:0x3ffdba40 0x401c5b2d:0x3ffdba70
```