[pypy-dev] Weird Unicode errors

Timothy Baldridge tbaldridge at gmail.com
Sun Oct 19 01:11:08 CEST 2014


What's also odd, is that there is something non-deterministic about these
errors, sometimes I get the one error, but if I translate again (without
changing any code) I'll get the other.

On Sat, Oct 18, 2014 at 2:08 PM, Timothy Baldridge <tbaldridge at gmail.com>
wrote:

> My interpreter is built using mostly unicode for symbols and strings, but
> recently I've been getting some really weird translation errors. The first
> is this: https://gist.github.com/halgari/0d57dd87434968561705
>
> I tracked this error down to being caused whenever I try an isinstance of
> unicode like this:
>
> isinstance(x, unicode)
>
> This is really annoying as I'd love to have a single unified wrap function:
>
>     @specialize.argtype(0)
>     def wrap(x):
>         if isinstance(x, int):
>             return numbers.Integer(x)
>         if isinstance(x, unicode):
>             return String(x)
>
>
> And as of this morning I started getting errors like this:
>
> [translation:ERROR] TyperError: don't know how to convert from
> <UnicodeRepr * GcStruct rpy_unicode { hash, chars }> to <UniCharRepr
> UniChar>
> [translation:ERROR] .. (pixie.vm.reader:47)PromptReader.read
> [translation:ERROR] .. block at 82 with 1 exits
> [translation:ERROR] .. v235 = simple_call(v234)
>
> What is a UniChar? My code only deals with unicode strings, so I'm not
> sure what's happening here.
>
> Thanks for any help. I've had unicode working perfectly with my
> interpreter for weeks, and suddenly in the past two days I've started
> getting these errors.
>
> Timothy
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20141018/d0666ad2/attachment-0001.html>


More information about the pypy-dev mailing list