fix(notifications): resolve email.py stdlib collision#122
Merged
Conversation
Rename email.py → _email.py to avoid shadowing Python's stdlib 'email' package, which breaks smtplib imports when pytest/plugins load this module. Keep email.py as a backward-compat re-export shim. Internal imports updated to use _email directly (3 files). 373 passed, 0 skipped (email-related). Co-Authored-By: Claude <noreply@anthropic.com>
d35147a to
83fef2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
修复
notifications/email.py与 Python stdlibemail包的模块名冲突。问题:
email.py遮挡了 stdlib 的email包,导致smtplib在特定环境下 import 失败(pytest 的 pygments 插件加载时会触发)。修复:
_email.py(无冲突的名字)email.py保留为向后兼容的 re-export shim_emailTesting
Breaking Changes
None.
from quant_platform_kit.notifications.email import ...仍然有效。