Community
    • Login

    NameError and SyntaxError popups when advancing to a new line in a text file

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 2 Posters 93 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • David HimmelsteinD
      David Himmelstein
      last edited by

      I get error messages when I type data into a .txt file and press the ENTER key… Screenshots attached.

      notepad++ errors 2025-04-09.png

      Version is 8.7.9

      Thank you for your help…

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @David Himmelstein
        last edited by

        @David-Himmelstein ,

        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?

        David HimmelsteinD 1 Reply Last reply Reply Quote 0
        • David HimmelsteinD
          David Himmelstein @PeterJones
          last edited by

          @PeterJones Thank you for the quick reply. Here are the screenshots…

          Full screen when error occurred.

          07a60057-c966-4eff-a6e5-0886cef9cdf1-image.png

          Additional debug info…

          ace814ca-680b-47ce-bf5a-b0e2ac48a01b-image.png

          Debug Info (list of plugins)

          2d4570f2-ae47-4c3b-a4ca-b6f92f54ad6d-image.png

          PeterJonesP 2 Replies Last reply Reply Quote 0
          • PeterJonesP
            PeterJones @David Himmelstein
            last edited by PeterJones

            @David-Himmelstein ,

            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 to c:\program files\Notepad++\plugins and rename the pycalc 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 to pycalc 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.

            1 Reply Last reply Reply Quote 1
            • PeterJonesP
              PeterJones @David Himmelstein
              last edited by PeterJones

              @David-Himmelstein ,

              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:
              0b7e9930-f266-4f28-95bc-637db7eb9a23-image.png

              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.

              David HimmelsteinD 1 Reply Last reply Reply Quote 1
              • David HimmelsteinD
                David Himmelstein @PeterJones
                last edited by

                @PeterJones That fixed the issue. Thank you for your help!

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors