Skip to content

User startup.py is being executed TWICE #339

Description

@alankilborn

In version 3.0.18, add following code to user startup.py:

try:
    hello
except:
    hello = 0
hello += 1
print('hello:', hello)

Make sure that the PythonScript console window is being shown when exiting Notepad++.

Upon restarting Notepad++, the code above will show that startup.py is being executed two times:

image


Notepad++ Debug Info:

Notepad++ v8.6.8 (64-bit)
Build time : Jun 4 2024 - 00:30:00
Path : C:\NotepadPlusPlus\Misc_NoBackup\Releases\npp.8.6.8\npp.8.6.8.portable.x64\notepad++.exe
Command Line : -titleAdd="8.6.8 64-bit" -multiInst
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 11 Pro (64-bit)
OS Version : 23H2
OS Build : 22631.3593
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4)
PythonScript (3.0.18)


Probably introduced when #312 was solved.

Activity

alankilborn commented on Sep 10, 2024

@alankilborn
Author

Problem still present in 3.0.19.

@chcg - What was the point in releasing 3.0.19 without a fix for such a huge bug?

chcg commented on Sep 11, 2024

@chcg
Collaborator

@alankilborn Mainly because of the many CVE fixes for python 3.12.6 .

chcg commented on Oct 8, 2024

@chcg
Collaborator

@alankilborn Seems the initialisation config setting is also relevant here. With LAZY it is not happening, just with ATSTARTUP.

alankilborn commented on Dec 31, 2024

@alankilborn
Author

Seems to be solved in 3.0.20.
Great work!

alankilborn commented on Dec 31, 2024

@alankilborn
Author

Should have been listed in the "What's Changed" section for the release, but wasn't. :-(
https://github.com/bruderstein/PythonScript/releases/tag/v3.0.20

chcg commented on Dec 31, 2024

@chcg
Collaborator

The automatically generated part of the release notes just contains a limited amount of changes. I added this change manually.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions