Stack trace for the statement that raises the SytemError:
>>> mytestRun.Field.Item['RN_USER_01'] = 'abc'
Object reference not set to an instance of an object.
at
IronPython.Runtime.Types.ReflectedGetterSetter.CallTarget(CodeContext
context, SiteLocalStorage`1 storage, MethodInfo[] targets, Object
instance, Object[] args)
at
IronPython.Runtime.Types.ReflectedGetterSetter.CallSetter(CodeContext
context, SiteLocalStorage`1 storage, Objectinstance, Object[] args,
Object value)
at IronPython.Runtime.Types.ReflectedIndexer.SetValue(CodeContext
context, SiteLocalStorage`1 storage, Object[] keys, Object value)
at
IronPython.Runtime.Types.ReflectedIndexer.set_Item(SiteLocalStorage`1
storage, Object[] key, Object value)
at _stub_$1209##669(Closure , CallSite , Object , String , String )
at
Microsoft.Scripting.Actions.MatchCaller.Call3[T0,T1,T2,TRet](Func`5
target, CallSite site, Object[] args)
at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args)
at
Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite
site, T0 arg0, T1 arg1, T2 arg2)
at <module>$1203##663(Closure , Scope , LanguageContext )
at
Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression
code, Scope scope)
at Microsoft.Scripting.ScriptCode.Run(Scope scope)
at
IronPython.Hosting.PythonCommandLine.<>c__DisplayClass1.<RunOneInteraction>b__0()
SystemError: Object reference not set to an instance of an object.
Dino Viehland wrote:
What's the stack trace for the object reference exception if you run with the
-X:ExceptionDetail option?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rodney Howeedy
Sent: Friday, December 05, 2008 3:22 PM
To: Discussion of IronPython
Subject: Re: [IronPython] 'DispPropertyGet' error returned from read-write COM
interop property
I found that one and tried before. I didn't have any luck:
>>> mytestRun.Field.Item['RN_USER_01'] = 'abc'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: Object reference not set to an instance of an object.
>>> print mytestRun.Field.Item['RN_USER_01']
None
I couldn't decipher the error so I couldn't figure out what I'm doing
wrong.
I suspect the folks on this list can. =)
Dino Viehland wrote:
Does:
mytestRun.Field.Item['RN_USER_01'] = 'abc'
work?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rodney Howeedy
Sent: Friday, December 05, 2008 3:11 PM
To: [email protected]
Subject: [IronPython] 'DispPropertyGet' error returned from read-write COM
interop property
Hi everyone,
I encounter an error with 2.0 RC2 that didn't occur in the same
IronPython code on 2.0 Beta 3.
I use a factory object from a COM interop assembly that has a read-write
property named "Field". I get a TypeError when I assign a value to this
property (read-write):
>>> mytestRun.Field['RN_USER_01'] = 'abc'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'DispPropertyGet' object is unsubscriptable
>>> print mytestRun.Field['RN_USER_01']
None
I imported the same COM interop assembly that worked with 2.0 Beta3.
The interop was converted with tlbimp.exe from a COM API .dll. Here's
the 2.0 Beta3 output:
>>> mytestRun.Field['RN_USER_01'] = 'abc'
>>> print mytestRun.Field['RN_USER_01']
abc
My best guess is that IronPython 2.0 RC2 interprets the property as
read-only even though the COM interop assembly defines the property
read-write. The error occurs in IronPython 2.0 RC2 with every COM
interop object with the read-write "Field" property.
I can read the default assigned value but cannot assign anything. Any
ideas? I'm fresh out of them after trying many permutations of the syntax.
Thank you,
Rodney Howeedy
Staff Engineer, Sun Microsystems
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com