Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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
Loading
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 22 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.