Because I fixed the problem with the b'' byte-strings by implementing a custom encoder, I didn't see how I can do this without importing json. See BytesEncoder https://github.com/ellisonbg/zmqweb/pull/3/files#L13R51