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

Exception occurs when tring to eval Python code #53

Open

Description

@hckr

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

Activity

  1. hckr commented on Jan 10, 2017

    @hckr
    Author

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

  2. sbauer322 commented on Jan 11, 2017

    @sbauer322
    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.

  3. Almenon commented on Jul 11, 2017

    @Almenon

    had same issue with Windows 10

  4. VasilGrdzelishvili commented on Sep 6, 2021

    @VasilGrdzelishvili

    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

  5. akaihola commented on Sep 7, 2021

    @akaihola

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions