LightTable / Python

Python language plugin for Light Table
MIT License
98 stars 51 forks source link

Exception occurs when tring to eval Python code #53

Open hckr opened 7 years ago

hckr commented 7 years ago

OS: Manjaro Linux Default Python version: 3.5.2 LT installed from AUR (package lighttable-git)

I created a file test.py with the following code:

print(2+2);

And then tried to eval it with Ctrl+Shift+Enter, which resulted in the exception below:

Traceback (most recent call last): File "/usr/lib/lighttable/resources/app/plugins/Python/py-src/ltmain.py", line 193, in handleEval code= compile(ensureUtf(code), ensureUtf(data[2]["name"]), 'eval') File "/usr/lib/lighttable/resources/app/plugins/Python/py-src/ltmain.py", line 50, in ensureUtf if type(s) == unicode: NameError: name 'unicode' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/lighttable/resources/app/plugins/Python/py-src/ltmain.py", line 197, in handleEval code= compile(ensureUtf(code), ensureUtf(data[2]["name"]), 'exec') File "/usr/lib/lighttable/resources/app/plugins/Python/py-src/ltmain.py", line 50, in ensureUtf if type(s) == unicode: NameError: name 'unicode' is not defined

screenshot_20170110_220927

hckr commented 7 years ago

PR #39 should solve the problem. Why don't you merge it?

sbauer322 commented 7 years ago

Unfortunately, the Python plugin is lacking an active maintainer, let alone people to review pull requests.

Since none of the current Light Table maintainers use Python this plugin has not had much love. We need people from the community to either become maintainers of the plugin, or verify pull requests are acceptable by testing them out. Otherwise the open pull requests will continue to languish.

If anyone is interested, please feel free to get in touch with a member of the Light Table team.

Almenon commented 7 years ago

had same issue with Windows 10

VasilGrdzelishvili commented 3 years ago

had same issue with Windows 10 too.. at first time when I run code it's work but after that there are same problem image

akaihola commented 3 years ago

That NameError looks like the code base was written for an older version of Python (2.x) and doesn't work on Python 3.5.

Converting the whole code base to be compatible with Python 3.x may be easy or a large and difficult task. Hard to know without looking inside. There are libraries and tools to ease the process.