[ python-Bugs-1071513 ] test_sutil fails on cygwin

SourceForge.net noreply at sourceforge.net
Mon Dec 6 21:53:32 CET 2004


Bugs item #1071513, was opened at 2004-11-23 09:29
Message generated for change (Comment added) made by jlgijsbers
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1071513&group_id=5470

Category: Python Library
Group: Python 2.4
>Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Miki Tebeka (tebeka)
Assigned to: Johannes Gijsbers (jlgijsbers)
Summary: test_sutil fails on cygwin

Initial Comment:
[10:23] $python -V
Python 2.4c1
[10:25] $python -c 'from test.test_shutil import
test_main; test_main()' -v
test_dont_copy_file_onto_link_to_itself
(test.test_shutil.TestShutil) ... ok
test_dont_move_dir_in_itself
(test.test_shutil.TestShutil) ... ok
test_on_error (test.test_shutil.TestShutil) ... ERROR
test_rmtree_dont_delete_file
(test.test_shutil.TestShutil) ... ok
test_rmtree_errors (test.test_shutil.TestShutil) ... ok

======================================================================
ERROR: test_on_error (test.test_shutil.TestShutil)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/test/test_shutil.py", line
34, in test_on_error
    os.chmod(TESTFN, old_dir_mode)
OSError: [Errno 2] No such file or directory: '@test'

----------------------------------------------------------------------
Ran 5 tests in 0.036s

FAILED (errors=1)
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/usr/lib/python2.4/test/test_shutil.py", line
99, in test_main
    test_support.run_unittest(TestShutil)
  File "/usr/lib/python2.4/test/test_support.py", line
290, in run_unittest
    run_suite(suite, testclass)
  File "/usr/lib/python2.4/test/test_support.py", line
275, in run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent
call last):
  File "/usr/lib/python2.4/test/test_shutil.py", line
34, in test_on_error
    os.chmod(TESTFN, old_dir_mode)
OSError: [Errno 2] No such file or directory: '@test'



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

>Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-12-06 21:53

Message:
Logged In: YES 
user_id=469548

Closing this. I've added a comment to the source pointing to
here.

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

Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-11-23 11:04

Message:
Logged In: YES 
user_id=469548

Hmm, strange. I should perhaps have provided the link that I
based this on: http://www.cygwin.com/faq/faq_3.html#SEC41. 
The thing is, the test needs a permissions error so it can
check shutil.rmtree's error handling. Setting the
permissions for the directory to stat.S_IREAD (0400) doesn't
seem to prevent Python from removing the file. I don't know
enough about the intricacies of Cygwin+chmod (I don't have a
Windows machine) to make this work reliably, but I'll be
happy to take another patch.

Note, by the way, that this is not a problem with shutil
itself, but just with the test.

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

Comment By: Miki Tebeka (tebeka)
Date: 2004-11-23 10:41

Message:
Logged In: YES 
user_id=358087

I disagree, chmod seems to work:
[11:35] - adp96: touch zzz
[11:35] - adp96: ll zzz
-rw-rw-rw-    1 mikit    Domain U        0 Nov 23 11:35 zzz
[11:35] - adp96: python -c 'from os import chmod;
chmod("zzz", 0700)'
[11:36] - adp96: ll zzz
-rwx------    1 mikit    Domain U        0 Nov 23 11:35 zzz


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

Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-11-23 10:29

Message:
Logged In: YES 
user_id=469548

Ah, seems like chmod doesn't work on Cygwin. That means
there's no way to run this test there, so I've changed it so
that it doesn't run on Cygwin anymore.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1071513&group_id=5470


More information about the Python-bugs-list mailing list