[IPython-dev] Buffers

Fernando Perez fperez.net@gmail....
Mon Jul 26 21:33:03 CDT 2010


Glad you worked it out, but I'm worried about one thing: I don't
believe you can send unicode strings as a buffer over the wire.  The
reason is that the two interpreters at both ends of the connection
could have been compiled with different internal unicode encodings.
Python can be compiled to store unicode internally either as UCS-2 or
UCS-4, you can check sys.maxunicode to find out how your particular
build was made:

http://www.python.org/dev/peps/pep-0100/
http://www.python.org/dev/peps/pep-0261/

If you send a unicode string as a buffer from a ucs2 python to a ucs4
one, you'll get  a mess at the other end, I think.

Minor note:
On Mon, Jul 26, 2010 at 6:43 PM, Min RK <benjaminrk@gmail.com> wrote:
> isinstance(s,(str,unicode))

this is equiv. to: isinstance(s, basestring)



Cheers,

f


More information about the IPython-dev mailing list