[issue45826] unittest.assertRaisesRegex is broken in Python 3.11 and leading to crashing if tested regex does not match name.

2021-11-17 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks, Dennis! ✨  ✨ -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 ___ Python tracker

[issue45826] unittest.assertRaisesRegex is broken in Python 3.11 and leading to crashing if tested regex does not match name.

2021-11-17 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 8eabe60108b536b942c791b5d3dc3c3020497aac by Łukasz Langa in branch '3.10': [3.10] bpo-45826: Fix a crash in suggestions.c by checking for `traceback is None` (GH-29590) (GH-29602)

[issue45826] unittest.assertRaisesRegex is broken in Python 3.11 and leading to crashing if tested regex does not match name.

2021-11-17 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +27845 pull_request: https://github.com/python/cpython/pull/29602 ___ Python tracker ___

[issue45826] unittest.assertRaisesRegex is broken in Python 3.11 and leading to crashing if tested regex does not match name.

2021-11-17 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 5d90c467c02ffefdb13c1abc83a171db1a99ffad by Dennis Sweeney in branch 'main': bpo-45826: Fix a crash in suggestions.c by checking for `traceback is None` (GH-29590) https://github.com/python/cpython/commit/5d90c467c02ffefdb13c1abc83a171db1a99ffad

[issue45826] unittest.assertRaisesRegex is broken in Python 3.11 and leading to crashing if tested regex does not match name.

2021-11-16 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +27833 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29590 ___ Python tracker ___

[issue45826] unittest.assertRaisesRegex is broken in Python 3.11 and leading to crashing if tested regex does not match name.

2021-11-16 Thread Dennis Sweeney
Dennis Sweeney added the comment: Even shorter reproducer: - try: aab except BaseException as E: E.with_traceback(None) raise ZeroDivisionError() - Bisection points to the initial implementation of suggestions.c:

[issue45826] unittest.assertRaisesRegex is broken in Python 3.11 and leading to crashing if tested regex does not match name.

2021-11-16 Thread Dennis Sweeney
Dennis Sweeney added the comment: Here's shorter reproducer not involving unittest: import sys try: aab except: exc_type, exc_value, tb = sys.exc_info() exc_value.with_traceback(None) raise ZeroDivisionError() -- ___ Python

[issue45826] unittest.assertRaisesRegex is broken in Python 3.11 and leading to crashing if tested regex does not match name.

2021-11-16 Thread Dennis Sweeney
Dennis Sweeney added the comment: I got a segfault in a similar location: static PyObject * offer_suggestions_for_name_error(PyNameErrorObject *exc) { PyObject *name = exc->name; // borrowed reference PyTracebackObject *traceback = (PyTracebackObject *) exc->traceback; // borrowed

[issue45826] unittest.assertRaisesRegex is broken in Python 3.11 and leading to crashing if tested regex does not match name.

2021-11-16 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Running it in debug build mode ./python -X dev ../bpo45826.py python: Python/suggestions.c:215: offer_suggestions_for_name_error: Assertion `frame != NULL' failed. Fatal Python error: Aborted Current thread

[issue45826] unittest.assertRaisesRegex is broken in Python 3.11 and leading to crashing if tested regex does not match name.

2021-11-16 Thread Xinmeng Xia
New submission from Xinmeng Xia : In Python 3.11, unittest.assertRaisesRegex is broken and leading to crashing if tested regex does not match name. See the following example: test.py = import unittest class uTest(unittest.TestCase): pass uTest