Domain reload test cases fixes by BadSingleton · Pull Request #1287 · pythonnet/pythonnet

added 6 commits

November 9, 2020 15:25
The tests are marked as expected failures for now.
Even though it tests nothing.

lostmsu

@BadSingleton

Serialization of System.Type, MemberInfo and MethodBase is now string
based. At deserialization, use reflection to attempt to recreate the
object, which may fail safely instead of throwing a
SerializaitonException during the deserialization of the whoie data
stream. Appropriate Exceptions will now be raised when the Maybe*'s
Value property.

ClasseBase objects are now de-initialized and re-initialized in Reload
mode so that it's tp_dict picks up newly added members and removed
members no longer linger.

ModuleObject clears it's cache and remove cached members from it's
tp_dict.

Minor refactoring and modernization of MethodObject and MethodBinder
Changing a type's attribute causes problem with it's cache. Force the
type to refresh itself when modifying it.
* Revert line endings change in Python.Runtime.csproj
* Split maybe serialize into respective class files
* Name changes for consistency

@BadSingleton

@BadSingleton

@BadSingleton

@BadSingleton

So that we can use that same logic when deserializing Maybe* types

@BadSingleton

BadSingleton

@BadSingleton

@BadSingleton

@BadSingleton

Serialization of System.Type, MemberInfo and MethodBase is now string
based. At deserialization, use reflection to attempt to recreate the
object, which may fail safely instead of throwing a
SerializaitonException during the deserialization of the whoie data
stream. Appropriate Exceptions will now be raised when the Maybe*'s
Value property.

ClasseBase objects are now de-initialized and re-initialized in Reload
mode so that it's tp_dict picks up newly added members and removed
members no longer linger.

ModuleObject clears it's cache and remove cached members from it's
tp_dict.

Minor refactoring and modernization of MethodObject and MethodBinder
Changing a type's attribute causes problem with it's cache. Force the
type to refresh itself when modifying it.
* Revert line endings change in Python.Runtime.csproj
* Split maybe serialize into respective class files
* Name changes for consistency

@BadSingleton

@BadSingleton

@BadSingleton

@BadSingleton

So that we can use that same logic when deserializing Maybe* types

@BadSingleton

Because it can't find the python library

@BadSingleton

@filmor @BadSingleton

@lostmsu @BadSingleton

@lostmsu @BadSingleton

Because tp_clear sets tpHandle to NULL, it can't be used.
Fortunately, we can simply read object's type from pyHandle.

@lostmsu @BadSingleton

… engine shutdown (pythonnet#1260)

pythonnet#1256
pythonnet#1256

During engine shutdown all links from Python to .NET instances are severed. If an instance of CLR class defined in Python survives the shutdown (for example, a reference is stored in static field) and later gets finalized, it will attempt to severe link again, which is an invalid operation.

The fix is to check if the link has already been severed and skip that step during finalization.

@BadSingleton

lostmsu

lostmsu

@BadSingleton

@BadSingleton

This was referenced

Jan 19, 2021