[issue26823] Shrink recursive tracebacks

2016-08-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset a7f3678f9509 by Victor Stinner in branch 'default': Fix reference leak in tb_printinternal() https://hg.python.org/cpython/rev/a7f3678f9509 -- ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-08-15 Thread Nick Coghlan
Changes by Nick Coghlan : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue26823] Shrink recursive tracebacks

2016-08-15 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks again Emanuel - I incorporated your suggested changes along with some other ones I had already made locally. -- ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-08-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 86d062edb6ab by Nick Coghlan in branch 'default': Issue #26823: fix traceback abbreviation docs https://hg.python.org/cpython/rev/86d062edb6ab -- ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-08-15 Thread Emanuel Barry
Emanuel Barry added the comment: Doc patch. -- stage: resolved -> patch review status: closed -> open Added file: http://bugs.python.org/file44120/short_tracebacks_doc_1.patch ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-08-15 Thread Berker Peksag
Berker Peksag added the comment: > So I'll tweak that [...] Hi Nick, could you also tweak the usage of versionchanged directive? :) +.. versionchanged:: 3.6 + +Long sequences of repeated frames are now abbreviated. Description line needs to be indented: .. versionchanged:: 3.6

[issue26823] Shrink recursive tracebacks

2016-08-15 Thread Nick Coghlan
Nick Coghlan added the comment: As Emanuel noted, this is a new feature, and hence won't be backported to any earlier versions. For What's New, it turns out that didn't quite render the way I expected, since the "StackSummary" class reference is missing in addition to the "traceback" module

[issue26823] Shrink recursive tracebacks

2016-08-14 Thread Emanuel Barry
Emanuel Barry added the comment: This is irrelevant to this issue. -- ___ Python tracker ___ ___

[issue26823] Shrink recursive tracebacks

2016-08-14 Thread Decorater
Decorater added the comment: 3.6 would make thread exceptions not print out to console or at least be configured to make them logged with the logging module in threading.py for 3.6? because I would like it to use the logger. Oh and how can I get the logs from the logging module from 2

[issue26823] Shrink recursive tracebacks

2016-08-14 Thread Emanuel Barry
Emanuel Barry added the comment: Pretty sure this falls under the "New features" category, and as such can't be applied on 3.5. -- ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-08-14 Thread Decorater
Decorater added the comment: Be nice if 3.5 had this as well. As it can be very annoying at times. (Not to mention thread exceptions just cant be handled by anyone's code unless you modify threading.py -- nosy: +Decorater ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-08-14 Thread Emanuel Barry
Emanuel Barry added the comment: Awesome, thanks! The "What's new" entry is a bit confusing though; to a casual observer it might look like the `traceback` module was updated but the normal behaviour wasn't changed. -- ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-08-14 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the patch, Emanuel! The merged patch uses your implementation and the test cases you designed, with the following changes: - I refactored the test cases so the traceback module gets tested on all implementations, with only the CPython builtin

[issue26823] Shrink recursive tracebacks

2016-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5a2ff215e841 by Nick Coghlan in branch 'default': Issue #26823: Abbreviate recursive tracebacks https://hg.python.org/cpython/rev/5a2ff215e841 -- nosy: +python-dev ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-08-14 Thread Nick Coghlan
Nick Coghlan added the comment: I'm at the PyCon AU sprints today, and will take a look at getting this merged. -- assignee: ebarry -> ncoghlan stage: patch review -> commit review ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-08-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue26823] Shrink recursive tracebacks

2016-08-13 Thread Emanuel Barry
Emanuel Barry added the comment: Is it possible to get this in in time for 3.6.0a4? The feature itself hasn't been touched in about 4 months, only tests have been tweaked since. -- ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-07-24 Thread Emanuel Barry
Emanuel Barry added the comment: Alright, I think this works now. No more magic number, just some regex as well as checking that the number is in range(sys.getrecursionlimit()-50, sys.getrecursionlimit()) :) -- Added file: http://bugs.python.org/file43866/short_tracebacks_7.patch

[issue26823] Shrink recursive tracebacks

2016-07-24 Thread Nick Coghlan
Nick Coghlan added the comment: Since you're ultimately comparing a list of lines, it may be useful to split the checks into two parts: 1. Check the deterministic lines 2. Check the variable line (which should always be at index -2 in the splitlines() result) For the recursion error, we're

[issue26823] Shrink recursive tracebacks

