Opened 16 years ago

Closed 16 years ago

#3355 closed bug (fixed)

using mv to move a folder onto itself should fail

Reported by: scottmc Owned by: axeld
Priority: normal Milestone: R1
Component: - General Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Another python regression test failure, this one is the test_shutil.py test.

~/develop/python/Lib/test> python test_shutil.py
test_copytree_simple (__main__.TestShutil) ... ok
test_copytree_with_exclude (__main__.TestShutil) ... ok
test_dont_copy_file_onto_link_to_itself (__main__.TestShutil) ... ERROR
test_rmtree_dont_delete_file (__main__.TestShutil) ... ok
test_rmtree_errors (__main__.TestShutil) ... ok
test_rmtree_on_symlink (__main__.TestShutil) ... ok
test_dont_move_dir_in_itself (__main__.TestMove) ... FAIL
test_existing_file_inside_dest_dir (__main__.TestMove) ... ok
test_move_dir (__main__.TestMove) ... ok
test_move_dir_other_fs (__main__.TestMove) ... ok
test_move_dir_to_dir (__main__.TestMove) ... ok
test_move_dir_to_dir_other_fs (__main__.TestMove) ... ok
test_move_file (__main__.TestMove) ... ok
test_move_file_other_fs (__main__.TestMove) ... ok
test_move_file_to_dir (__main__.TestMove) ... ok
test_move_file_to_dir_other_fs (__main__.TestMove) ... ok

======================================================================
ERROR: test_dont_copy_file_onto_link_to_itself (__main__.TestShutil)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_shutil.py", line 199, in test_dont_copy_file_onto_link_to_itself
    os.link(src, dst)
OSError: [Errno -2147454933] Operation not supported

======================================================================
FAIL: test_dont_move_dir_in_itself (__main__.TestMove)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_shutil.py", line 341, in test_dont_move_dir_in_itself
    self.assertRaises(shutil.Error, shutil.move, self.src_dir, dst)
AssertionError: Error not raised

----------------------------------------------------------------------
Ran 16 tests in 3.612s

FAILED (failures=1, errors=1)
Traceback (most recent call last):
  File "test_shutil.py", line 349, in <module>
    test_main()
  File "test_shutil.py", line 346, in test_main
    test_support.run_unittest(TestShutil, TestMove)
  File "/boot/common/lib/python2.7/test/test_support.py", line 710, in run_unittest
    _run_suite(suite)
  File "/boot/common/lib/python2.7/test/test_support.py", line 693, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: errors occurred; run in verbose mode for details
~/develop/python/Lib/test> 

You can also see this happen if you create a folder, and then use mv to move it onto itself:

mkdir /boot/home/testfolder mv /boot/home/testfolder /boot/home/testfolder it completes without showing any error, but if you then search for the testfolder it will be show as /testfolder and you can't get rid of it...

Change History (1)

comment:1 by korli, 16 years ago

Resolution: fixed
Status: newclosed

Should be fixed with hrev29001.

Note: See TracTickets for help on using tickets.