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
c734c387
Commit
c734c387
authored
Aug 04, 2014
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Plain Diff
#20977: merge with 3.4.
parents
b398d3e4
d5774801
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
Lib/email/_header_value_parser.py
Lib/email/_header_value_parser.py
+3
-3
Lib/test/test_email/test__header_value_parser.py
Lib/test/test_email/test__header_value_parser.py
+12
-0
Misc/ACKS
Misc/ACKS
+1
-0
No files found.
Lib/email/_header_value_parser.py
View file @
c734c387
...
...
@@ -2897,7 +2897,7 @@ def parse_content_disposition_header(value):
try
:
token
,
value
=
get_token
(
value
)
except
errors
.
HeaderParseError
:
ctype
.
defects
.
append
(
errors
.
InvalidHeaderDefect
(
disp_header
.
defects
.
append
(
errors
.
InvalidHeaderDefect
(
"Expected content disposition but found {!r}"
.
format
(
value
)))
_find_mime_parameters
(
disp_header
,
value
)
return
disp_header
...
...
@@ -2928,8 +2928,8 @@ def parse_content_transfer_encoding_header(value):
try
:
token
,
value
=
get_token
(
value
)
except
errors
.
HeaderParseError
:
ct
ype
.
defects
.
append
(
errors
.
InvalidHeaderDefect
(
"Expected content tr
na
sfer encoding but found {!r}"
.
format
(
value
)))
ct
e_header
.
defects
.
append
(
errors
.
InvalidHeaderDefect
(
"Expected content tr
an
sfer encoding but found {!r}"
.
format
(
value
)))
else
:
cte_header
.
append
(
token
)
cte_header
.
cte
=
token
.
value
.
strip
().
lower
()
...
...
Lib/test/test_email/test__header_value_parser.py
View file @
c734c387
...
...
@@ -2443,6 +2443,18 @@ class TestParser(TestParserMixin, TestEmailBase):
self.assertEqual(str(address_list.addresses[1]),
str(address_list.mailboxes[2]))
def test_invalid_content_disposition(self):
content_disp = self._test_parse_x(
parser.parse_content_disposition_header,
";attachment", "; attachment", ";attachment",
[errors.InvalidHeaderDefect]*2
)
def test_invalid_content_transfer_encoding(self):
cte = self._test_parse_x(
parser.parse_content_transfer_encoding_header,
";foo", ";foo", ";foo", [errors.InvalidHeaderDefect]*3
)
@parameterize
class Test_parse_mime_version(TestParserMixin, TestEmailBase):
...
...
Misc/ACKS
View file @
c734c387
...
...
@@ -35,6 +35,7 @@ Billy G. Allie
Kevin Altis
Skyler Leigh Amador
Joe Amenta
Rose Ames
A. Amoroso
Mark Anacker
Shashwat Anand
...
...
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