Bugs item #1193180, was opened at 2005-05-01 01:13 Message generated for change (Comment added) made by zgoda You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1193180&group_id=5470
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: 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