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
Next Next commit
fast pass for no '='
  • Loading branch information
Marius-Juston committed Apr 3, 2025
commit 8362a2e6e76a271efa96393b06799861c99f7158
9 changes: 5 additions & 4 deletions Lib/email/quoprimime.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,15 @@ def header_decode(s):
the high level email.header class for that functionality.
"""
# Check for regex =[a-fA-F0-9]{2}
s = s.replace("_", " ")

if '=' not in s:
return s

result = []
s_len = len(s)
i = 0
last_append = 0
s = s.replace("_", " ")

while i < s_len:
if s[i] == '=' and i + 2 < s_len:
Expand All @@ -311,9 +315,6 @@ def header_decode(s):
continue
i += 1

if last_append == 0:
return s

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

Expand Down
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