classification
Title: xmlrpc.client could accept bytes for input and output
Type: enhancement Stage: resolved
Components: Library (Lib), XML Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: effbot, eric.araujo, fdrake, flox, python-dev, skip.montanaro
Priority: normal Keywords: patch

Created on 2011-10-30 23:41 by flox, last changed 2011-11-15 19:54 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
issue13297_xmlrpc_bytes.diff flox, 2011-10-30 23:44 review
issue13297_xmlrpc_bytes_v2.diff flox, 2011-11-09 23:40 review
issue13297_xmlrpc_bytes_v3.diff flox, 2011-11-10 18:17 review
issue13297_xmlrpc_bytes_v4.diff flox, 2011-11-12 15:59 review
Messages (8)
msg146666 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-10-30 23:41
Since Python 3 makes clear the distinction between bytes and string, there is no more reason to use the xmlrpc.client.Binary wrapper for binary objects.

The xmlrpc library may deal with bytes and bytearray normally.
To support backward compatibility, the ServerProxy will have a keyword argument "use_bytes" similar to the "use_datetime" from issue #1120353.
msg147382 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-11-09 23:39
Updated with documentation.
msg147383 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-11-09 23:40
Ooops wrong patch.
msg147399 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-11-10 08:31
Maybe a flag "use_builtin_types" is preferred?
It should implies both `bytes` and `datetime.datetime` are used for presenting data received.

I don't see a use case where we would like to have `bytes` for binary data but keep `xmlrpc.client.DateTime` for date objects.

Becomes obsolete, if this change is done:
 - xmlrpc.client.Binary
 - xmlrpc.client.DateTime
 - use_datetime flag of `ServerProxy` class and `loads` function

I'm not sure it's necessary to deprecate things here.
msg147406 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-11-10 18:17
This patch v3 implements the proposal of use_builtin_types flag.
In this case the use_datetime flag becomes obsolete.

Please comment.
msg147473 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-12 11:18
I made comments on Rietveld but there was a glitch, I’m not sure the email was sent.
msg147507 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-11-12 15:59
Thank you for your comments.
Uploaded a new version.
msg147701 - (view) Author: Roundup Robot (python-dev) Date: 2011-11-15 19:54
New changeset 0175883d9513 by Florent Xicluna in branch 'default':
Closes #13297: use bytes type to send and receive binary data through XMLRPC.
http://hg.python.org/cpython/rev/0175883d9513
History
Date User Action Args
2011-11-15 19:54:17python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg147701

resolution: fixed
stage: patch review -> resolved
2011-11-12 15:59:50floxsetfiles: + issue13297_xmlrpc_bytes_v4.diff

messages: + msg147507
2011-11-12 11:18:28eric.araujosetnosy: + eric.araujo
messages: + msg147473
2011-11-10 18:17:09floxsetfiles: + issue13297_xmlrpc_bytes_v3.diff

messages: + msg147406
2011-11-10 08:49:50floxlinkissue2979 dependencies
2011-11-10 08:31:38floxsetmessages: + msg147399
2011-11-09 23:40:47floxsetfiles: + issue13297_xmlrpc_bytes_v2.diff

messages: + msg147383
2011-11-09 23:40:15floxsetfiles: - issue13291_xmlrpc_v2.diff
2011-11-09 23:39:30floxsetfiles: + issue13291_xmlrpc_v2.diff
nosy: + fdrake, effbot, skip.montanaro
messages: + msg147382

2011-10-30 23:44:36floxsetfiles: + issue13297_xmlrpc_bytes.diff
keywords: + patch
stage: patch review
2011-10-30 23:41:39floxcreate