Aug-26-2024, 08:06 PM
(This post was last modified: Aug-26-2024, 08:06 PM by glenndrives.)
When using os.path.exists to check a path that contains accented characters os.path.exists fails.
From the command line the file's existence can be verified using "ls".
Any help is greatly apprecaited.
Cheers!
Glenn
From the command line the file's existence can be verified using "ls".
import os >>> os.path.exists("/var/altmusic/Snõõper/Super Snõõper/10 STRETCHING 2_TRAILS_SPL_TMM_M1_D_16_44.1.mp3") False >>> os.path.exists('/var/altmusic/Snõõper/Super Snõõper/10 STRETCHING 2_TRAILS_SPL_TMM_M1_D_16_44.1.mp3') False >>> os.path.exists('/var/altmusic/Snõõper/Super\ Snõõper/10\ \ STRETCHING\ 2_TRAILS_SPL_TMM_M1_D_16_44.1.mp3') False >>> os.path.exists("/var/altmusic/Snõõper/Super\ Snõõper/10\ \ STRETCHING\ 2_TRAILS_SPL_TMM_M1_D_16_44.1.mp3") False >>> os.path.exists(/var/altmusic/Snõõper/Super\ Snõõper/10\ \ STRETCHING\ 2_TRAILS_SPL_TMM_M1_D_16_44.1.mp3) File "<stdin>", line 1 os.path.exists(/var/altmusic/Snõõper/Super\ Snõõper/10\ \ STRETCHING\ 2_TRAILS_SPL_TMM_M1_D_16_44.1.mp3) ^ SyntaxError: invalid syntax >>>I am running Python 3.10.12 on a Linux Mint 21 Vanessa.
Any help is greatly apprecaited.
Cheers!
Glenn