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.

Author iritkatriel
Recipients amc1, arthur.petitpierre, ggenellina, iritkatriel
Date 2020-11-15.18:52:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605466360.25.0.895681651454.issue4643@roundup.psfhosted.org>
In-reply-to
Content
The issue still occurs in 3.10. Python 3 version of the script:


import cgitb

class WeirdObject(object):
    def __getattr__(self, attr):
        if attr == 'a':
            return 'the letter a'
        elif attr == 'b':
            return str(slf) # Intentional NameError
        raise AttributeError(attr)

try:
    weird = WeirdObject()
    print('A:', weird.a)
    print('B:', weird.b)
    print('C:', weird.c)
except Exception as e:
    import sys
    print('\nSomething went wrong - attempting to generate HTML stack trace.')
    try:
        html_text = cgitb.html(sys.exc_info())
    except:
        print('Error generating HTML stack trace!')
        raise
    else:
        print('Here is stack trace in HTML:\n', html_text)
History
Date User Action Args
2020-11-15 18:52:40iritkatrielsetrecipients: + iritkatriel, amc1, ggenellina, arthur.petitpierre
2020-11-15 18:52:40iritkatrielsetmessageid: <1605466360.25.0.895681651454.issue4643@roundup.psfhosted.org>
2020-11-15 18:52:40iritkatriellinkissue4643 messages
2020-11-15 18:52:40iritkatrielcreate