Skip to content
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

What’s the difference between “linesep” and “self.policy.linesep” in Lib.email.generator.Generator._write_headers? #122989

Closed
mcepl opened this issue Aug 13, 2024 · 2 comments · Fixed by #123002
Labels
easy topic-email type-bug An unexpected behavior, bug, or error

Comments

@mcepl
Copy link
Contributor

mcepl commented Aug 13, 2024

if not folded.endswith(self.policy.linesep):

Is there something special in the difference between linesep or self.policy.linesep or is it just a typo?

Linked PRs

@terryjreedy terryjreedy added topic-email type-bug An unexpected behavior, bug, or error easy labels Aug 13, 2024
@terryjreedy
Copy link
Member

Since the previous line 229 is linesep = self.policy.linesep, the self.policy in 230 is redundant, and should better be removed. I'd call this a buglet, though 'performance' might be a better label.

mcepl added a commit to openSUSE-Python/cpython that referenced this issue Aug 14, 2024
Fixes: python#122989
Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
mcepl added a commit to openSUSE-Python/cpython that referenced this issue Aug 14, 2024
@bitdancer
Copy link
Member

Yeah, it's probably a refactoring leftover from when the code was written.

terryjreedy pushed a commit that referenced this issue Sep 4, 2024
…23002)

`linesep` is already defined as `self.policy.linesep`.  It appears that previous refactor was not completed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy topic-email type-bug An unexpected behavior, bug, or error
Projects
None yet
3 participants