Skip to content

gh-118761: email.quoprimime removing re import #132046

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 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
faster string concatenation
  • Loading branch information
Marius-Juston committed Apr 4, 2025
commit 865948664eb15f178d714b599a1a291a594b9360
10 changes: 5 additions & 5 deletions Lib/email/quoprimime.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def header_decode(s):
if '=' not in s:
return s

result = []
result = ''
s_len = len(s)
i = 0
last_append = 0
Expand All @@ -304,14 +304,14 @@ def header_decode(s):
if s[i] == '=' and i + 2 < s_len:
if (hex_str := s[i + 1:i + 3].lower()) in _HEX_TO_CHAR:
if last_append < i:
result.append(s[last_append:i])
result.append(_HEX_TO_CHAR[hex_str])
result += s[last_append:i]
result += _HEX_TO_CHAR[hex_str]
i += 3
last_append = i
continue
i += 1

if last_append < s_len:
result.append(s[last_append:])
result += s[last_append:]

return ''.join(result)
return result
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy