Skip to content

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zangjiucheng
Copy link
Contributor

@zangjiucheng zangjiucheng commented Jun 10, 2025

@zangjiucheng zangjiucheng changed the title gh-135307: Support email unlimited line lengths when policy max_line_length is 0 or None gh-135307: Fix email error when policy max_line_length is set to 0 or None Jun 10, 2025
@ZeroIntensity ZeroIntensity added topic-email needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jun 10, 2025
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage silliness

@zangjiucheng
Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

@zangjiucheng zangjiucheng Jun 11, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants