ensure bindings compatible with both Python2 and Python3 #22

pabigot opened this Issue Oct 18, 2014 · 0 comments


None yet

1 participant

pabigot commented Oct 18, 2014

This is the only way to create a source release with pre-generated bindings since PyPI won't allow two distinct versions (1.2.4 for Python2 and 1.3.4 for Python3) to co-exist.

@pabigot pabigot added this to the PyXB 1.2.4 milestone Oct 18, 2014
@pabigot pabigot added a commit that closed this issue Oct 19, 2014
@pabigot fix #22: ensure bindings compatible with both Python2 and Python3
Use __future__ to treat all literals as unicode; this way we can strip
the u prefix from literals so Python 3 prior to 3.3 works.  Import six
in the bindings so we can determine whether to convert XML input to

Fix issues with facet extrema and with FAC occurrence relations, both of
which tend to use Python 2 long values that, if emitted with "repr",
include a suffix L that is not acceptable to Python 3.

Generally replace use of %r formatting with %s and a delegation to
repr2to3 which implements the above transformations.
@pabigot pabigot closed this in b2aaf2b Oct 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment