Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

TraitError in traitlets.py(332) on any input #405

Closed
jfkw opened this Issue · 6 comments

4 participants

@jfkw

For the past month or so with ipython master, on any input, the following error is raised:

TraitError: The 'pprint' trait of a PlainTextFormatter instance must be a boolean, but a value of 0 was specified.

  ~ $ ipython
  >>> 2+2
  > /usr/lib64/python2.7/site-packages/IPython/utils/traitlets.py(332)error()
      331                 % (self.name, self.info(), repr_type(value))            
  --> 332         raise TraitError(e)
      333 

  ipdb> q
  Traceback (most recent call last):
    File "", line 1, in 
      2+2
    File "/usr/lib64/python2.7/site-packages/IPython/core/displayhook.py", line 302, in __call__
      format_dict = self.compute_format_data(result)
    File "/usr/lib64/python2.7/site-packages/IPython/core/displayhook.py", line 215, in compute_format_data
      return self.shell.display_formatter.format(result)
    File "/usr/lib64/python2.7/site-packages/IPython/core/formatters.py", line 113, in format
      for format_type, formatter in self.formatters.items():
    File "/usr/lib64/python2.7/site-packages/IPython/utils/traitlets.py", line 283, in __get__
      value = obj._trait_dyn_inits[self.name](obj)
    File "/usr/lib64/python2.7/site-packages/IPython/core/formatters.py", line 59, in _formatters_default
      f = cls(config=self.config)
    File "/usr/lib64/python2.7/site-packages/IPython/config/configurable.py", line 83, in __init__
      self.config = config
    File "/usr/lib64/python2.7/site-packages/IPython/utils/traitlets.py", line 305, in __set__
      obj._notify_trait(self.name, old_value, new_value)
    File "/usr/lib64/python2.7/site-packages/IPython/utils/traitlets.py", line 456, in _notify_trait
      c(name, old_value, new_value)
    File "/usr/lib64/python2.7/site-packages/IPython/config/configurable.py", line 138, in _config_changed
      setattr(self, k, deepcopy(config_value))
    File "/usr/lib64/python2.7/site-packages/IPython/utils/traitlets.py", line 301, in __set__
      new_value = self._validate(obj, value)
    File "/usr/lib64/python2.7/site-packages/IPython/utils/traitlets.py", line 309, in _validate
      return self.validate(obj, value)
    File "/usr/lib64/python2.7/site-packages/IPython/utils/traitlets.py", line 963, in validate
      self.error(obj, value)
    File "/usr/lib64/python2.7/site-packages/IPython/utils/traitlets.py", line 332, in error
      raise TraitError(e)
  TraitError: The 'pprint' trait of a PlainTextFormatter instance must be a boolean, but a value of 0  was specified.
@rkern

Should be fixed by cc9d85e

@minrk
Owner

something this glaring lasting a month or more just goes to show how many people use --classic mode.

I can confirm that cc9d85e fixes the issue. Testing that also revealed that IPython would always crash on exit in classic mode. This is fixed in 1dc55eb.

@jfkw

Thank you for the fix(es).

Minutes after posting, I fat-fingered an rm command, removing my .ipython. The normal mode with no config worked perfectly.

--classic mode? I can't restore my config from backup until tonight to check what's in it, but I try to keep the inputs '>>> ' , the continuation '... ', and the output unadorned, like the regular python shell. This is mainly for pasting into doctests. My apologies for not utilizing all the hard work you guys put into the ipython repl rendering ;)

@minrk
Owner

If you were asking what '--classic' mode is, if you do:

ipython --classic

You will get the prompts, output, etc. of the regular Python shell.

@minrk minrk closed this
@ellisonbg
Owner
@jfkw
@damianavila damianavila referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.