Message25196
Hi,
when there are invalid chars in a filename, os.path.exists
() behaves oddly, returning True.
The bug appears on win32 system, not on unix ones.
Thus is probably related to some weird windows api call
and doesn't maybe worth fixing.
Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more
information.
>>> import os
>>> f = file("a_b", "w")
>>> f.close()
>>> os.listdir(".")
['a_b']
>>> os.path.exists("a<b")
True
>>> os.path.exists("a>b")
True
And, even more strange...
>>> os.path.exists("a<")
True
>>> os.path.exists("a>")
False
Better answers would have been:
* False
* raise ValueError
|
|
Date |
User |
Action |
Args |
2007-08-23 14:31:26 | admin | link | issue1193180 messages |
2007-08-23 14:31:26 | admin | create | |
|