-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-135307: Fix email error when policy max_line_length is set to 0 or None #135367
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
base: main
Are you sure you want to change the base?
Conversation
[pull] main from python:main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Triage silliness
Misc/NEWS.d/next/Library/2025-06-10-18-02-29.gh-issue-135307.fXGrcK.rst
Outdated
Show resolved
Hide resolved
Haha, nice catch lol |
def test_no_wrapping_with_none_max_line_length(self): | ||
pol = policy.default.clone(max_line_length=None) | ||
subj = "S" * 100 | ||
body = "B" * 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should use some bigger number? Because word "unlimited" is present. Something like 10**7, for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary, here we just want to test if it will wrap the context to the default 78 characters. 0 / None is set it to no wrap mode. This is a similar fix logic as _refold_parse_tree
so I mentioned 'unlimited' as there, but it actually takes sys.maxsize
. Thanks for comment.
email.policy.Policy.max_line_length
is falsey #135307