Victor

Results 365 comments of Victor

Do you or your tests use multiple `AppDomain`? The log clearly indicates error is `AppDomain`-related. Could it be, that your tests initialize Python.NET in multiple domains at the same time?

Not really a solution to the root cause, but if you never use AppDomains, you might want to try running `nunit3-console.exe` with `--domain=None` parameter.

Hm, @pkthong can you double check your code? When I do `str(Int32)` in the latest build, I get ``, not ``.

This is not a bug. If your event handler is executed on a different thread and GIL is not released, it will block waiting for it. Threading section of Wiki...

I am unsure if that's the problem you are seeing, but threading is complicated. You should check on https://en.wikipedia.org/wiki/Consistency_model The easiest thing to do if you don't want to get...

@nitz well, did you try locking access to `threadState` like I suggested?

OK, got the problem now. `PythonEngine` installs its own `ProcessExit` handler. In one of the cases, yours executes before the internal one, in another - after.

Considering our own shutdown on `ProcessExit` works fine, I believe you simply need to skip `EndAllowThreads`. This is a part of C embedding API, that might have surprising undocumented behavior...

If somebody wants to take on it, this test shows simple use of `PyBuffer`: [TestBufferRead](https://github.com/pythonnet/pythonnet/blob/88850f5dc9fed1658c23ff2088ae66d3e7676bfb/src/embed_tests/TestPyBuffer.cs#L51) And this is the method that needs to be changed: [Converter.ToArray](https://github.com/pythonnet/pythonnet/blob/37f12359e0ccc925468ec49cda04330f46e1e981/src/runtime/Converter.cs#L874)