[IronPython] Id: 356 unicode throws when creating a Unicode string from an invalid Unicode string (was Re: Importing embedded .py files)

JoeSox joesox at gmail.com
Tue Jul 4 19:52:37 CEST 2006

On 7/4/06, Fuzzyman <fuzzyman at voidspace.org.uk> wrote:
> Hmmm... well here is the source code for the Python array module. I'm
> not sure it will help much though.
> http://svn.python.org/view/python/trunk/Modules/arraymodule.c?&view=markup

Ah, it looks like this specific error is known

I'm not sure how to workaround this one yet and it looks like I will
be waiting for 1.0rc.
Here is my stack if anyone is interested. [I have some comments next
to some tracelines that explain what it should be doing]:

Traceback (most recent call last):
File , line 0, in <stdin>##70
File E:\CNUDB.py, line 24, in __init__
[self.nltools = CNUTools.ConceptNetNLTools(self)]
File E:\CNUTools.py, line 13, in __init__
[self.m = CNUMontylingua.MontyLingua()]
File E:\CNUMontylingua.py, line 15, in __init__
[self.theMontyLemmatiser = MontyLemmatiser.MontyLemmatiser()]
File E:\CNUMontyTagger.py, line 15, in __init__
File E:\CNUMontyLexiconFast.py, line 37, in __init__
[self.load_fastlexicon()] (found .MDF file "FASTLEXICON")
File E:\CNUMontyLexiconFast.py, line 101, in load_fastlexicon
res_arr = "<open file './montylingua/FASTLEXICON_3.MDF', mode 'rb' at
self.word_start_arr = <huge array 0xc32bc0>
built_in_p = 260759
                 *                                                  line1 = None
File CNUMontyLexiconFast, line unknown, in array_fromfile       ?
File E:\CNUMontyLexiconFast.py, line 254, in array_fromfile
[array_ptr.fromfile(file_ptr,length)]  file_ptr = "<open file
'./montylingua/FASTLEXICON_3.MDF', mode 'rb' at 0x00C9...
File E:\array.py, line 209, in fromfile
File E:\array.py, line 222, in fromstring                       [s = str(s)]
File mscorlib, line unknown, in GetString
File mscorlib, line unknown, in GetString
File mscorlib, line unknown, in CreateStringFromEncoding
File mscorlib, line unknown, in GetCharCount
File mscorlib, line unknown, in InternalFallback
File mscorlib, line unknown, in Fallback
File mscorlib, line unknown, in Throw
UnicodeDecodeError: Unable to translate bytes [81] at index 0 from specified cod
e page to Unicode.

Later, Joe

More information about the Ironpython-users mailing list