[Ironpython-users] IronPython, Daily Digest 1/9/2013

no_reply at codeplex.com no_reply at codeplex.com
Thu Jan 10 22:29:45 CET 2013


Hi ironpython,

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

In today's digest:ISSUES

1. [New issue] GetEncodings called in StringOps.cs fails using Mono
2. [New comment] GetEncodings called in StringOps.cs fails using Mono

----------------------------------------------

ISSUES

1. [New issue] GetEncodings called in StringOps.cs fails using Mono
http://ironpython.codeplex.com/workitem/33646
User TRJG has proposed the issue:

"I have submitted this verified bug to Mono because its technically their implementation of Text.GetEncodings() that is extremely flawed (and absolutely does not work). Since I have submitted it I have not seen much interest to fix it even though it absolutely does not return supported encodings. I figured I would let you guys know about it, and how IronPython's only call to this method ends up throwing an uncaught exception.

The GetEncodings() call I am referring to is in StringOps in the function MakeCodecsDict. What happen is when this calls is made, an array of hardcoded encoding names are returned. When called, the encodings fail and throw an exception that is not caught in IronPython.  Normally when GetEncodings() is called in .NET only supported encodings are returned, however is not the case with MONO. In fact, I'd argue that at this point GetEncodings() is pretty much guaranteed to fail on alot, if not most systems. (As a note, I am using OpenSuse 64 bit)

I'm not 100% sure but wrapping a try catch around "NormalizeEncodingName" might just fix the problem. 

Thanks,
Trjg"-----------------

2. [New comment] GetEncodings called in StringOps.cs fails using Mono
http://ironpython.codeplex.com/workitem/33646
User TRJG has commented on the issue:

"I have just confirmed that this technique works. Out of 95 encodings provided, 72 failed on my machine while 23 passed. 

Here is the simple code I used to check this.

static void Main()
{
    Console.WriteLine("Getting Encodings");
    var encodings = Encoding.GetEncodings();
    int successful = 0;
    int failed = 0;
    foreach(var encoding in encodings)
    {
        try
        {
            var name = encoding.Name;
            Console.WriteLine(string.Format("Encoding name is {0}",name));
            ++successful;
        }
        catch(Exception e)
        {
            Console.WriteLine("Got error.");
            ++failed;
        }
    }
    Console.WriteLine(string.Format("Successful {0}",successful));
    Console.WriteLine(string.Format("Failed {0}",failed));
}


I modded my personal source code of IronPython but have not yet personally tested it against the massive code base that I wrote and am looking to port to Linux. Mono's GetEncodings, and IronPython's call to it have been hanging me up thus far.

Thanks for the stellar library,
Mike"
----------------------------------------------



----------------------------------------------
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/20130110/c170a019/attachment.html>


More information about the Ironpython-users mailing list