[Patches] [ python-Patches-1273829 ] extending os.walk to support following symlinks

SourceForge.net noreply at sourceforge.net
Fri Mar 16 08:34:49 CET 2007


Patches item #1273829, was opened at 2005-08-26 07:21
Message generated for change (Comment added) made by aptshansen
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1273829&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Erick Tryzelaar (idadesub)
Assigned to: Nobody/Anonymous (nobody)
Summary: extending os.walk to support following symlinks

Initial Comment:
this is a very simple extension to os.walk to optionally walk down 
into symlink directories, when it is supported by the operating 
system. This patch keeps a compatible interface by having this 
option disabled. 

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

Comment By: Stephen Hansen (aptshansen)
Date: 2007-03-16 07:34

Message:
Logged In: YES 
user_id=1720594
Originator: NO

I'm not sure if this is a good idea; although I am certain it would be
useful at times. Dangerous! But if its documented, ... and there's our
problem :)

Patch applies cleanly to the HEAD, but needs documentation.

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

Comment By: Georg Brandl (birkenfeld)
Date: 2005-08-26 08:23

Message:
Logged In: YES 
user_id=1188172

The docs to os.walk say:
"""
Note: On systems that support symbolic links, links to
subdirectories appear in dirnames lists, but walk() will not
visit them (infinite loops are hard to avoid when following
symbolic links). To visit linked directories, you can
identify them with os.path.islink(path), and invoke
walk(path) on each directly.
"""

Nevertheless, we could offer this option with a caution message.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1273829&group_id=5470


More information about the Patches mailing list