python: Fix syntax to support Python 3.x.
python: fix cdata to work with Python 3.x.