[Python-bugs-list] [ python-Bugs-516232 ] Windows os.path.isdir bad if drive only
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 11 Feb 2002 14:50:56 -0800
Bugs item #516232, was opened at 2002-02-11 14:50
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=516232&group_id=5470
Category: Extension Modules
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Charles I. Fuller (cifuller)
Assigned to: Nobody/Anonymous (nobody)
Summary: Windows os.path.isdir bad if drive only
Initial Comment:
It seems that most os functions recognize the Windows
drive letter without a directory as the current
directory on the drive, but os.path.isdir still
returns 0. If os.listdir('C:') returns data,
os.path.isdir('C:') should return 1 for consistency.
C:\folder_on_C>python
Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for
more information.
>>> import os
>>> os.system('dir C:')
Volume in drive C has no label.
Volume Serial Number is E4C9-AD16
Directory of C:\folder_on_C
02/11/2002 05:29p <DIR> .
02/11/2002 05:29p <DIR> ..
02/11/2002 05:29p <DIR> subA
02/11/2002 05:29p <DIR> subB
0 File(s) 0 bytes
4 Dir(s) 22,126,567,424 bytes free
0
>>> os.listdir('C:')
['subA', 'subB']
>>> os.path.abspath('C:')
'C:\folder_on_C'
>>> os.path.isdir('C:')
0
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=516232&group_id=5470