2016-07-24 Thread Emanuel Barry
Emanuel Barry added the comment: Thank you Nick for the comments! Updated patch attached. The new patch uses inspect.stack() to calculate the total stack size, but I'm unable to get the exact number needed, and I found that I'm either 19 or 20 above (depending on whether I run it with -m or

[issue26823] Shrink recursive tracebacks

2016-07-24 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks Emanuel, and sorry for the long delay in getting a review! My main substantive comment is that the approach of hardcoding the recursion count won't work cross platform, as the default recursion limit is set differently depending on how the platform's C

[issue26823] Shrink recursive tracebacks

2016-07-24 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: ebarry -> ncoghlan stage: patch review -> commit review ___ Python tracker ___

[issue26823] Shrink recursive tracebacks

2016-07-23 Thread Emanuel Barry
Emanuel Barry added the comment: Turns out there's already some functions in _testcapi that do this, great! Here's an updated patch actually testing the C implementation (and the tests pass, obviously :) -- Added file: http://bugs.python.org/file43843/short_tracebacks_5.patch

[issue26823] Shrink recursive tracebacks

2016-07-23 Thread Emanuel Barry
Emanuel Barry added the comment: After discussing with someone, I realized that the tests actually test the Python implementation twice, and never the C implementation (since I use traceback.print_exc() to "test" the C implementation). I don't think it's possible to both catch the output from

[issue26823] Shrink recursive tracebacks

2016-07-06 Thread Emanuel Barry
Emanuel Barry added the comment: Sorry for the delay, but here's a patch with updated tests after Nick's suggestions. It should be ready to merge now. (I'm having some failures in test_traceback, but they fail even without my patch) -- Added file:

[issue26823] Shrink recursive tracebacks

2016-05-16 Thread Emanuel Barry
Emanuel Barry added the comment: I realize that I haven't given any update on this since my last patch. I figured that trying to detect when an arbitrary number of functions call each other in a convoluted call chain isn't a very good idea. Not only is it way beyond my abilities, but I think

[issue26823] Shrink recursive tracebacks

2016-04-22 Thread Emanuel Barry
Emanuel Barry added the comment: New version with tests now, I test both the C and Python implementations. -- assignee: -> ebarry Added file: http://bugs.python.org/file42570/short_tracebacks_3.patch ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Nick Coghlan
Nick Coghlan added the comment: For testing, you can create a recursive scenario that terminates with an exception after a defined number of iterations: >>> def f(counter): ... if counter: ... f(counter-1) ... else: ... raise RuntimeError ... >>> f(3) Traceback (most

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Emanuel Barry
Emanuel Barry added the comment: Attached patch also modifies Lib/traceback.py to present identical behaviour, and changes "Previous message" to "Previous line". I'll postpone the more complex implementation of that, and might just not do it as it's indeed better to avoid bugs where we're

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for the simple approach, and deferring the mutual recursion support - it's desirable to keep traceback printing simple in order to minimise the chance for failures during the display process. In addition to the C implementation of traceback printing, the

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Emanuel Barry
Emanuel Barry added the comment: The message is mostly a placeholder, but "message" is singular so I figured it would be obvious. But alas, if you are confused, others might be too. Propositions for a better message are welcome :) I'll attempt to make it track chained calls (or mutually

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Xiang Zhang
Xiang Zhang added the comment: With the current patch, a simple test gives the traceback: Traceback (most recent call last): File "", line 1, in File "", line 2, in test File "", line 2, in test File "", line 2, in test [Previous message repeated 995 more times] RecursionError:

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +georg.brandl ___ Python tracker ___ ___

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Ethan Furman
Ethan Furman added the comment: If you can, give it a go. Make it a new patch, though -- don't delete the existing one. -- ___ Python tracker ___

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Ethan Furman
Changes by Ethan Furman : -- type: -> behavior ___ Python tracker ___ ___

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Emanuel Barry
Emanuel Barry added the comment: Yes, can't handle mutually recursive functions. I could maybe check for the last two or three functions, but that seems like unnecessary work for something that might not happen as often (I can see it being the case with e.g. __getattr__ though). If enough

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Chris Angelico
Chris Angelico added the comment: By "doesn't keep track of call chains", you mean that it can't handle mutually-recursive functions, right? Still useful. -- nosy: +Rosuav ___ Python tracker

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___

[issue26823] Shrink recursive tracebacks

2016-04-21 Thread Emanuel Barry
New submission from Emanuel Barry: I recently suggested on Python-ideas ( https://mail.python.org/pipermail/python-ideas/2016-April/039899.html ) to shrink long tracebacks if they were all the same noise (recursive calls). Seeing as the idea had a good reception, I went ahead and implemented