python: use PyBytes/PyUnicode instead of PyString
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Thu, 23 Feb 2017 10:48:25 +0000 (11:48 +0100)
committerWei Liu <wei.liu2@citrix.com>
Thu, 23 Feb 2017 13:11:12 +0000 (13:11 +0000)
commit121d9d403083b2a22543b00e8e18fb8b1b279950
tree5f78c5a5445c32690633b589b8fc8e7c1f41ba4c
parent0c8981f035098f92ad04be00969406d9c3fc5934
python: use PyBytes/PyUnicode instead of PyString

In Python2 PyBytes is the same as PyString, but in Python3 PyString is
gone and 'str' is really PyUnicode in C-API.
When handling arbitrary data, use PyBytes - which is the right thing to
do in Python3, and pose no API change in Python2. When handling
xenstore paths and transaction ids, which have well defined format, use
PyUnicode - to ease API usage - no need to prefix all xenstore paths
with 'b' when migrating scripts to Python3.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/python/xen/lowlevel/xc/xc.c
tools/python/xen/lowlevel/xs/xs.c