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_imp.py test failures on Py3K Mac OS X
Type: Stage:
Components: Versions: Python 3.2
process
Status: closed Resolution: duplicate
Dependencies: Superseder: test_imp fails on OS X; filename normalization issue.
View: 8133
Assigned To: ronaldoussoren Nosy List: brett.cannon, michael.foord, ronaldoussoren
Priority: normal Keywords:

Created on 2010-03-20 16:41 by michael.foord, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (1)
msg101377 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-03-20 16:41
$ ./python.exe Lib/test/test_imp.py 
test_find_module_encoding (__main__.ImportTests) ... ok
test_issue1267 (__main__.ImportTests) ... ok
test_issue3594 (__main__.ImportTests) ... ok
test_issue5604 (__main__.ImportTests) ... ERROR
test_builtin (__main__.ReloadTests) ... ok
test_extension (__main__.ReloadTests) ... ok
test_source (__main__.ReloadTests) ... ok
testLock (__main__.LockTests) ... ok

======================================================================
ERROR: test_issue5604 (__main__.ImportTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_imp.py", line 121, in test_issue5604
    file, filename, info = imp.find_module(temp_mod_name)
ImportError: No module named test_imp_helper_ä

----------------------------------------------------------------------
Ran 8 tests in 0.032s

FAILED (errors=1)
Traceback (most recent call last):
  File "Lib/test/test_imp.py", line 194, in <module>
    test_main()
  File "Lib/test/test_imp.py", line 191, in test_main
    support.run_unittest(*tests)
  File "/compile/python3-back/Lib/test/support.py", line 997, in run_unittest
    _run_suite(suite)
  File "/compile/python3-back/Lib/test/support.py", line 980, in _run_suite
    raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_imp.py", line 121, in test_issue5604
    file, filename, info = imp.find_module(temp_mod_name)
ImportError: No module named test_imp_helper_ä


Could be related to issue 8180 perhaps? 

In addition, if I run this test in an ascii terminal, unittest dies trying to output the failure message:

  File "/compile/python3-back/Lib/unittest/runner.py", line 150, in run
    result.printErrors()
  File "/compile/python3-back/Lib/unittest/runner.py", line 105, in printErrors
    self.printErrorList('ERROR', self.errors)
  File "/compile/python3-back/Lib/unittest/runner.py", line 113, in printErrorList
    self.stream.writeln("%s" % err)
  File "/compile/python3-back/Lib/unittest/runner.py", line 21, in writeln
    self.write(arg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' in position 197: ordinal not in range(128)

Should unittest be fixed to be able to handle this? (Output '\u...' style strings when there is an encoding error in the TextTestRunner / TextTestResult.)
History
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52429
2010-03-20 16:42:06benjamin.petersonsetstatus: open -> closed
resolution: duplicate
superseder: test_imp fails on OS X; filename normalization issue.
2010-03-20 16:41:10michael.foordcreate