[Python-bugs-list] [ python-Bugs-434479 ] os.listdir loses on linux w/NTFS vols

noreply@sourceforge.net noreply@sourceforge.net
Tue, 17 Jul 2001 04:23:41 -0700


Bugs item #434479, was opened at 2001-06-19 07:48
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=434479&group_id=5470

Category: Python Library
Group: Irreproducible
Status: Closed
Resolution: Works For Me
Priority: 5
Submitted By: jeremy bornstein (ukekuma)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: os.listdir loses on linux w/NTFS vols

Initial Comment:
os.listdir() on a directory which is on an NTFS volume
omits one entry from the directory listing.

Example:

planet {188}: grep ntfs /etc/fstab
/dev/hda1               /lose                   ntfs   
uid=500,gid=500,umask=555	1 2
planet {189}: ls /lose
Documents and Settings/  My Music/  Program Files/ 
PUTTY.RND  $Secure  unzipped/  WINNT/
planet {190}: python2.1
Python 2.1 (#1, Jun 19 2001, 00:32:28) 
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on
linux2
Type "copyright", "credits" or "license" for more
information.
>>> import os
>>> os.listdir('/lose')
['$Secure', 'Documents and Settings', 'My Music',
'Program Files', 'PUTTY.RND', 'unzipped']
>>> 
planet {191}:

(In the example, note that the directory 'WINNT' is not
returned by os.listdir.)

I have verified this bug with/1.5.2, 1.6.1, and 2.1 on
Linux (RH7.1) only.  I have only tested it on this one
NTFS volume and this one computer.



----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2001-07-17 04:23

Message:
Logged In: YES 
user_id=21627

I have a similar report that tab-completion in the shell
(bash?) will sometimes refuse to return the last directory
entry, on an NTFS.

To find out what ls is doing, I recommend to use strace. I
currently don't even have a system with Linux and NT
installed simultaneously, so I cannot help much.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-07-11 18:14

Message:
Logged In: YES 
user_id=3066

What's really strange is that Python & ls are returning
different results.  Python is just using
opendir/readdir/closedir for Linux; I've not read the ls
sources to know what that's doing (but it should be
considered buggy if that's not what it's doing!).

Now, if we could get Martin interested in working on the
Linux NTFS driver again...

----------------------------------------------------------------------

Comment By: jeremy bornstein (ukekuma)
Date: 2001-07-11 17:49

Message:
Logged In: YES 
user_id=248973

I noticed that it was always the *final* directory entry
which was not displayed. I don't think the problem has
anything to do with the WINNT directory specifically, other
than it the fact that it was the last one.


----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-07-11 11:33

Message:
Logged In: YES 
user_id=3066

I was not able to reproduce this on my system (Mandrake 7.2,
Linux 2.2.17).  This may be a difference in configuration: I
have an NTFS partition, but it's not the one that contains
my \WINNT directory.  If \WINNT is special in some way, I
can't reproduce that.

See also Martin's comment; he's likely to know exactly what
he's talking about.  I'm going to close this as
irreproducible, acknowledging that it might really be a
third-party bug.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-07-03 23:54

Message:
Logged In: YES 
user_id=3066

Assigning this to me since I have a similar setup.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-06-23 12:45

Message:
Logged In: YES 
user_id=21627

This is likely a bug in the NTFS driver, not in Python.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=434479&group_id=5470