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
10ee7a7f
Commit
10ee7a7f
authored
Dec 30, 2002
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_bad_8bit_header(): Tests for optional argument `errors'. See SF
bug #648119.
parent
f4fdff71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
Lib/email/test/test_email.py
Lib/email/test/test_email.py
+11
-0
No files found.
Lib/email/test/test_email.py
View file @
10ee7a7f
...
@@ -2307,6 +2307,17 @@ A very long line that must get split to something other than at the
...
@@ -2307,6 +2307,17 @@ A very long line that must get split to something other than at the
h
=
Header
(
u'
\
u83ca
\
u5730
\
u6642
\
u592b
'
,
'utf-8'
)
h
=
Header
(
u'
\
u83ca
\
u5730
\
u6642
\
u592b
'
,
'utf-8'
)
eq
(
h
.
encode
(),
'=?utf-8?b?6I+K5Zyw5pmC5aSr?='
)
eq
(
h
.
encode
(),
'=?utf-8?b?6I+K5Zyw5pmC5aSr?='
)
def
test_bad_8bit_header
(
self
):
raises
=
self
.
assertRaises
eq
=
self
.
assertEqual
x
=
'Ynwp4dUEbay Auction Semiar- No Charge
\
x96
Earn Big'
raises
(
UnicodeError
,
Header
,
x
)
h
=
Header
()
raises
(
UnicodeError
,
h
.
append
,
x
)
eq
(
str
(
Header
(
x
,
errors
=
'replace'
)),
x
)
h
.
append
(
x
,
errors
=
'replace'
)
eq
(
str
(
h
),
x
)
# Test RFC 2231 header parameters (en/de)coding
# Test RFC 2231 header parameters (en/de)coding
...
...
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