Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Exception occurs when tring to eval Python code #53

Open
hckr opened this issue Jan 10, 2017 · 5 comments
Open

Exception occurs when tring to eval Python code #53

hckr opened this issue Jan 10, 2017 · 5 comments

Comments

@hckr
Copy link

hckr commented Jan 10, 2017

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
Copy link
Author

hckr commented Jan 10, 2017

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

@sbauer322
Copy link
Contributor

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
Copy link

Almenon commented Jul 11, 2017

had same issue with Windows 10

@VasilGrdzelishvili
Copy link

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
Copy link

akaihola commented Sep 7, 2021

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.

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

No branches or pull requests

5 participants