This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dvarrazzo
Recipients
Date 2005-04-30.23:13:21
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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
History
Date User Action Args
2007-08-23 14:31:26adminlinkissue1193180 messages
2007-08-23 14:31:26admincreate