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_importlib fails for py3k on Windows
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, kristjan.jonsson
Priority: critical Keywords:

Created on 2009-04-01 11:55 by kristjan.jonsson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (8)
msg85000 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-04-01 11:55
regrtest.py --verbose test_importlib fails with various errors on Vista, 
including:
Traceback (most recent call last):
  File 
"D:\pydev\python\branches\py3k\lib\importlib\test\source\test_abc_loader
.py", line 149, in test_package
    __loader__=mock)
  File 
"D:\pydev\python\branches\py3k\lib\importlib\test\source\test_abc_loader
.py", line 126, in eq_attrs
    self.assertEqual(getattr(ob, attr), val)
AssertionError: ['/path/to/<pkg>/__init__'] != ['/path/to/<pkg>']
msg85212 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2009-04-02 15:36
Can you svn up and run them again? Some stuff has changed if you are
running against 3.1a1.
msg85213 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-04-02 15:59
Still get this, python_d.exe, Vista64 (32 bit py), VS2008:


======================================================================
FAIL: test_package (importlib.test.source.test_abc_loader.PyLoaderTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  
File "D:\pydev\python\branches\py3k\lib\importlib\test\source\test_abc_l
oader.py", line 151, in test_package
    __loader__=mock)
  
File "D:\pydev\python\branches\py3k\lib\importlib\test\source\test_abc_l
oader.py", line 128, in eq_attrs
    "{} attribute: {} != {}".format(attr, found, val))
AssertionError: __path__ attribute: ['/path/to/<pkg>/__init__'] != 
['/path/to/<pkg>']

======================================================================
FAIL: test_package 
(importlib.test.source.test_abc_loader.PyPycLoaderTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  
File "D:\pydev\python\branches\py3k\lib\importlib\test\source\test_abc_l
oader.py", line 266, in test_package
    mock, name = super().test_package()
  
File "D:\pydev\python\branches\py3k\lib\importlib\test\source\test_abc_l
oader.py", line 151, in test_package
    __loader__=mock)
  
File "D:\pydev\python\branches\py3k\lib\importlib\test\source\test_abc_l
oader.py", line 128, in eq_attrs
    "{} attribute: {} != {}".format(attr, found, val))
AssertionError: __path__ attribute: ['/path/to/<pkg>/__init__'] != 
['/path/to/<pkg>']

----------------------------------------------------------------------
Ran 166 tests in 0.276s

FAILED (failures=2)
test test_importlib failed -- errors occurred; run in verbose mode for 
details
1 test failed:
    test_importlib
[64246 refs]
msg85214 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-04-02 15:59
This is latest python/branches/py3k, btw.
msg85215 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2009-04-02 16:03
Thanks, Kristján, for the quick response. I will see if I can figure why
the heck this is differing on Vista (almost all the code is
platform-agnostic Python so this will be an "interesting" thing to try
to fix).
msg85217 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-04-02 16:08
There is another issue with testing on Vista, which I have noticed but 
I don't think apply to this issue:
os.unlink(testfilename)
followed by
open(testfilename, 'w')
often fails, because the unlink() operation on vista doesn't 
immediately reflect on the disk!  You get strange and unpredictable 
regression failures because of this.  It is enough to catch the error, 
sleep for a millisecond and try again to overcome this.  If we start 
regular regression testing on Vista, this is onething that needs 
fixing, probably with a tmpfile utility function in test_support.py

Perhaps CCP could contribute a buildbot with Server2008 (=Vista) to 
test the main branches...  not making any promises.
msg85231 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2009-04-02 18:06
I committed a fix in r71057 where instead of hard-coding the paths I
moved over to os.path.join(). Let me know if that fixes it.

As for the deletion hole that Vista has, it could be added to
test.test_support.unlink(), but talking here at PyCon it sounds like it
might be up to 15 seconds which is way too long to wait for a file
deletion to complete. Might need to create a context manager that
creates unique files every time. But all of this should be covered in
another issue.
msg85300 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-04-03 09:16
It works now!
Good work, Brett.
History
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49896
2009-04-03 19:09:55brett.cannonsetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2009-04-03 09:16:05kristjan.jonssonsetstatus: pending -> open

messages: + msg85300
2009-04-02 18:06:04brett.cannonsetstatus: open -> pending

messages: + msg85231
stage: test needed -> commit review
2009-04-02 16:08:04kristjan.jonssonsetmessages: + msg85217
2009-04-02 16:03:12brett.cannonsetmessages: + msg85215
stage: test needed
2009-04-02 15:59:53kristjan.jonssonsetmessages: + msg85214
2009-04-02 15:59:20kristjan.jonssonsetmessages: + msg85213
2009-04-02 15:36:07brett.cannonsetpriority: critical

type: behavior
assignee: brett.cannon
components: + Library (Lib), - Tests, Windows

nosy: + brett.cannon
messages: + msg85212
2009-04-01 11:55:04kristjan.jonssoncreate