pydoc.HTMLRepr.repr1() generates an exception if you pass in an object x where type(x) has no __name__ attribute. The attached patch adds a test for this case and keeps repr1 from barfing. This is useful on Windows if you're using cgitb.py to try to get tracebacks that involve COM objects -- somewhere in the guts of the COM support code you get a type that has no __name__ attribute.
Logged In: YES user_id=88162 I'm uploading an improved version of this patch that fixes both the Text and HTML versions of the traceback. The previous patch only fixed the HTML version.
Logged In: YES user_id=88162 Assigning to Skip since he's done work with traceback code before. I'm hoping this gets into 2.3b2. It's really a no-brainer bugfix.