python-editor icon indicating copy to clipboard operation
python-editor copied to clipboard

module 'editor' has no attribute 'edit' with python3

Open leggewie opened this issue 6 years ago • 0 comments

import editor commit_msg = editor.edit(contents=b"# Enter commit message here")

This works in the python3 command line (while exhibiting bug #1), but when called as a script I get the following error.

$ python3 /home/leggewie/.PyCharmCE2019.2/config/scratches/editor.py

Traceback (most recent call last): File "/home/leggewie/.PyCharmCE2019.2/config/scratches/editor.py", line 1, in import editor File "/home/leggewie/.PyCharmCE2019.2/config/scratches/editor.py", line 3, in commit_msg = editor.edit(contents=b"# Enter commit message here") AttributeError: module 'editor' has no attribute 'edit'

python3 -c 'import editor; editor.edit(contents=b"# Enter commit message here")' works fine and does not bring about #1, either.

leggewie avatar Aug 08 '19 19:08 leggewie