Message323902
If you have set sys.excepthook to some function which calls traceback.print_exception, then I would expect to get identical traceback/exception messages. If you run raise SyntaxError("some message"), then print_exception has the extra line `File "<string>", line None`.
This comes from lines 558-561 of traceback.py:
# It was a syntax error; show exactly where the problem was found.
filename = self.filename or "<string>"
lineno = str(self.lineno) or '?'
yield ' File "{}", line {}\n'.format(filename, lineno)
Is it expected behaviour that these two functions behave differently, or should there be something like:
if self.filename or self.lineno:
etc.
Also, if self.lineno is None, then str(self.lineno) evaluates to "None" and so the ? is never used. |
|
Date |
User |
Action |
Args |
2018-08-22 19:01:06 | Timothy McCurrach | set | recipients:
+ Timothy McCurrach |
2018-08-22 19:01:06 | Timothy McCurrach | set | messageid: <1534964466.61.0.56676864532.issue34463@psf.upfronthosting.co.za> |
2018-08-22 19:01:06 | Timothy McCurrach | link | issue34463 messages |
2018-08-22 19:01:06 | Timothy McCurrach | create | |
|