You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python.Runtime.PythonException: DocumentFormat.OpenXml.Packaging.SlideLayoutPart value cannot be converted to T
The above exception was the direct cause of the following exception:
System.ArgumentException: DocumentFormat.OpenXml.Packaging.SlideLayoutPart value cannot be converted to T in method T AddPart[T](T, System.String) ---> Python.Runtime.PythonException: DocumentFormat.OpenXml.Packaging.SlideLayoutPart value cannot be converted to T
--- End of inner exception stack trace ---
The above exception was the direct cause of the following exception:
System.AggregateException: One or more errors occurred. (DocumentFormat.OpenXml.Packaging.SlideLayoutPart value cannot be converted to T in method T AddPart[T](T, System.String)) ---> System.ArgumentException: DocumentFormat.OpenXml.Packaging.SlideLayoutPart value cannot be converted to T in method T AddPart[T](T, System.String) ---> Python.Runtime.PythonException: DocumentFormat.OpenXml.Packaging.SlideLayoutPart value cannot be converted to T
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.ArgumentException: DocumentFormat.OpenXml.Packaging.SlideLayoutPart value cannot be converted to T in method T AddPart[T](T, System.String) ---> Python.Runtime.PythonException: DocumentFormat.OpenXml.Packaging.SlideLayoutPart value cannot be converted to T
--- End of inner exception stack trace ---<---
The above exception was the direct cause of the following exception:
...
slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
TypeError: No method matches given arguments for AddPart: (<class 'DocumentFormat.OpenXml.Packaging.SlideLayoutPart'>, <class 'str'>)
mcve:
importclrclr.AddReference('DocumentFormat.OpenXml')
fromDocumentFormat.OpenXml.Packagingimport (
SlideLayoutPart,
SlideMasterPart,
)
slideLayoutPart1: SlideLayoutPart=SlideLayoutPart()
slideMasterPart1: SlideMasterPart=SlideMasterPart()
slideMasterPart1.AddPart(slideLayoutPart1) # this works OKslideMasterPart1.AddPart(slideLayoutPart1, "rId1") # this raises a runtime exception
So it's only when the second (string) parameter is provided, the first can't be converted. Looks like a pythonnet issue.
The text was updated successfully, but these errors were encountered:
Prior to this change if method had multiple generic overloads, only 1 of them could be matched (whichever one reflection would return first)
Now MethodBinder.MatchParameters returns all matching generic overloads, not just the first one.
fixespythonnet#1522
Prior to this change if method had multiple generic overloads, only 1 of them could be matched (whichever one reflection would return first)
Now MethodBinder.MatchParameters returns all matching generic overloads, not just the first one.
fixes#1522
Environment
Details
Trying to re-implement example from here using Python.
Everything works fine except this line of code:
There are two definitions of
AddPart
:slideMasterPart1.AddPart.Overloads
output:What works:
What doesn't work:
Error:
mcve:
So it's only when the second (string) parameter is provided, the first can't be converted. Looks like a pythonnet issue.
The text was updated successfully, but these errors were encountered: