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".
I am running Python 3.10.12 on a Linux Mint 21 Vanessa.
Any help is greatly apprecaited.
Cheers!
Glenn
From the command line the file's existence can be verified using "ls".
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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 >>> |
Any help is greatly apprecaited.
Cheers!
Glenn