This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: os.renames() crashes NTFS junctions
Type: behavior Stage: test needed
Components: Windows Versions: Python 3.0, Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Patch for bug 1438185: os.renames deletes junction points
View: 1439312
Assigned To: Nosy List: ajaksu2, damiro, logistix
Priority: normal Keywords:

Created on 2006-02-24 16:03 by damiro, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg60875 - (view) Author: Daniel Rohlfing (damiro) Date: 2006-02-24 16:03
Hello

There is a problem using os.renames() with a path, 
that was created as a ntfs junction.

You will find more information about junctions and a 
tool to create them on:
http://www.sysinternals.com/Utilities/Junction.html
The source is also available there.

Try this to reproduce the problem:

*in DOS*
mkdir C:\dir1
echo >>C:\dir1\old.txt
junction.exe C:\dir2 C:\dir1

*in Python*
>>> import os
>>> os.renames("C:\\dir2\\old.txt", "C:\\dir2
\\new.txt")

If you now look in 'dir1' you will find new.txt
thats fine, but junction 'dir2' not longer exist.

os.rename() is not affected by this problem.

My OP is Windows 2000 [Version 5.00.2195] with SP4 and 
im using Python 2.4.2

I hope you will find this information usefull.

greets from germany
Daniel Rohlfing
msg60876 - (view) Author: Grant Olson (logistix) Date: 2006-02-25 23:02
Logged In: YES 
user_id=699438

This is because 'os.rmdir' doesn't throw an exception when
deleting a junction, since it doesn't really have any files
under it.  Does look like a bug to me though.
msg60877 - (view) Author: Grant Olson (logistix) Date: 2006-02-26 23:23
Logged In: YES 
user_id=699438

Patch 1439312 posted.
msg83903 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-03-21 00:36
Issue 1439312 has a patch.
History
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 42946
2009-04-05 14:10:08ocean-citysetsuperseder: os.renames() crashes NTFS junctions -> Patch for bug 1438185: os.renames deletes junction points
2009-04-05 14:10:08ocean-cityunlinkissue1438185 superseder
2009-04-05 13:48:32georg.brandlsetstatus: open -> closed
resolution: duplicate
dependencies: - os.renames() crashes NTFS junctions
superseder: os.renames() crashes NTFS junctions
2009-04-05 13:48:32georg.brandllinkissue1438185 superseder
2009-04-05 13:48:32georg.brandlunlinkissue1438185 dependencies
2009-03-21 00:36:39ajaksu2setdependencies: + os.renames() crashes NTFS junctions
type: behavior
versions: + Python 2.6, Python 3.0, - Python 2.4
nosy: + ajaksu2

messages: + msg83903
stage: test needed
2009-03-21 00:36:39ajaksu2linkissue1438185 dependencies
2006-02-24 16:03:03damirocreate