Patches item #1696393, was opened at 2007-04-08 14:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1696393&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Windows
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Michael Haggerty (mhagger)
Assigned to: Nobody/Anonymous (nobody)
Summary: Remove redundant code in ntpath.walk()

Initial Comment:
The documentation for os.listdir() explicitly says that it omits directories 
'.' and '..' even if they are present in the directory, and the implementation 
in posixmodule.c seems to agree.

Yet the implementation of os.path.walk() in ntpath.py still checks for and 
excludes '.' and '..' from the names gotten from os.listdir().  This seems like 
dead code.

The analogous check was removed from posixpath.py by Guido in r14534, with the 
comment

> Remove some redundant logic from walk() -- there's no need to check
> for "." and "..", since listdir() no longer returns those.

The attached patch removes the extra check.  It is relative to trunk r54712.

I don't have a Windows computer around to test this patch, but it seems 
straightforward enough.


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1696393&group_id=5470
_______________________________________________
Patches mailing list
Patches@python.org
http://mail.python.org/mailman/listinfo/patches

Reply via email to