nooB <[email protected]> added the comment:
Few points that could be useful,
1) I added print statements in `shutil.move` and found that the `real_dst` was
wrong for the case coz os.path.isdir returns true.
>> import os
>> os.mkdir('test')
>> os.path.isdir('TEst')
True
In shutil.move, when we do shutil.move('test', 'TEst'), os.rename is actually
applied to 'test' and 'TEst\test'. Thats why os.rename failed for the case in
shutil.move.
2) os.rename has its own problems.
>> import os
>> os.mkdir('test')
>> os.rename('TEst', 'teST')
os.rename succeeded when the source 'TEst' did not exist.
Is this behaviour correct?.
This applies to shutil.move also.
>> import os,shutil
>> os.mkdir('test')
>> shutil.move('TEst', 'teST')
The folder 'test' gets deleted when trying to move 'TEst' to 'teST'. The case
check should be done to the source argument also.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue10684>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com