[IronPython] array.fromfile

Dino Viehland dinov at exchange.microsoft.com
Thu Feb 22 17:59:06 CET 2007


Depending on how similar your array.py was to CPython's built-in array the problem here may be that our long data type is 8 bytes instead of 4 like on CPython.  The documentation defines the "minimum" size and we use the native sizes for the similar .NET types.

Try switching to using 'I' for the type instead.  You could also check the itemsize on array.py's array and see if that's the case or not.

________________________________________
From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of JoeSox [joesox at gmail.com]
Sent: Wednesday, February 21, 2007 10:15 PM
To: Discussion of IronPython
Subject: [IronPython] array.fromfile

IronPython Team,

Thanks for the thanks.  The array.cs is a great addition to IronPython.
I just completed some testing with my ConceptNet C# library, which was
using its own array.py to get things done.

Testing with the IP array, I am getting an exception thrown ("file not
large enough") performing a .fromfile on a unicode file (I think it is
a unicode. It is a .mdf file from MIT's montylingua).

I am guessing this is the problem since it is not a str file.  Does
this sound correct?

The fileptr and length are the same values being passed (stepping thru
a Python run and an IronPython run)

array_ptr = array('L')
<code>array_ptr.fromfile(file_ptr,length)</code>

file_ptr        {<open file 'C:\Documents and Settings\Joseph\My
Documents\Python
Projects\conceptnet2.1\montylingua\FASTLEXICON_3.MDF', mode 'rb' at
0x0337843A>}    object {IronPython.Runtime.PythonFile}

length  260759  object {int}

Thanks again,
Joe

On 2/21/07, Dino Viehland <dinov at exchange.microsoft.com> wrote:
> Hello IronPython Community,
>
> We have just released IronPython 1.1 Beta 1.  This release primarily focuses on adding the remaining new functionality for the 1.1 release (array module, importing pre-compiled modules) along with many new bug fixes.  Also included but previously available with 1.1 Alpha 1 are the new XML Doc comment integration with the help system, the SHA, MD5, and select modules.  The remaining of the 1.1 cycle will focus on bug fixes.
> You can download the release from: http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=1944
>
> We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: J. Merrill, Coleyc, JoeSox, Michael Foord, Seo Sanghyeon, and Sylvain Hellegouarch.
>
> More complete list of changes and bug fixes:
> ============================================
...
> Implemented array module
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list