Bug#1056530: spyder's autopkg tests fail with Python 3.12

Matthias Klose doko at debian.org
Wed Nov 22 15:53:10 GMT 2023


Package: src:spyder
Version: 5.4.2+ds-5
Severity: important
Tags: sid trixie
User: debian-python at lists.debian.org
Usertags: python3.12

spyder's autopkg tests fail with Python 3.12:

[...]
3458s =================================== FAILURES 
===================================
3458s _______________________ test_pdb_comprehension_namespace 
_______________________
3458s
3458s ipyconsole = <spyder.plugins.ipythonconsole.plugin.IPythonConsole 
object at 0x7faa5c1cc200>
3458s qtbot = <pytestqt.qtbot.QtBot object at 0x7faa5c3fa030>
3458s tmpdir = 
local('/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0')
3458s
3458s     def test_pdb_comprehension_namespace(ipyconsole, qtbot, tmpdir):
3458s         """Check that the debugger handles the namespace of a 
comprehension."""
3458s         shell = ipyconsole.get_current_shellwidget()
3458s         qtbot.waitUntil(lambda: shell._prompt_html is not None,
3458s                         timeout=SHELL_TIMEOUT)
3458s         control = ipyconsole.get_widget().get_focus_widget()
3458s
3458s         # Code to run
3458s         code = "locals = 1\nx = [locals + i for i in range(2)]"
3458s
3458s         # Write code to file on disk
3458s         file = tmpdir.join('test_breakpoint.py')
3458s         file.write(code)
3458s
3458s         # Run file
3458s         with qtbot.waitSignal(shell.executed):
3458s             shell.execute(f"debugfile(filename=r'{str(file)}')")
3458s
3458s         # steps 4 times
3458s         for i in range(4):
3458s             with qtbot.waitSignal(shell.executed):
3458s                 shell.pdb_execute("s")
3458s         assert "Error" not in control.toPlainText()
3458s
3458s         with qtbot.waitSignal(shell.executed):
3458s             shell.pdb_execute("print('test', locals + i + 10)")
3458s
3458s >       assert "Error" not in control.toPlainText()
3458s E       assert 'Error' not in 'Python 3.12.0+ (main, Nov 12 2023, 
13:37:07) [GCC 13.2.0]\nType "copyright", "credits" or "license" for 
more information.\n\nIPython 8.14.0 -- An enhanced Interactive 
Python.\n\nIn [1]: 
debugfile(filename=r\'/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py\')\n> 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(1)<module>()\n----> 
1 locals = 1\n      2 x = [locals + i for i in 
range(2)]\n\n\n/usr/lib/python3/dist-packages/pytz/__init__.py:30: 
SyntaxWarning: invalid escape sequence \'\\s\'\n  match = 
re.match("^#\\s*version\\s*([0-9a-z]*)\\s*$", line)\n\nIPdb [1]: s\n> 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()\n 
      1 locals = 1\n----> 2 x = [locals + i for i in range(2)]\n\n\nIPdb 
[2]: s\n> 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()\n 
      1 locals = 1\n----> 2 x = [locals + i for i in range(2)]\n\n\nIPdb 
[3]: s\n> 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()\n 
      1 locals = 1\n----> 2 x = [locals + i for i in 
range(2)]\n\n/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py:2: 
RuntimeWarning: assigning None to unbound local \'i\'\n  x = [locals + i 
for i in range(2)]\n\nIPdb [4]: s\n--Return--\nNone\n> 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()\n 
      1 locals = 1\n----> 2 x = [locals + i for i in range(2)]\n\n\nIPdb 
