-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugins run twice in autoreload mode #2817
Comments
Thanks. I would expect old module to be deleted/garbage collected since it is overridden in the if spec.name in sys.modules:
return sys.modules[spec.name] |
I used pelican/pelican/plugins/_utils.py Lines 65 to 69 in e4d9c41
I will use |
Fix for this issue is included in the just-released Pelican 4.5.1. ✨ |
To reproduce
Create these files:
Then run:
The plugin runs twice with
-r
, but only once without-r
.The casue of the issue
After a bisect, I found that commit ed1eca1 introduced this issue.
After adding this line, I found that the plugin was registered twice:
But why? The reason:
How to fix
To fix it, simply avoid loading the same plugin twice:
I will create a pull request after writing some tests for it.
The text was updated successfully, but these errors were encountered: