These are chat archives for ipython/ipython

31st
Jul 2015
Wolfgang Kerzendorf
@wkerzendorf
Jul 31 2015 13:39
I’m having issues with ipython notebook capturing stdout/stderr from a c code that is called via ctypes. any solutions to this?
actually not only capturing but simply having this information available in the notebook
Ryan Morshead
@rmorshea
Jul 31 2015 23:15

I'm getting an unexpected error from traitlets/utils/importstring.py in traitlets which is arising from a class like this:

class Artist(Configurable):
    # ...
    axes = Instance('matplotlib.axes.Axes', allow_none=True)
    # ...

The error reads, TypeError: Item in ``from list'' not a string, because by the time the instance's string makes it down to importstring.py it's been turned into unicode. So to fix the issue I simply converted it back to a string when it get's passed to __import__:

module = __import__(package, fromlist=[obj])
# would be fixed by:
module = __import__(package, fromlist=[str(obj)])

Of course this doesn't seem like it should be happening though...

Ryan Morshead
@rmorshea
Jul 31 2015 23:44
ignore previous: not used to default unicode in python 3