Bugs item #1193180, was opened at 2005-05-01 01:13
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1193180&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Windows
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Daniele Varrazzo (dvarrazzo)
Assigned to: Nobody/Anonymous (nobody)
Summary: Strange os.path.exists() results with invalid chars
Initial Comment:
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
----------------------------------------------------------------------
>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-05-31 11:56
Message:
Logged In: YES
user_id=1188172
I think Python just uses the Win32 system call, so there
isn't much Python can do about it.
----------------------------------------------------------------------
Comment By: engelbert gruber (grubert)
Date: 2005-05-23 08:52
Message:
Logged In: YES
user_id=147070
testing with perl: print -e "a<"; returns True/1 too
----------------------------------------------------------------------
Comment By: Jarek Zgoda (zgoda)
Date: 2005-05-02 14:04
Message:
Logged In: YES
user_id=92222
Same for Python 2.3.5.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1193180&group_id=5470
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com