[IronPython] Importing embedded .py files
dinov at exchange.microsoft.com
Wed Jul 5 09:33:14 PDT 2006
This is likely due to a Unicode / ASCII difference. I suspect that somewhere someone is calling str(xyz) or unicode(xyz) w/ a character that is outside of the ASCII range but also doesn't decode into Unicode.
For an example of this you can look at bug 356 on CodePlex http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=356
I'm not entirely sure how we go about handling this due to the differences in the way the two implementations handle strings (all of ours are Unicode), but we will try and work on a solution for v1.0.
If you could look and see if this is coming from a call to the built-in str or unicode types that would be helpful in understanding how we need to fix this (ParrotBench also runs into this issue an expects an exception, so unfortuntately it's not as easy as suppressing the exception - as it is correct sometimes).
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox
Sent: Tuesday, July 04, 2006 12:47 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Importing embedded .py files
On 7/4/06, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
> JoeSox wrote:
> > This is working except two of the embedded .py files import each
> > other, so no matter which one I place first, it errors out.
> Try creating the empty modules and putting them in sys.modules first.
> I think this is basically what the import machinery does in cases of
> circular imports.
Yes, that worked.
Now the only error I get from my project is still the "Unable to translate bytes  at index 0 from specified code page to Unicode"
coming from the array.py file I am using http://codespeak.net/svn/user/nik/array_py/trunk/src/array.py
It sounds like some incoming arraytype is set incorrectly but I doubt it because I haven't changed much of the code in the ConceptNet modules. There must be something different between that array.py file and Python's builtin array but I have no idea since I really can't find the actual sourcecode for Python's array module.
Also, I forget if I had it working with this new array.py file or my old array.py file.
Anyway, I appreciate the help.
users mailing list
users at lists.ironpython.com
More information about the users