Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ValueError: malformed node or string" when evaluating code that contains Path elements #5636

Closed
ibackus opened this issue Nov 1, 2017 · 7 comments

Comments

@ibackus
Copy link

ibackus commented Nov 1, 2017

Description

What steps will reproduce the problem?

What is the expected output? What do you see instead?

Please provide any additional information below

File "/usr/local/lib/python2.7/dist-packages/qtconsole/base_frontend_mixin.py", line 163, in _dispatch
handler(msg)
File "/usr/local/lib/python2.7/dist-packages/spyder/widgets/ipythonconsole/namespacebrowser.py", line 220, in _handle_execute_reply
self.handle_exec_method(msg)
File "/usr/local/lib/python2.7/dist-packages/spyder/widgets/ipythonconsole/shell.py", line 351, in handle_exec_method
view = ast.literal_eval(literal)
File "/usr/lib/python2.7/ast.py", line 80, in literal_eval
return _convert(node_or_string)
File "/usr/lib/python2.7/ast.py", line 63, in _convert
in zip(node.keys, node.values))
File "/usr/lib/python2.7/ast.py", line 62, in
return dict((_convert(k), _convert(v)) for k, v
File "/usr/lib/python2.7/ast.py", line 63, in _convert
in zip(node.keys, node.values))
File "/usr/lib/python2.7/ast.py", line 62, in
return dict((_convert(k), _convert(v)) for k, v
File "/usr/lib/python2.7/ast.py", line 79, in _convert
raise ValueError('malformed string')
ValueError: malformed string

Version and main components

  • Spyder Version: 3.2.3
  • Python Version: 2.7.12
  • Qt Versions: 4.8.7, PyQt4 (API v2) 4.11.4 on Linux

Dependencies

pyflakes >=0.5.0  :  1.6.0 (OK)
pycodestyle >=2.3 :  2.3.1 (OK)
pygments >=2.0    :  2.2.0 (OK)
pandas >=0.13.1   :  0.16.2 (OK)
numpy >=1.7       :  1.12.1 (OK)
sphinx >=0.6.6    :  1.6.3 (OK)
rope >=0.9.4      :  0.10.7 (OK)
jedi >=0.9.0      :  0.10.2 (OK)
psutil >=0.3      :  5.3.1 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
sympy >=0.7.3     :  0.7.6 (OK)
cython >=0.21     :  0.22.1 (OK)
qtconsole >=4.2.0 :  4.3.1 (OK)
IPython >=4.0;<6.0:  5.4.1 (OK)
pylint >=0.25     :  1.7.2 (OK)

@ccordoba12
Copy link
Member

What code did you evaluate in the IPython console before getting this error?

@ccordoba12
Copy link
Member

We have seen this error before, but we need a clear and reproducible way to reproduce it to fix it. So please help us with that.

@ibackus
Copy link
Author

ibackus commented Nov 1, 2017

Okay, after some more digging, it seems to be a problem with using path. If I run the following code either in the iPython console directly or by running a script:

from path import Path
x = Path('blah-blah-blah')

then I get the following dialog from spyder:

Spyder has encountered a problem.
Sorry for the inconvenience.

You can automatically submit this error to our Github issues tracker.

Note: You need a Github account for that.

which contains the error information above. Any time afterwards, if I enter something into the iPython console I get the same dialog. If I restart the iPython kernel, this behavior stops, but if I run the script (or code) again the dialog returns.

@ccordoba12
Copy link
Member

ccordoba12 commented Nov 1, 2017

Ok, great!! Thanks a lot for finding an easy way to reproduce this problem.

@ccordoba12 ccordoba12 changed the title Getting this message from spyder "ValueError: malformed node or string" when evaluating code that contains Path elements Nov 1, 2017
@ccordoba12 ccordoba12 added this to the v3.2.5 milestone Nov 1, 2017
@ibackus
Copy link
Author

ibackus commented Nov 1, 2017

Happy help. Hope it can be sorted out!

@ccordoba12
Copy link
Member

Yep, having a way to reproduce it helps a lot!

@ccordoba12
Copy link
Member

@dalthviz, please take a look at this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants