Why exception from os.path.exists()?
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Sun Jun 10 19:52:45 EDT 2018
On Mon, 11 Jun 2018 06:10:26 +1000, Chris Angelico wrote:
> Can you try creating "spam:ham" and "spam/ham"? If they're both legal,
> I'd like to see what their file names are represented as.
The Finder could very easily be substituting another character, like
Konqueror (the KDE 3 file manager) does. In Konqueror, you can create a
file named "spam/ham" and it quietly substitutes "spam%2fham" instead.
But Konqueror's GUI treats it completely transparently: it is displayed
as a slash, and if you copy the file name from the GUI you get a slash.
I seem to recall Gnome doing something similar, except it quietly
substitutes U+2044 FRACTION SLASH or U+2215 DIVISION SLASH instead.
To really be sure what is going on, you would have to bypass the Finder
and any shell and write the file name using the OS X low-level API.
Or create the file using a classic Mac (system 8 or older), where slashes
definitely are not treated as special. Not the Mac OS classic emulation
layer.
Hmmm... you know I might just be able to do that. Write a file to a
floppy, then mount it under Linux. If I had a Linux computer with a
floppy disk drive.
(The march of technology is sometimes a nuisance.)
By the way, for some reason I don't seem to have received Bev's post.
--
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson
More information about the Python-list
mailing list