Re: [IronPython] About Python TextTestRunner
You can either use pipe the stdout through tee to save it in a file too, or in a more pythonic way define a file-like object that prints to stdout as you write to it: import sys class PrintStream(object): def __init__(self, file): self.out = file def write(self, b): self.out.write(b) sys.stdout.write(b) unittest.TextTestRunner(PrintStream(file),verbosity=2).run(suite) Hope that helped, Orestis Deepali Abhyankar wrote: Hi I used following code to write result on different media. unittest.TextTestRunner(verbosity=2).run(suite) : Writes result to StdOutput unittest.TextTestRunner(file,verbosity=2).run(suite) : Writes result to file But what should I do to write test result on file as well as StdOutput, on single go? Is there any other method to do this? Regards Deepali -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Hardy Sent: Friday, December 05, 2008 7:27 AM To: Discussion of IronPython; [EMAIL PROTECTED] Subject: [IronPython] NWSGI 0.7 released NWSGI 0.7 is now available. This version adds support for ASP.NET sessions, fixes Unicode handling, and adds support for wildcard mappings. It is available at http://www.codeplex.com/NWSGI/Release/ProjectReleases.aspx?ReleaseId=20189. What is NWSGI? NWSGI is an ASP.NET HttpHandler that implements the Python WSGI spec (PEP 333 - http://www.python.org/dev/peps/pep-0333/) for interfacing web servers and web frameworks using IronPython. There are still some IronPYthon bugs that prevent everything from working, but some things do. For more details on this release, see http://jdhardy.blogspot.com/2008/12/nwsgi-07-released.html. - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com DISCLAIMER == This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- Orestis Markou Software Engineer, Resolver Systems Ltd. [EMAIL PROTECTED] +44 (0) 20 7253 6372 ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
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: users@lists.ironpython.com 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 Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] 'DispPropertyGet' error returned from read-write COM interop property
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: users@lists.ironpython.com 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 Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] 'DispPropertyGet' error returned from read-write COM interop property
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.RunOneInteractionb__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: users@lists.ironpython.com 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 Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] 'DispPropertyGet' error returned from read-write COM interop property
This might be broken but the output of dir(mytestRun) might be helpful as well to make sure (e.g. maybe there'll be some set_Field method or something). But I suspect you might want to pass the -X:PreferComInteropAssembly command line option and I think that'll restore the beta 3 behavior for you. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rodney Howeedy Sent: Friday, December 05, 2008 3:35 PM To: Discussion of IronPython Subject: Re: [IronPython] 'DispPropertyGet' error returned from read-write COM interop property 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.RunOneInteractionb__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: users@lists.ironpython.com 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 Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users
[IronPython] Welcome David DiCato
Please welcome David DiCato to the IronPython team. He has his first shelveset in the Snap queue (queue.__init__ calls clear) already. You should hopefully hear more from him in the mailing list. Here is his intro in his own words. Hi everyone, I'm David DiCato, the new Dev on the IronPython team. I grew up in Surf City (i.e. Huntington Beach, CA) and moved just 50 miles north to go to school in Pasadena. At Caltech, I earned my BS in Computer Science, applied to Microsoft after a short break, and the rest is history. Although I have never touched a surf board, I like to dabble in snowboarding, as well as piano, guitar and biking, although I'm good at none of these things. I'm also a big fan of music, incl. classic rock, punk and electronic, and film, incl. Kubrick, Hitchcock and Scorsese. Thanks, Shri ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] 'DispPropertyGet' error returned from read-write COM interop property
Thank you for that work around... now I can start the weekend. :-D There used to be a mytestRun.Field.SetValue in the dir() listing in Beta3: dir(mytestRun.Field) ['Equals', 'GetHashCode', 'GetType', 'GetValue', 'Item', 'ReferenceEquals', 'SetValue', 'ToString', '__class__', '__delattr__', '__delete__', '__doc__', '__get_ _', '__getattribute__', '__getitem__', '__hash__', '__init__', '__name__', '__new__', '__objclass__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__'] But Field.SetValue disappeared in RC2: dir(mytestRun.Field) ['ComMethodDesc', 'DispatchObject', 'Equals', 'GetHashCode', 'GetMetaObject', 'GetType', 'Item', 'MemberwiseClone', 'Ref erenceEquals', 'ToString', '__class__', '__delattr__', '__doc__', '__eq__', '__getattribute__', '__getitem__', '__hash__ ', '__init__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__'] I didn't know what the Dev team had in mind. Some things became more straightforward but I couldn't get this critical piece to work. Additional dir() output on RC2: dir(mytestRun.Field.Item) ['Equals', 'GetHashCode', 'GetType', 'GetValue', 'Item', 'MemberwiseClone', 'ReferenceEquals', 'SetValue', 'ToString', ' __class__', '__delattr__', '__delete__', '__doc__', '__get__', '__getattribute__', '__getitem__', '__hash__', '__init__' , '__name__', '__new__', '__objclass__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str __'] I already found and tried Item's SetValue but encountered the same SystemError. I tried to find the expected inputs: print mytestRun.Field.Item.SetValue.__doc__ bool SetValue(self, CodeContext context, SiteLocalStorage[CallSite[Func[CallSite, CodeContext, object, Array[object], ob ject]]] storage, Array[object] keys, object value) I may have gotten close, but no cigar: mytestRun.Field.Item.SetValue(Array[object]([RN_DURATION]),10) Traceback (most recent call last): File stdin, line 1, in module SystemError: Object reference not set to an instance of an object. The requested 2.0 RC2 output: dir(mytestRun) ['Attachments', 'AutoPost', 'BPStepParamFactory', 'CancelRun', 'CopyDesignSteps', 'CopyStepsToTest', 'CreateObjRef', 'Eq uals', 'ExtendedStorage', 'Field', 'GetHashCode', 'GetLifetimeService', 'GetType', 'HasAttachment', 'History', 'ID', 'In itializeLifetimeService', 'IsLocked', 'LockObject', 'MemberwiseClone', 'Modified', 'Name', 'Params', 'Post', 'ReferenceE quals', 'Refresh', 'ResolveStepsParameters', 'ResultLocation', 'Status', 'StepFactory', 'TestId', 'TestInstance', 'TestI nstanceID', 'TestSetID', 'ToString', 'UnLockObject', 'Undo', 'Virtual', '__class__', '__delattr__', '__doc__', '__getatt ribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__'] Thank you, Rodney Howeedy Staff Engineer, Sun Microsystems Dino Viehland wrote: This might be broken but the output of dir(mytestRun) might be helpful as well to make sure (e.g. maybe there'll be some set_Field method or something). But I suspect you might want to pass the -X:PreferComInteropAssembly command line option and I think that'll restore the beta 3 behavior for you. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rodney Howeedy Sent: Friday, December 05, 2008 3:35 PM To: Discussion of IronPython Subject: Re: [IronPython] 'DispPropertyGet' error returned from read-write COM interop property 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.RunOneInteractionb__0() SystemError: Object reference not set to an instance of an object. Dino