[Mono-list] new IronPython changes reveal Mono bug in accessing protected methods?

Doug Blank doug.blank at gmail.com
Sun May 24 15:49:17 EDT 2009


I'm testing the latest stable build (0.91) of the DLR (Dynamic Language
Runtime) from:

http://dlr.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=21424#ReleaseFiles

with that version of IronPython. Trying this Python code with mono ipy.exe:

import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import *
class MyForm(Form): pass
f = MyForm()
f.SetStyle(ControlStyles.UserPaint, True)

Gives:

Traceback (most recent call last):
TypeError: cannot access protected member SetStyle without a python subclass
of Control

This was also releated to an error that Microsoft had earlier that exposed
protected methods, and now requires the MyForm wrapper, see:

http://dlr.codeplex.com/Thread/View.aspx?ThreadId=57324

I'm using:

$ mono --version
Mono JIT compiler version 134631 (tarball Sat May 23 10:52:56 UTC 2009)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
    TLS:           __thread
    GC:            Included Boehm (with typed GC and Parallel Mark)
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  x86
    Disabled:      none

I've also tried the latest version of IronPython independent of the DLR, and
both versions of ipy.exe under .NET on Windows work fine, so this looks like
a Mono bug, although strange that it worked before MS fixed IronPython so
that you had to subclass Form to access the protected SetStyle. That must
have uncovered a Mono bug, don't you think?

Any feedback appreciated,

-Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20090524/afbd87e2/attachment.html 


More information about the Mono-list mailing list