NameError and SyntaxError popups when advancing to a new line in a text file
-
I get error messages when I type data into a .txt file and press the ENTER key… Screenshots attached.
Version is 8.7.9
Thank you for your help…
-
Are you using a plugin or something? Please share ?-menu’s Debug Info.
Because Notepad++, all by itself, won’t give you SyntaxError or Tracebacks with NameError.
Can you give a screenshot of the full Notepad++ window, not just the error message, when one of those errors pops up?
-
@PeterJones Thank you for the quick reply. Here are the screenshots…
Full screen when error occurred.
Additional debug info…
Debug Info (list of plugins)
-
Looking at your list of plugins, my first guess is that it’s the
pycalc
plugin causing the issue:Those error messages look very python-like to me, and the description of the plugin in the Plugins Admin says,
The pycalc plugin enables the execution of python code directly within the editor upon pressing the Enter key. Author: pycalc Homepage: https://github.com/pycalc-plugin/notepad-plus-plus
… which sounds almost exactly like what you are seeing: it appears to be executing your line of text as if it were python code, every time you hit enter. So if it’s not valid Python, it appears to pop up an error.
[update: see my reply, below]
I don’t know anything about using the pycalc plugin, but I hope there’s a way to toggle it off, so that it only does immediate python execution on ENTER when you want it to, not every time you hit enter. If not, I suggest uninstalling the plugin: if you want to experiment, instead of uninstalling, exit Notepad++ go toc:\program files\Notepad++\plugins
and rename thepycalc
folder, run Notepad++, and see if it fixes it; if so, then you need to decide whether to permanently uninstall the plugin, or just rename the folder back topycalc
and restart Notepad++ every time you want to actually use the immediate-execution feature of pycalc.If that’s really what it’s doing, and it really doesn’t give a way to turn its behavior off and on, then it’s a horrible design for a plugin, if you ask me, because it doesn’t give any way to type anything other than immediate python, which makes Notepad++ otherwise useless. -
Further update: I installed
pycalc
into a portable Notepad++ (so it wouldn’t mess with my normal, just in case):It has two menu entries:
There is no documentation for the plugin, by my experiments show:
- If enabled has the checkmark (as shown), when you hit ENTER on a line, it will run that line as if it’s Python.
- you can click Plugins > pycalc > enabled to disable that “feature”
- If it’s not enabled, then you can select a piece of text, then use Plugins > pycalc > selected to run just the selected text.
So if you don’t want pycalc to run every line of text as if it were Python, turn off the enabled mode. If you want to ever use pycalc to temporarily run something, just select the text and use the selected command. If you never want to use pycalc to run your active text as Python, then uninstall the plugin using the Plugins Admin.
I still think that defaulting to running every line of text that you type as Python is foolishness to the extreme, and horrendous plugin design, and I would consider that borderline-malicious behavior; but at least they provided a way to turn it off.
update: I have put in a bug/feature request to that plugin, asking them to document their plugin differently and improve the behavior so it’s not defaulting to breaking Notepad++ behavior.
- If enabled has the checkmark (as shown), when you hit ENTER on a line, it will run that line as if it’s Python.
-
@PeterJones That fixed the issue. Thank you for your help!