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: test_shutil fails with symlinks enabled under Windows
Type: behavior Stage: resolved
Components: Library (Lib), Tests Versions: Python 3.3
process
Status: closed Resolution: duplicate
Dependencies: Superseder: On Windows NT 6 with administrator account, there are two failing tests on test_shutil.py
View: 20055
Assigned To: Nosy List: BreamoreBoy, berker.peksag, hynek, ishimoto, loewis, pitrou, tim.golden, vstinner
Priority: normal Keywords:

Created on 2012-01-22 18:10 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (8)
msg151783 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-01-22 18:10
This happens when symlinks are enabled under Windows. This doesn't affect any buildbots since they don't run the tests as administrator (or they are not recent enough to have symlink support):


======================================================================
FAIL: test_copymode_follow_symlinks (test.test_shutil.TestShutil)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\t\cpython\lib\test\test_shutil.py", line 193, in test_copymode_follow
_symlinks
    self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
AssertionError: 33206 != 33060

======================================================================
FAIL: test_move_dangling_symlink (test.test_shutil.TestMove)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\t\cpython\lib\test\test_shutil.py", line 58, in wrap
    return func(*args, **kwargs)
  File "C:\t\cpython\lib\test\test_shutil.py", line 1136, in test_move_dangling_
symlink
    self.assertEqual(os.path.realpath(src), os.path.realpath(dst_link))
AssertionError: 'c:\\users\\antoine\\appdata\\local\\temp\\tmp8bl4eu\\baz' != 'c
:\\users\\antoine\\appdata\\local\\temp\\tmplc6h2h\\quux'
- c:\users\antoine\appdata\local\temp\tmp8bl4eu\baz
?                                        -- ^^ ^^^^
+ c:\users\antoine\appdata\local\temp\tmplc6h2h\quux
?                                         ^^^^^^^ ^^
msg151784 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-01-22 18:10
(tests were added in #12715 and #9993)
msg165997 - (view) Author: Atsuo Ishimoto (ishimoto) * Date: 2012-07-21 08:33
Error in test_copymode_follow_symlinks is adderessed in #15411.
msg166213 - (view) Author: Atsuo Ishimoto (ishimoto) * Date: 2012-07-23 08:13
Error in test_move_dangling_symlink is fixed by #9949
msg167455 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-08-04 22:38
Ping?
msg172292 - (view) Author: Hynek Schlawack (hynek) * (Python committer) Date: 2012-10-07 11:09
Pong? I understand we have to close #15411 & #9949 first? Can't help here out due to lack of Windows.
msg223301 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-16 23:54
I've asked for patch reviews on #9949 and #15411.
msg323462 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-08-13 05:26
Issue 20055 was a duplicate of this one. Both tests have been adjusted in https://github.com/python/cpython/commit/3f48ac98c04fc17f12c63dcf593dd0c19379c7df.
History
Date User Action Args
2022-04-11 14:57:25adminsetgithub: 58045
2018-08-13 05:26:52berker.peksagsetstatus: open -> closed

dependencies: - os.path.realpath on Windows does not follow symbolic links, os.chmod() does not follow symlinks on Windows
superseder: On Windows NT 6 with administrator account, there are two failing tests on test_shutil.py

nosy: + berker.peksag
messages: + msg323462
resolution: duplicate
stage: needs patch -> resolved
2014-07-17 13:58:31brian.curtinsetnosy: - brian.curtin
2014-07-16 23:54:16BreamoreBoysetnosy: + BreamoreBoy
messages: + msg223301
2014-05-13 21:54:32skrahsetnosy: - skrah
2012-11-05 07:06:53pitrousetnosy: + loewis, vstinner
2012-11-05 07:06:35pitroulinkissue16412 superseder
2012-10-07 11:09:22hyneksetdependencies: + os.path.realpath on Windows does not follow symbolic links, os.chmod() does not follow symlinks on Windows
messages: + msg172292
2012-08-04 22:38:04pitrousetmessages: + msg167455
2012-07-23 08:13:24ishimotosetmessages: + msg166213
2012-07-21 08:33:48ishimotosetnosy: + ishimoto
messages: + msg165997
2012-02-24 20:39:02pitroulinkissue14108 superseder
2012-01-30 22:25:52skrahsetnosy: + skrah
2012-01-22 18:10:38pitrousetmessages: + msg151784
2012-01-22 18:10:06pitroucreate