Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ef5bb25e
Commit
ef5bb25e
authored
May 23, 2019
by
Batuhan Taşkaya
Committed by
R. David Murray
May 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-27737: Allow whitespace only headers encoding (#13478)
parent
6bc59179
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletion
+6
-1
Lib/email/header.py
Lib/email/header.py
+1
-1
Lib/test/test_email/test_email.py
Lib/test/test_email/test_email.py
+3
-0
Misc/NEWS.d/next/Library/2019-05-22-02-25-31.bpo-27737.7bgKpa.rst
...S.d/next/Library/2019-05-22-02-25-31.bpo-27737.7bgKpa.rst
+2
-0
No files found.
Lib/email/header.py
View file @
ef5bb25e
...
...
@@ -431,7 +431,7 @@ class _ValueFormatter:
if
end_of_line
!=
(
' '
,
''
):
self
.
_current_line
.
push
(
*
end_of_line
)
if
len
(
self
.
_current_line
)
>
0
:
if
self
.
_current_line
.
is_onlyws
():
if
self
.
_current_line
.
is_onlyws
()
and
self
.
_lines
:
self
.
_lines
[
-
1
]
+=
str
(
self
.
_current_line
)
else
:
self
.
_lines
.
append
(
str
(
self
.
_current_line
))
...
...
Lib/test/test_email/test_email.py
View file @
ef5bb25e
...
...
@@ -4964,6 +4964,9 @@ A very long line that must get split to something other than at the
msg
[
'SomeHeader'
]
=
' value with leading ws'
self
.
assertEqual
(
str
(
msg
),
"SomeHeader: value with leading ws
\
n
\
n
"
)
def
test_whitespace_header
(
self
):
self
.
assertEqual
(
Header
(
' '
).
encode
(),
' '
)
# Test RFC 2231 header parameters (en/de)coding
...
...
Misc/NEWS.d/next/Library/2019-05-22-02-25-31.bpo-27737.7bgKpa.rst
0 → 100644
View file @
ef5bb25e
Allow whitespace only header encoding in ``email.header`` - by Batuhan
Taskaya
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment