os.listdir ('.'): Solaris: returns empty list in directory with 215 files

donna at v1.wustl.edu donna at v1.wustl.edu
Mon Jan 27 18:04:20 CET 2003

Hi python gurus,

A quick search of the archives turned up os.listdir('.') errors, but my
os.listdir doesn't complain; it just gives bad results:

myhost 30% python
Python 2.1.3 (#1, Jan 21 2003, 13:13:11) 
[GCC 3.2] on sunos5
Type "copyright", "credits" or "license" for more information.
>>> import os
>>> os.listdir('/surface/donna/SunOS/SUREfit/lib/python2.1')
>>> ^D
temporal 31% ls | wc
     216     216    2383

Note that this is in the python lib directory.  My host is running SunOS
5.8 Generic_108528-17 sun4u sparc SUNW,Ultra-5_10, but this file system
is NFS mounted, which I suspect is the root of the problem.  The NFS
server is running IRIX64 6.4 02121744 IP30.  The same version of python
built on IRIX 6.4 and Linux 6.1 return valid results on this file
system.  The same SunOS version previously built on a local file system
also returned valid results.  Only the SunOS version executing on the
NFS-mounted file system returns erroneous results.  Anyone else come
across this?

I noticed this while packaging binary distributions.  I noticed the
SunOS distribution was much smaller than it previously was; the problem
was missing *.pyc and *.pyo files in the python lib directory. 
Explicitly running compilall.py in the python lib directory doesn't
work, since it can't see the directory's contents.


More information about the Python-list mailing list