You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two files in two different folders, both on desktop.
If I try using os.path.exists() on both of them, it returns True for one file and False for the other file.
After renaming file that I got False from, I get returned True and when I rename it back, it returns False again.
File name causing the problem is "testni.wav", I assume it's anything starting with "test", but I'm sure you guys will know better. Thank you
In a string literal, '\t' represents a tab character (ordinal 9). Windows filenames cannot contain control characters 1, i.e. ordinals 1-31. For path literals I recommend using forward slashes and normalizing via os.path.normpath, e.g. filepath = os.path.normpath('C:/Users/mavri/Desktop/proba/testni.wav').
FYI, the way exists() is written handles any OSError as False:
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: