assertion failure generating extension bindings #18

pabigot opened this Issue Aug 19, 2014 · 1 comment


None yet

1 participant

pabigot commented Aug 19, 2014

The bindings for are generated as a side effect of the bindings for The assertion below fails when building extension bindings for the latter namespace, as described in this SO question:

File "/opt/pyxb/pyxb/binding/", line 1520, in importForDeclaration
assert sdecl._objectOrigin().moduleRecord().namespace() == ns

Chances are this assertion is simply being too strict, or the correct namespace should be located elsewhere.

pabigot commented Aug 19, 2014

As a workaround, commenting out the assertion appears to result in correct bindings being generated.

@pabigot pabigot added this to the PyXB 1.2.4 milestone Aug 26, 2014
@pabigot pabigot self-assigned this Aug 26, 2014
@pabigot pabigot added the bug label Aug 26, 2014
@pabigot pabigot added a commit that closed this issue Oct 19, 2014
@pabigot fix #18: assertion failure generating extension bindings
The assertion attempted to verify that the namespace for the module from
which a declaration came was the same as the namespace for the
declaration.  In the case here that is not the case: the origin module
is pyxb.bundles.opengis.ogckml22 and the referenced declaration
namespace is, which is itself imported
into ogckml22 from pyxb.bundles.opengis.atom.

However, the origin module does import the bindings for the referenced
declaration, so the subsequent code that imports it satisfies the
requirement and the assertion may be removed.

To determine the true module of origin would require recording origins
across independent binding generation sessions; this is unnecessary.

Reproducing command:

    pyxbgen \
      --archive-path='&pyxb/bundles/opengis//' \
      --schema-location= \
@pabigot pabigot closed this in 7c6bdf4 Oct 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment