[Ironpython-users] IronPython, Daily Digest 11/2/2012

no_reply at codeplex.com no_reply at codeplex.com
Sat Nov 3 15:18:43 CET 2012

Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] Sockets are not properly closed
2. [New issue] AssemblyResolve event in PythonContext may load unnecessary assemblies



1. [New issue] Sockets are not properly closed
User vahalae has proposed the issue:

"In IronPython 2.7.3, calling close on the socket does not close the socket but only decreases the reference count: PythonSocket-class initializes the internal _referenceCount to 1. When close is explicitly called, reference count condition for closing the socket is _referenceCount < 1. Calling close only decreases the reference count. The socket is only really closed when the finalizer calls _close.

The correct close condition is: 
            public void close() {
                var refs = System.Threading.Interlocked.Decrement(ref _referenceCount);

                // Don't actually close the socket if other file objects are
                // still referring to this socket.                
                if (refs < 1) {

A simple script for reproducing the defect is attached."-----------------

2. [New issue] AssemblyResolve event in PythonContext may load unnecessary assemblies
User eldan has proposed the issue:

"I've noticed in my program that this event jumps every time I refer to any of my resources for all of my projects. For an example every time I open a form in my program where the form uses something from the project's resources this event jumps.
In MSDN it states here: http://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve.aspx
that now in .NET 4 this event triggers also for resource assemblies.
I was wondering if I could make a patch in the code that check if args.Name.contains("resources") return null
it'll make my program faster, but would it break anything?
I was thinking that maybe when PythonContext.cs was written IronPython was running under .NET 3.5 so it was never intended to work for resource assemblies.
This could be very great for you too, since making this patch made all my forms open 1-1.5 seconds faster.

please get back to me,
thanks in advance!"

You are receiving this email because you subscribed to notifications on CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20121103/f7e12128/attachment.html>

More information about the Ironpython-users mailing list