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

Evaluating incorrect clojure form causes python error instead of printing stack trace #276

Closed
DKuykendall opened this issue Aug 20, 2016 · 13 comments

Comments

@DKuykendall
Copy link

@DKuykendall DKuykendall commented Aug 20, 2016

Any time I try to evaluate clojure code that is incorrect, instead of a stack trace, I receive "Vim(python): Traceback (most recent call last):". Looking for a solution to this, I found issue #234, where tpope's comment on the weird error truncation led me to change nrepl_fireplace.py, but the weird truncated error is still present

@bhurlow

This comment has been minimized.

Copy link

@bhurlow bhurlow commented Jun 13, 2017

(clojure.core/require 'mock :reload)
Error detected while processing function <SNR>27_Require[13]..fireplace#session_eval[16]..fireplace#quickfix_for[2]..<SNR>27_qfmassage[13]..fireplace#findresource[12]..fireplace#jar_contents:
line   14:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 6, in <module>
    import io
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
  Referenced from: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
@withrocks

This comment has been minimized.

Copy link

@withrocks withrocks commented Sep 3, 2017

For what it's worth: I got this error too when running 265fc95 of vim-fireplace on vim version 7.4 (MacOS) installed with homebrew. But upgrading vim to 8.0 fixed it in my case.

@bhurlow

This comment has been minimized.

Copy link

@bhurlow bhurlow commented Jan 7, 2019

re-installing vim via homebrew (and thus python) fixed this for me as well

@tpope

This comment has been minimized.

Copy link
Owner

@tpope tpope commented Jun 3, 2019

The full error is now available at g:fireplace_last_python_exception. I believe this particular issue is fixed.

@tpope tpope closed this Jun 3, 2019
@bakku

This comment has been minimized.

Copy link

@bakku bakku commented Jul 16, 2019

Sadly I'm still getting this..After evaluating some incorrect code I get:

Vim(python):Traceback (most recent call last):

and

:echo g:fireplace_last_python_exception

results in:

E121: Undefined variable: g:fireplace_last_python_exception
E15: Invalid expression: g:fireplace_last_python_exception

The latest commit of the fireplace plugin locally is: e289d11

I'm running vim 8 on Mac OS and I have Python 2.7

Any ideas how to debug?

@tpope

This comment has been minimized.

Copy link
Owner

@tpope tpope commented Jul 16, 2019

Can you reproduce the issue if you do :let $FIREPLACE_NO_IF_PYTHON = 1 first?

tpope added a commit that referenced this issue Jul 18, 2019
@bakku

This comment has been minimized.

Copy link

@bakku bakku commented Jul 19, 2019

If I do that, then I can see the actual exception, cool thanks !

Do I have to add this to my .vimrc ?

@tpope

This comment has been minimized.

Copy link
Owner

@tpope tpope commented Jul 19, 2019

Okay, so the issue isn't with retrieving the stacktrace as i initially assumed but with finding the entries in the jar files in your classpath. e79ea15 should fix it.

That variable is a backdoor for debugging, do not add it to your vimrc.

@bakku

This comment has been minimized.

Copy link

@bakku bakku commented Jul 19, 2019

I updated the plugin locally so now I have def51d3 on my local machine, sadly I still get a somewhat similar error as before:

Vim(pythonx):Traceback (most recent call last):

Again executing:

:let $FIREPLACE_NO_IF_PYTHON = 1

solves the problem.

@tpope

This comment has been minimized.

Copy link
Owner

@tpope tpope commented Jul 19, 2019

What happens if you do :pythonx import zipfile?

@bakku

This comment has been minimized.

Copy link

@bakku bakku commented Jul 19, 2019

I get this error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 6, in <module>
    import io
  File "/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
  Referenced from: /usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
@tpope

This comment has been minimized.

Copy link
Owner

@tpope tpope commented Jul 19, 2019

Your Vim is broken, try reinstalling it. I'll try to make Fireplace robust against this case.

tpope added a commit that referenced this issue Jul 19, 2019
@bakku

This comment has been minimized.

Copy link

@bakku bakku commented Jul 19, 2019

You are right, after reinstalling it works ! Thanks for your help and patience 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.