xmlrpc.client to deprecate Binary for bytes?

Not sure if this is an actual idea/feature request or a bug. Might be half/half In Python 2, many actual strings were "packaged" through the str type, so xmlrpclib had to provide an other wrapper (xmlrpclib.Binary) to differentiate between actual strings (to insert as-is) and binary blobs, to b64encode. Among Python 3 fixes are the stricter separation between bytestrings (bytes) and text strings (str), but xmlrpc.client *still* requires the usage of a Binary wrapper, and trying to encode a bytes instance just blows up:
I think it would be worthwhile to do the following: * Have xmlrpc.client treat dumping `bytes` (and related objects, such as bytearray or memoryview) as if they were `Binary`-wrapped (by b64encoding them and shipping them as binary data, which they are) * Add a flag to xmlrpc.client's `ServerProxy` and `loads` to have binary data (<base64> nodes of xmlrpc) decode to `bytes` rather than `Binary` instances. This option would likely be `False` by default, at least to start with, so as not to break compatibility with Python 3.1 and 3.2 code. PS: as seen above, xmlrpc claims to require objects "with the buffer interface", Python's documentation (http://docs.python.org/py3k/library/stdtypes.html?highlight=memoryview#memor...) claims bytes and bytearray implement "the buffer protocol". Who is lying?
participants (1)
-
Masklinn