[Python-bugs-list] Win32 os.listdir raises confusing errors (PR#374)

tpeters@beopen.com tpeters@beopen.com
Thu, 29 Jun 2000 02:25:20 -0400 (EDT)


Full_Name: Tim Peters
Version: 1.6a2
OS: Windows
Submission from: waf-dc1b-135.rasserver.net (206.217.144.135)


Copying this over from the SourceForge bug manager:
https://sourceforge.net/bugs/?func=detailbug&group_id=5470&bug_id=108381
Here's the original complaint:

    On Win32, os.listdir raises "No such process" when the directory
    does not exist. 
    The error returned from GetLastError really is ERROR_PATH_NOT_FOUND, 
    not ESRCH.

Here's confirmation under Win98 1.6a2:

C:\Python16>python
Python 1.6a2 (#0, Apr  6 2000, 11:45:12) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import os
>>> os.listdir('/cow')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
OSError: [Errno 3] No such process: '/cow'
>>>