[Mono-bugs] [Bug 506882] New: Subclassing class with protected methods should allow access in IronPython

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon May 25 09:45:37 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=506882


           Summary: Subclassing class with protected methods should allow
                    access in IronPython
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: i386
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: interop
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: dblank at cs.brynmawr.edu
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=294220)
 --> (http://bugzilla.novell.com/attachment.cgi?id=294220)
DLLs and test IronPython Program (all open source)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10)
Gecko/2009042708 Fedora/3.0.10-1.fc10 Firefox/3.0.10

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

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

Trying this IronPython 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 this Mono bug.


Reproducible: Always

Steps to Reproduce:
1. Unzip the attachment libs-091.zip
2. cd libs-091
3. Run "mono ipy.exe testprotect.py"
Actual Results:  
Traceback (most recent call last):
  File "testprotect.py", line 6, in __main__
TypeError: cannot access protected member SetStyle without a python subclass of
Control


Expected Results:  
Should run without errors, and return

This prevents dynamic languages built on the DLR from being able to extend
classes properly, breaking standard functions of IronPython and IronRuby.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list