classification
Title: traceback of exception with non-unicode __module__
Type: Stage: resolved
Components: Interpreter Core, Library (Lib) Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: erlendaasland, gvanrossum, iritkatriel
Priority: normal Keywords: patch

Created on 2021-10-26 12:05 by iritkatriel, last changed 2021-11-29 10:12 by iritkatriel. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29726 merged iritkatriel, 2021-11-23 12:05
PR 29826 merged iritkatriel, 2021-11-28 23:52
PR 29827 merged iritkatriel, 2021-11-28 23:55
Messages (5)
msg405037 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-10-26 12:05
This test currently fails for both C and python tracebacks:

    def test_exception_modulename_not_unicode(self):
        class X(Exception):
            def __str__(self):
                return "I am X"

        X.__module__ = 42

        err = self.get_report(X())
        exp = f'<unknown>.{X.__qualname__}: I am X'
        self.assertEqual(exp, err)
msg405038 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-10-26 12:07
In C it is missing the '.' between <unknown> and the qualname. In python it raises an exception when trying to + the module field with a string.
msg407173 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-11-27 22:00
New changeset 4dfae6f38e1720ddafcdd68043e476ecb41cb4d5 by Irit Katriel in branch 'main':
bpo-45614: Fix traceback display for exceptions with invalid module name (GH-29726)
https://github.com/python/cpython/commit/4dfae6f38e1720ddafcdd68043e476ecb41cb4d5
msg407256 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-11-29 10:08
New changeset 4d2cc3ed46d2453bad92243128e237e7febca714 by Irit Katriel in branch '3.10':
bpo-45614: Fix traceback display for exceptions with invalid module name (GH-29726) (GH-29826)
https://github.com/python/cpython/commit/4d2cc3ed46d2453bad92243128e237e7febca714
msg407257 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-11-29 10:11
New changeset 5b6aa6ce20b5b3b45dec2ebd6355e248cdf2fbcc by Irit Katriel in branch '3.9':
bpo-45614: Fix traceback display for exceptions with invalid module name (GH-29726) (GH-29827)
https://github.com/python/cpython/commit/5b6aa6ce20b5b3b45dec2ebd6355e248cdf2fbcc
History
Date User Action Args
2021-11-29 10:12:03iritkatrielsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-11-29 10:11:52iritkatrielsetmessages: + msg407257
2021-11-29 10:08:01iritkatrielsetmessages: + msg407256
2021-11-28 23:55:37iritkatrielsetpull_requests: + pull_request28058
2021-11-28 23:52:49iritkatrielsetpull_requests: + pull_request28057
2021-11-27 22:00:52iritkatrielsetversions: + Python 3.9, Python 3.10
2021-11-27 22:00:19iritkatrielsetmessages: + msg407173
2021-11-23 12:05:11iritkatrielsetkeywords: + patch
stage: patch review
pull_requests: + pull_request27963
2021-11-03 22:21:58gvanrossumsetnosy: + gvanrossum
2021-10-26 13:17:02erlendaaslandsetnosy: + erlendaasland
2021-10-26 12:07:42iritkatrielsetmessages: + msg405038
2021-10-26 12:05:47iritkatrielcreate