Bugs item #1495754, was opened at 2006-05-26 21:28 Message generated for change (Comment added) made by gbrandl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1495754&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: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Kenneth J. Pronovici (pronovic) Assigned to: Nobody/Anonymous (nobody) Summary: os.listdir(): inconsistent behavior with trailing spaces Initial Comment: I've noticed some inconsistent behavior around os.listdir() and paths that contain trailing spaces on the Windows platform. Take this example code: import os import tempfile tmpdir = tempfile.mkdtemp() newdir = os.path.join(tmpdir, " collect dir ") os.mkdir(newdir) print os.path.exists(newdir) print os.listdir(newdir) If I run this code on Windows 2000 Pro using Python 2.4.2, I get this: True [Errno 3] The system cannot find the path specified: 'c:\\docume~1\\a0clu0~1.bcb\\locals~1 \\temp\\tmpfd7j3t\\ collect dir /*.*' It seems to me that if os.path.exists() tells me that a file or directory exists, that os.listdir() should be able to operate on it. ---------------------------------------------------------------------- >Comment By: Georg Brandl (gbrandl) Date: 2006-05-29 20:59 Message: Logged In: YES user_id=849994 Since Python only calls the underlying Win32 function FindFirstFile, I think there can nothing be done since that function seems to be buggy in this respect. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1495754&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com