deavid/bjsonrpc — pull request #4 by abarnert (2012-10-31 21:27:09+00:00)
Title: Port from python 2.5-2.7 to 2.6-2.7/3.2+.

**NOTE: Breaks 2.5 compatibility!**

- Besides the trivial syntax changes, this required changing the
Connection.write_line loop to keep _wbuffer as a flat bytes string
instead of a list of strings. (Since it was already flattening each
string and then exploding it into a list of 1-char strings, there's
no performance downside to thsi change.)

- As a side-effect of the changes, Connection.write and friends can
now handle either bytes or unicode strings. Since the high-level
methods are all in terms of JSON objects, this only really makes a
difference for debugging bjsonrpc itself. (The json module will
only give us str objects--bytes on 2.x, unicode on 3.x--and any
non-ASCII characters will already be escaped for JSON anyway.)