[issue29693] DeprecationWarning/SyntaxError in test_import

Serhiy Storchaka report at bugs.python.org
Thu Mar 2 08:31:49 EST 2017


New submission from Serhiy Storchaka:

$ ./python -Wa -m test.regrtest test_import
Run tests sequentially
0:00:00 [1/1] test_import
/home/serhiy/py/cpython/Lib/test/test_import/__init__.py:88: DeprecationWarning: invalid escape sequence \(
  self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from 'os' \(.*os.py\)")
/home/serhiy/py/cpython/Lib/test/test_import/__init__.py:96: DeprecationWarning: invalid escape sequence \(
  self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from 'select' \(.*\.(so|pyd)\)")
1 test OK.

Total duration: 2 sec
Tests result: SUCCESS

$ ./python -We -m test.regrtest test_import
Run tests sequentially
0:00:00 [1/1] test_import
test test_import crashed -- Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/runtest.py", line 152, in runtest_inner
    the_module = importlib.import_module(abstest)
  File "/home/serhiy/py/cpython/Lib/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 675, in exec_module
  File "<frozen importlib._bootstrap_external>", line 782, in get_code
  File "<frozen importlib._bootstrap_external>", line 742, in source_to_code
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/home/serhiy/py/cpython/Lib/test/test_import/__init__.py", line 88
    self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from 'os' \(.*os.py\)")
                                       ^
SyntaxError: invalid escape sequence \(

test_import failed

1 test failed:
    test_import

Total duration: 244 ms
Tests result: FAILURE

----------
components: Tests
messages: 288799
nosy: benjamin.peterson, brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: DeprecationWarning/SyntaxError in test_import
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29693>
_______________________________________


More information about the Python-bugs-list mailing list