[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-06-09 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-02-13 Thread miss-islington

miss-islington  added the comment:


New changeset 53374cc57f33f1afb22924da3a76ec6cf9e4afc1 by Miss Islington (bot) 
in branch '3.7':
bpo-30579: Docs for dynamic traceback creation (GH-5653)
https://github.com/python/cpython/commit/53374cc57f33f1afb22924da3a76ec6cf9e4afc1


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-02-13 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5457

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-02-13 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset aec7532ed3ccbd29d3429a3f375e25f956c44003 by Nick Coghlan in 
branch 'master':
bpo-30579: Docs for dynamic traceback creation (GH-5653)
https://github.com/python/cpython/commit/aec7532ed3ccbd29d3429a3f375e25f956c44003


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-02-12 Thread Nick Coghlan

Change by Nick Coghlan :


--
pull_requests: +5455

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-01-07 Thread Nick Coghlan

Nick Coghlan  added the comment:

Thanks for the patch!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-01-07 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset e46a8af450210ee5c7f0459ad6beddbc626ae60f by Nick Coghlan 
(Nathaniel J. Smith) in branch 'master':
bpo-30579: Allow TracebackType creation and tb_next mutation from Python 
(GH-4793)
https://github.com/python/cpython/commit/e46a8af450210ee5c7f0459ad6beddbc626ae60f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-01-05 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Ping -- anyone up for reviewing PR 4793?

https://github.com/python/cpython/pull/4793

It's pretty straightforward, and I figure better to ping now and beat the 
end-of-month rush :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-12-11 Thread STINNER Victor

Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-12-11 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

PR 4793 provides everything that Jinja2 and Trio actually need right now. It 
doesn't provide any way to annotate tracebacks with extra data, but I'm not 
entirely sure if that's necessary or what it would look like, so I figured I'd 
at least get this part in for 3.7.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-12-11 Thread Giampaolo Rodola'

Change by Giampaolo Rodola' :


--
nosy:  -giampaolo.rodola

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-12-11 Thread Nathaniel Smith

Change by Nathaniel Smith :


--
keywords: +patch
pull_requests: +4692
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-06-07 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-06-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Aye, if you need full post-mortem debugging support, then updating the public 
API of the actual traceback objects based on the current ctypes-based 
workaround does seem like a better path forward.

TracebackException and friends would more come into play for the "make 
traceback printing easier to customise" part of your presentation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-06-05 Thread Nathaniel Smith

Nathaniel Smith added the comment:

My understanding is that the major difference between a real traceback object 
and a TracebackException object is that the latter is specialized for printing, 
so it can be lighter weight (no pinning of frame objects in memory), but loses 
some utility (can't do post-mortem debugging).

If that's right, then that's definitely not a solution, because trio and jinja2 
and import errors all need to support post-mortem debugging.

I'm not against the idea of defining a traceback protocol, but it seems like a 
lot of work when the existing traceback objects are already perfectly good 
container objects that are just missing a few simple features.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-06-05 Thread Nick Coghlan

Nick Coghlan added the comment:

Rather than allowing this on tracebacks directly, I'd prefer to build on the 
"TracebackException" work and allow traceback summaries in all the places where 
we currently require real tracebacks (including exception __traceback__ 
attributes): 
https://docs.python.org/3/library/traceback.html#tracebackexception-objects

The essential requirement here would be to abstract out a "traceback protocol" 
from the current concrete traceback objects, and adapt affected parts of the 
interpreter (such as the traceback display on shutdown) to use that abstract 
protocol when dealing with a non-native traceback object.

--
nosy: +giampaolo.rodola, haypo, yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-06-05 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Uh, please ignore the random second paste of the jinja2 URL in the middle of 
the second to last paragraph.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-06-05 Thread Nathaniel Smith

New submission from Nathaniel Smith:

Currently, traceback objects don't expose any public constructor, are 
immutable, and don't have a __dict__ or allow subclassing, which makes it 
impossible to add extra annotations them.

It would be nice if these limitations were lifted, because there are rare but 
important cases where code needs to manipulate tracebacks directly, and 
currently these have to use awful stuff like ctypes. For example:

Jinja2:
https://github.com/pallets/jinja/blob/bec0065c4e7e89e7d893eda7840ba0219824b23c/jinja2/debug.py#L298-L372

Trio:
https://github.com/python-trio/trio/blob/496493afecc22d7d1a17175b6a2748a9c3510066/trio/_core/_multierror.py#L233-L318

(Notice that on PyPy there are no ctypes, but instead they have special 
extension that's supported for this case only to keep jinja2 working.)

For the above cases, what's needed is the ability to instantiate and assign to 
the fields of traceback objects.

In addition, in trio I'd like to be able to annotate traceback objects so that 
the traceback printing machinery can do things like hide "internal" tracebacks, 
or highlight places where exceptions jumped between tasks. This would be much 
easier if there were some way to attach data to tracebacks. Probably it doesn't 
make sense for traceback objects to have a __dict__ by default for speed/memory 
reasons, but we could add a dedicated metadata slot that is normally empty but 
can have arbitrary data assigned, or if they allowed subclassing then I could 
add a __dict__ in a subclass

I'm CC'ing the "import machinery" interest list, because my understanding is 
that with the new import system there's a similar desire to hide "internal" 
traceback frames, and while the features requested in this bug report won't 
solve that problem directly they might (are intended to) provide some useful 
machinery for it. Feel free to un-CC if I'm wrong :Jinja2:
https://github.com/pallets/jinja/blob/bec0065c4e7e89e7d893eda7840ba0219824b23c/jinja2/debug.py#L298-L372
-).

I think that this should be very straightforward to implement: it's just that 
no-one ever implemented setters etc. for tracebacks.

--
components: Interpreter Core
messages: 295235
nosy: brett.cannon, eric.snow, ncoghlan, njs
priority: normal
severity: normal
status: open
title: Allow traceback objects to be instantiated/mutated/annotated
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com