Patches item #1439312, was opened at 2006-02-26 23:21
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1439312&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: Grant Olson (logistix)
Assigned to: Nobody/Anonymous (nobody)
Summary: Patch for bug  1438185: os.renames deletes junction points

Initial Comment:
os.removedirs assumes that the os will throw an
exception if you try to rmdir an non-empty directory. 
Although this is a bit of a grey area, windows junction
points will be delete themselves even if the junction
point's destination has files.  os.renames() relied on
this behaviour and caused the failure.

This patch runs an explicit os.listdir() check when
calling os.removeddirs() to verify that a target
directory is really empty before deleting.

After this patch, manually running os.rmdir() against a
junction point will still just remove the junction
point like I would expect.

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

>Comment By: Georg Brandl (gbrandl)
Date: 2007-03-08 18:42

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

I don't think you could create NTFS junction points from Python without
resorting to ctypes hackery.
Or is there some tool shipped with Windows to manipulate them?

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

Comment By: Collin Winter (collinwinter)
Date: 2007-03-08 18:25

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

Thanks for your patch!

I realize testing this kind of OS-specific behaviour is tricky, but could
you work up some regression tests for this patch?

Also, you should send an email to python-dev
(http://mail.python.org/mailman/listinfo/python-dev) about this; someone
more knowledgeable about NTFS than I am should take a look at this patch.

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

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

Reply via email to