[5]: print(\'test\', locals + i + 10)\n*** NameError: name \'i\' is not 
defined\n\nIPdb [6]: '
3458s E         'Error' is contained here:
3458s E           Python 3.12.0+ (main, Nov 12 2023, 13:37:07) [GCC 13.2.0]
3458s E           Type "copyright", "credits" or "license" for more 
information.
3458s E
3458s E           IPython 8.14.0 -- An enhanced Interactive Python.
3458s E
3458s E           In [1]: 
debugfile(filename=r'/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py')
3458s E           > 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(1)<module>()
3458s E           ----> 1 locals = 1
3458s E                 2 x = [locals + i for i in range(2)]
3458s E
3458s E
3458s E           /usr/lib/python3/dist-packages/pytz/__init__.py:30: 
SyntaxWarning: invalid escape sequence '\s'
3458s E             match = re.match("^#\s*version\s*([0-9a-z]*)\s*$", line)
3458s E
3458s E           IPdb [1]: s
3458s E           > 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()
3458s E                 1 locals = 1
3458s E           ----> 2 x = [locals + i for i in range(2)]
3458s E
3458s E
3458s E           IPdb [2]: s
3458s E           > 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()
3458s E                 1 locals = 1
3458s E           ----> 2 x = [locals + i for i in range(2)]
3458s E
3458s E
3458s E           IPdb [3]: s
3458s E           > 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()
3458s E                 1 locals = 1
3458s E           ----> 2 x = [locals + i for i in range(2)]
3458s E
3458s E 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py:2: 
RuntimeWarning: assigning None to unbound local 'i'
3458s E             x = [locals + i for i in range(2)]
3458s E
3458s E           IPdb [4]: s
3458s E           --Return--
3458s E           None
3458s E           > 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()
3458s E                 1 locals = 1
3458s E           ----> 2 x = [locals + i for i in range(2)]
3458s E
3458s E
3458s E           IPdb [5]: print('test', locals + i + 10)
3458s E           *** NameError: name 'i' is not defined
3458s E         ?         +++++
3458s E
3458s E           IPdb [6]:
3458s
3458s spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py:1924: 
AssertionError
3458s ----------------------------- Captured Qt messages 
-----------------------------
3458s QtWarningMsg: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting 
to '/tmp/runtime-ubuntu'
3458s --------------------------- Captured stdout teardown 
---------------------------
3458s Python 3.12.0+ (main, Nov 12 2023, 13:37:07) [GCC 13.2.0]
3458s Type "copyright", "credits" or "license" for more information.
3458s
3458s IPython 8.14.0 -- An enhanced Interactive Python.
3458s
3458s In [1]: 
debugfile(filename=r'/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py')
3458s > 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(1)<module>()
3458s ----> 1 locals = 1
3458s       2 x = [locals + i for i in range(2)]
3458s
3458s
3458s /usr/lib/python3/dist-packages/pytz/__init__.py:30: SyntaxWarning: 
invalid escape sequence '\s'
3458s   match = re.match("^#\s*version\s*([0-9a-z]*)\s*$", line)
3458s
3458s IPdb [1]: s
3458s > 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()
3458s       1 locals = 1
3458s ----> 2 x = [locals + i for i in range(2)]
3458s
3458s
3458s IPdb [2]: s
3458s > 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()
3458s       1 locals = 1
3458s ----> 2 x = [locals + i for i in range(2)]
3458s
3458s
3458s IPdb [3]: s
3458s > 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()
3458s       1 locals = 1
3458s ----> 2 x = [locals + i for i in range(2)]
3458s
3458s 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py:2: 
RuntimeWarning: assigning None to unbound local 'i'
3458s   x = [locals + i for i in range(2)]
3458s
3458s IPdb [4]: s
3458s --Return--
3458s None
3458s > 
/tmp/pytest-of-ubuntu/pytest-14/test_pdb_comprehension_namespa0/test_breakpoint.py(2)<module>()
3458s       1 locals = 1
3458s ----> 2 x = [locals + i for i in range(2)]
3458s
3458s
3458s IPdb [5]: print('test', locals + i + 10)
3458s *** NameError: name 'i' is not defined
3458s
3458s IPdb [6]:



More information about the debian-science-maintainers mailing list