FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed `__cause__` on overload bind failure and array conversion by lostmsu · Pull Request #1442 · pythonnet/pythonnet · GitHub

Fixed __cause__ on overload bind failure and array conversion - #1442

Merged
lostmsu merged 1 commit into
pythonnet:masterfrom
losttech:PR/PythonDebugBuild
Apr 14, 2021
Merged

Fixed __cause__ on overload bind failure and array conversion#1442
lostmsu merged 1 commit into
pythonnet:masterfrom
losttech:PR/PythonDebugBuild

Conversation

lostmsu commented Apr 13, 2021

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

Calls to PyObject_Str and PyObject_Repr should not be made with error set, as they may clear it. When using debug build of Python, this causes an assertion at runtime, preventing use of Python.NET.

Does this close any currently open issues?

Partial fix for #1412

filmor commented Apr 13, 2021

Copy link
Copy Markdown
Member

As there are probably a few more places like this, shouldn't we add a convenience IDisposable that does the fetching in startup and restores on Dispose?

lostmsu commented Apr 13, 2021
edited
Loading

Copy link
Copy Markdown
Member Author

@filmor I do not think it is justified at this moment: with just these two places I don't get any more related assertion failures of that nature with debug builds of Python throughout out test suite.

}

value.Append(": ");
Runtime.PyErr_Fetch(out var errType, out var errVal, out var errTrace);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This might also be a fix for #1371

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It might let us reenable the test case, but the issue that caused it will still be there.

BadSingleton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. However this is something easy to miss. It'd be great if we had pythonnet in debug (without Py_Debug) be able to detect known cases.

lostmsu force-pushed the PR/PythonDebugBuild branch from 650ac77 to a95945b Compare April 14, 2021 00:33
lostmsu merged commit 16f04e9 into pythonnet:master Apr 14, 2021
lostmsu deleted the PR/PythonDebugBuild branch April 14, 2021 00:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL