Re: [IronPython] Code Access Security?

2010-04-14 Thread Bruce Bromberek
Does a.py have any module imports? I always find I have to mess around with standard python modules being available in order for my DLL's to work when I distribute exe's. But then I'm usually using ODBC connections to *.mdb files On Wed, Apr 14, 2010 at 4:05 AM, Neidhoo Xaphier wrote: > I invok

Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight

2010-04-14 Thread David Matson
Thanks for all your help Jimmy. IronPython fits the role perfectly for our scripting engine. Keep up the great work! On Wed, Apr 14, 2010 at 4:53 PM, Jimmy Schementi wrote: Did you see the report of my problem with the RichTextBox with IronPython 2.6.1 RC. Do you see the same problem? >

Re: [IronPython] ssl server mode issue

2010-04-14 Thread qiuyingbo
I'm doing a web browser to ironpython connection. It is difficult to explain what I am doing,  I'm hacking a http proxy that inherit BaseHTTPServer.BaseHTTPRequestHandler. Next code snippets show how I support HTTPS proxy.. (Linux version run well)   class ProxyHandler(BaseHTTPServer.BaseHTTPReq

Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight

2010-04-14 Thread Jimmy Schementi
>>> Did you see the report of my problem with the RichTextBox with IronPython >>> 2.6.1 RC. Do you see the same problem? Yes, I can repro it using both IronPython binaries built against SL3 and SL4; it appears that the RichTextBox.ctor() fails to be called via reflection. We call via reflection

Re: [IronPython] ssl server mode issue

2010-04-14 Thread Dino Viehland
Could you include the Python code which is doing the connections? Are you doing an IronPython to IronPython connection? Or are you connecting to a server or localhost running a server outside of IronPython? > -Original Message- > From: users-boun...@lists.ironpython.com [mailto:users- >

Re: [IronPython] 2.6.1 implements ssl module, but it crash...

2010-04-14 Thread Dino Viehland
My guess is that the exception we’re reporting is either of the wrong type or doesn’t have the right information. ssl.SSLSocket.read is catching SSLError and it looks like we’d probably throw a socket.SocketError instead. I’ve opened this bug: http://ironpython.codeplex.com/WorkItem/View.aspx?

Re: [IronPython] Building via AST

2010-04-14 Thread Dino Viehland
Try calling SetLoc on the FunctionDefinition and also try setting the Header property. I think if it’s some reasonable span it’ll work. From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Justin Chase Sent: Wednesday, April 14, 2010 3:35 PM To: Disc

Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight

2010-04-14 Thread David Matson
I couldn't add the references because the assemblies I was trying to add weren't Silverlight assemblies. My issue remains that I need assemblies built against Silverlight 4 because I'm trying to using ExpandoObjects (System.Dynamic) in conjunction with IronPython. If I use the current Silverlight a

[IronPython] ssl server mode issue

2010-04-14 Thread qiuyingbo
I create a self-signed certificate by OpenSSL. It rasie: File "C:\Program Files\IronPython 2.6\Lib\ssl.py", line 346, in wrap_socket return SSLSocket(sock, keyfile=keyfile, certfile=certfile, File "C:\Program Files\IronPython 2.6\Lib\ssl.py", line 118, in __init__ self.do_handshake()

Re: [IronPython] Building via AST

2010-04-14 Thread Justin Chase
Ok awesome! So now I have: dynamic example = globals["Example"]; dynamic instance = example(); Console.WriteLine(instance.Do()); But I'm getting an exception about a line number. Any idea how I can get past that? I've tried a bunch of things but I'm not sure what's going on. ArgumentOutOfRangeEx

Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight

2010-04-14 Thread Michael Foord
On 14/04/2010 09:29, Jimmy Schementi wrote: [snip...] In general versions of IronPython built against (for example) Silverlight 2 *can* use features from Silverlight 3. (Try Python uses IronPython that was built against Silverlight 2 - but dynamically uses some Silverlight 3 APIs if they are a

Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight

2010-04-14 Thread Jimmy Schementi
Ok - so that makes sense. So to use some C# 4 features with Silverlight and IronPython you *will* need a version of IronPython for Silverlight built specifically against Silverlight 4. I guess that means that apps using that version of IronPython *won't* work in earlier versions of Silverlight.

Re: [IronPython] Building via AST

2010-04-14 Thread Dino Viehland
The problem here is just that you actually have a nested code context when for the top-level code you just need a single global context. Replace the line: var codeContext = new CodeContext( new PythonDictionary()

Re: [IronPython] Building via AST

2010-04-14 Thread Justin Chase
I feel like I'm so close but something isn't quite working. Here is my current code: var runtime = Python.CreateRuntime(); runtime.LoadAssembly(typeof(IExample).Assembly); var engine = runtime.GetEngineByFileExtension(".py"); var context = (PythonContext)HostingHelpers.GetLanguageContext(engi

Re: [IronPython] is the performance gap between C and CPython a decent comparision between the performance gap between C# and IronPython?

2010-04-14 Thread Michael Foord
Hello Pablo, Python is an expressive and highly dynamic language. As such it is typically possible to achieve things in less lines of code and fewer layers of architecture when writing idiomatic Python as compared to idiomatic C#. With less code often comes better performance. This really has

Re: [IronPython] is the performance gap between C and CPython a decent comparision between the performance gap between C# and IronPython?

2010-04-14 Thread Dino Viehland
It's certainly true that we both inherit a lot of characteristics from our underlying platform. For example we get a JIT which we can use to compile Python code whenever we want it and they get a highly optimizing ahead of time compiling which they can use for optimized data structure implement

Re: [IronPython] is the performance gap between C and CPython a decent comparision between the performance gap between C# and IronPython?

2010-04-14 Thread Vernon Cole
Pablo: It depends mostly on how you define "performance" and how important that is in any given case. My brother relates the story of a fellow in a lunch room who was complaining loudly that car manufactures could turn out more powerful engines if they wanted to. Brother's friend, a professiona

[IronPython] is the performance gap between C and CPython a decent comparision between the performance gap between C# and IronPython?

2010-04-14 Thread Pablo Dalmazzo
Hi there, I was replied in one of my topics in StackOverflow that the gap performance between C with cPython is comparable with the performance gap between with C# with IronPython by some guy I dont know who he is. It could be a newbie, it could not. Now since the base language/platform

Re: [IronPython] 2.6.1 implements ssl module, but it crash...

2010-04-14 Thread qiuyingbo
I noticed that there is a wrap_socket() argument: suppress_ragged_eofsThe parameter suppress_ragged_eofs specifies how the SSLSocket.read() method should signal unexpected EOF from the other end of the connection. If specified as True (the default), it returns a normal EOF in response to unexpe

Re: [IronPython] Code Access Security?

2010-04-14 Thread Neidhoo Xaphier
I invoke it this way: import clr clr.AddReference("a.dll") import a con = a.connect() It is the last line which creates the SystemError. I don't have this issue if I use/import a.py directly and not the compiled a.dll. But I need to provide it as a.dll. Regards, Xaphier 2010/4/14 Jimmy Schemen

Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight

2010-04-14 Thread Michael Foord
On 14/04/2010 09:08, Jimmy Schementi wrote: Doesn't look like IronPython4.sln is there, so I stand corrected. Also, doesn't look like the IronRuby repo has the latest sources either; for some reason our external source repos "main" branches aren't as uptodate as their servicing branches. I'll

Re: [IronPython] Marking an IronPython class as serializable

2010-04-14 Thread Jimmy Schementi
Take a look at the clrtype sample; it shows how to use .NET attributes on python classes, such as Serializable. http://ironpython.codeplex.com/releases/view/36280#DownloadId=116513 ~Jimmy On Apr 13, 2010, at 5:42 AM, "Pablo Dalmazzo" mailto:pablodalm...@hotmail.com>> wrote: Hi, I need to mar

Re: [IronPython] Code Access Security?

2010-04-14 Thread Jimmy Schementi
ipy,exe isn't running with any special permissions. How are you invoking the code in a.dll? ~Jimmy On Apr 13, 2010, at 7:28 AM, "Neidhoo Xaphier" wrote: > Hello, > > I created an DLL-File 'a.dll' from my IronPython module/library 'a.py'. This > module uses SqlClient functions. While 'a.py' i

Re: [IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight

2010-04-14 Thread Jimmy Schementi
Doesn't look like IronPython4.sln is there, so I stand corrected. Also, doesn't look like the IronRuby repo has the latest sources either; for some reason our external source repos "main" branches aren't as uptodate as their servicing branches. I'll make a private build for Silverlight 4 to unb