Message28657
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. |
|
Date |
User |
Action |
Args |
2007-08-23 14:40:16 | admin | link | issue1495754 messages |
2007-08-23 14:40:16 | admin | create | |
|