Add traceback information to exception#545
Conversation
|
Tested with Python 3.5 64-bit on Windows 7 Pro. Example output is now: GetPreferredSize
Traceback (most recent call last):
File "t.py", line 29, in
main()
File "t.py", line 24, in main
form = StatusWindow()
File "t.py", line 19, in __init__
self.Controls.Add(_StagesGroup())
File "t.py", line 14, in GetPreferredSize
print("GetPreferredSize",xyz)
NameError: name 'xyz' is not defined
|
Codecov Report
@@ Coverage Diff @@
## master #545 +/- ##
==========================================
+ Coverage 68.55% 77.21% +8.66%
==========================================
Files 1 62 +61
Lines 283 5596 +5313
Branches 0 897 +897
==========================================
+ Hits 194 4321 +4127
- Misses 89 982 +893
- Partials 0 293 +293
Continue to review full report at Codecov.
|
|
@testrunner123 there is one conflict in changelog.md and also no testing included. |
|
@denfromufa I added line to CHANGELOG.md, but I can|t understand where conflict is. It was shown that merge automatically is possible. |
|
I have no write-access to pythonnet:master. |
|
Travis build is broken because it failed to install mono 4.x packages. |
|
@testrunner123 those Mono + Travis CI issues have been fixed in @dmitriyse pull requests, which you can cherry pick into your commit. |
The problem is if I try to make a pull request to my branch or master then I am unable to do it. It says: everything is update. I am using web interface. |
|
@testrunner123 you can only reliably cherry pick from git user interface, e.g. I use sourcetree and @vmuriart uses gitextensions: https://github.com/gitextensions/gitextensions Don't try to do it from command-line :) Only web interface in gitlab supports cherry picking, GitHub and BitBucket do not support this. |
|
@testrunner123 this should now pass the CI |
|
THX |
|
This isn't quite right (it wasn't before, so you didn't introduce it but you can fix it :)). The documentation of PyErr_Restore states that you are giving up the references that you pass on, however, the |
|
I guess you propose to call pe.PythonException.Restore() instead of Runtime.PyErr_Restore(). But this will also take GIL lock, that is already taken at this time ? I just do not have enough knowledge about python interpreter to make a change and test it... |
|
@filmor can you clarify your suggestion a little bit more for @testrunner123 and for me? |
|
@filmor i suggest to merge this PR and open a separate issue for your suggestion? |
|
This PR decrefs an object that we hand over to another function, I don't think it's a good idea to merge it like this. I'll see whether I can do the needed changes. |
|
So, from a review point of view, this is fine by me, we just need to fix the whole refcount situation, introducing another Incref before calling restore should be enough. |
|
@filmor what is going on today :) |
What does this implement/fix? Explain your changes.
Attach traceback information to newly created exception.
Does this close any currently open issues?
#542
Any other comments?
Checklist
Check all those that are applicable and complete.
AUTHORSCHANGELOG