[Python-Dev] Tag trackbacks with version (was Re: readd u'' literal support in 3.3?)

Terry Reedy tjreedy at udel.edu
Sat Dec 10 23:44:18 CET 2011

On 12/10/2011 12:52 PM, Steven D'Aprano wrote:
> Terry Reedy wrote:
>> On 12/9/2011 5:17 AM, Nick Coghlan wrote:
>>> As Chris pointed out though, the real problem with the "repeatedly run
>>> 2to3" workflow is that it can make interpreting tracebacks from the
>>> field *really* hard.
>> This just gave me the idea of tagging tracebacks with the Python
>> version number. Something like
>> Traceback (Py3.2.2, most recent call last):
>> and perhaps with the platform also
>> Traceback (most recent call last) [Py3.2.2 on win23]:
>> Since computation has stopped, the few extra milliseconds is trivial.
>> This would certainly help on Python list and the tracker when people
>> do post the traceback (which they do not always) without version and
>> system (which they often do not, especially on Python list). It might
>> suggest to people that this is important info to include.
> [...]
> But how often is it actually important information to include?
> I am active on both the tutor and the python-list lists, and it seems to
> me that this proposed feature won't be very useful in either place. In
> my experience, the version number is rarely important for the sorts of
> questions that are commonly asked.

My experience on Python list is that version and platform are often 
important. But leave that aside. It is definitely important on the 
tracker, which I already mentioned. Just a few days ago, for instance, 
the opening message of
" >>> bytes("foo")
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: string argument without an encoding"
with no indication of the version anywhere in the message.

Perhaps in such cases the OP correctly marks the version up in the 
header, but it would be nice to have it right there in the traceback.

As for doctest, it could/should be changed to check for 
s.startswith("Traceback (most recent call last)") (instead of s == ...) 
if it does not do that now.

Terry Jan Reedy

More information about the Python-Dev mailing list