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
joined to big if statement
  • Loading branch information
Marius-Juston committed Apr 3, 2025
commit a3ef5506062fb54012901899f0875b5f24e67dfd
22 changes: 11 additions & 11 deletions Lib/email/quoprimime.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,17 +288,17 @@ def header_decode(s):
"""
# Check for regex =[a-fA-F0-9]{2}
result = []
max_s_check_len = s - 2
for i, c in enumerate(s):
if c == '=' and i < max_s_check_len:
hex_part = s[i: i + 3]
if (hex_part[1] in hexdigits) and (hex_part[2] in hexdigits):
result.append(unquote(hex_part))
i += 3
continue

s_len = len(s)
i =0
while i < s_len:
c = s[i]

if c == '=' and i + 2 < s_len and s[i + 1] in hexdigits and s[i + 2] in hexdigits:
result.append(unquote(s[i: i + 3]))
i += 3
continue
result.append(' ' if c == '_' else c)
i += 1

return ''.join(result)
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