Closed juhasch closed 8 years ago
I think our plan is not to make any further releases of ipython_genutils unless it's really necessary; the package is something of a fudge for bits we couldn't cleanly separate. So maybe we should make a copy of import_item
in nbconvert? @minrk ?
@takluyver I think there's already a copy of import_item in traitlets that may have this fix. We could consider that an exported API (we may already be treating it that way in one or two places, I'm not sure).
Well there is a copy of import_item
in traitlets.
So should nbconvert use from traitlets.utils.importstring import import_item
instead ?
The traitlets version also needs the proposed fix.
It looks like the traitlets version has an equivalent fix: https://github.com/ipython/traitlets/blob/146cef48cac8620838500049d65eb51d98f9e522/traitlets/utils/importstring.py#L29
I think it should be fine to import it from traitlets in nbconvert. Possibly we should open an issue on traitlets to document it as part of the public API?
👍 to making import_item a public, documented API of traitlets
Sounds good, so I am closing this.
Seems Python 2.7 does not like to be fed unicode for
__import__
: http://stackoverflow.com/questions/27477880/portable-code-import-parameter-string-type-between-python-2-and-python-3This is needed to allow loading additional pre/postprocessors from a JSON config file: https://github.com/jupyter/nbconvert/issues/362