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
9603d4a2
Commit
9603d4a2
authored
Jun 09, 2011
by
R David Murray
Browse files
Options
Browse Files
Download
Plain Diff
merge #12283: Fixed regression in smtplib quoting of leading dots in DATA.
parents
113d932d
6af344b0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
Lib/smtplib.py
Lib/smtplib.py
+1
-1
Lib/test/test_smtplib.py
Lib/test/test_smtplib.py
+15
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/smtplib.py
View file @
9603d4a2
...
@@ -162,7 +162,7 @@ def quotedata(data):
...
@@ -162,7 +162,7 @@ def quotedata(data):
re.sub(r'
(
?
:
\
r
\
n
|
\
n
|
\
r
(
?!
\
n
))
', CRLF, data))
re.sub(r'
(
?
:
\
r
\
n
|
\
n
|
\
r
(
?!
\
n
))
', CRLF, data))
def _quote_periods(bindata):
def _quote_periods(bindata):
return re.sub(br'
(
?
m
)
^
\
.
', '
..
', bindata)
return re.sub(br'
(
?
m
)
^
\
.
',
b
'
..
', bindata)
def _fix_eols(data):
def _fix_eols(data):
return re.sub(r'
(
?
:
\
r
\
n
|
\
n
|
\
r
(
?!
\
n
))
', CRLF, data)
return re.sub(r'
(
?
:
\
r
\
n
|
\
n
|
\
r
(
?!
\
n
))
', CRLF, data)
...
...
Lib/test/test_smtplib.py
View file @
9603d4a2
...
@@ -278,6 +278,21 @@ class DebuggingServerTests(unittest.TestCase):
...
@@ -278,6 +278,21 @@ class DebuggingServerTests(unittest.TestCase):
mexpect
=
'%s%s
\
n
%s'
%
(
MSG_BEGIN
,
m
.
decode
(
'ascii'
),
MSG_END
)
mexpect
=
'%s%s
\
n
%s'
%
(
MSG_BEGIN
,
m
.
decode
(
'ascii'
),
MSG_END
)
self
.
assertEqual
(
self
.
output
.
getvalue
(),
mexpect
)
self
.
assertEqual
(
self
.
output
.
getvalue
(),
mexpect
)
def
testSendNeedingDotQuote
(
self
):
# Issue 12283
m
=
'.A test
\
n
.mes.sage.'
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
3
)
smtp
.
sendmail
(
'John'
,
'Sally'
,
m
)
# XXX (see comment in testSend)
time
.
sleep
(
0.01
)
smtp
.
quit
()
self
.
client_evt
.
set
()
self
.
serv_evt
.
wait
()
self
.
output
.
flush
()
mexpect
=
'%s%s
\
n
%s'
%
(
MSG_BEGIN
,
m
,
MSG_END
)
self
.
assertEqual
(
self
.
output
.
getvalue
(),
mexpect
)
def
testSendMessage
(
self
):
def
testSendMessage
(
self
):
m
=
email
.
mime
.
text
.
MIMEText
(
'A test message'
)
m
=
email
.
mime
.
text
.
MIMEText
(
'A test message'
)
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
3
)
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
3
)
...
...
Misc/NEWS
View file @
9603d4a2
...
@@ -187,6 +187,8 @@ Core and Builtins
...
@@ -187,6 +187,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #12283: Fixed regression in smtplib quoting of leading dots in DATA.
- Issue #10424: Argparse now includes the names of the missing required
- Issue #10424: Argparse now includes the names of the missing required
arguments in the missing arguments error message.
arguments in the missing arguments error message.
...
...
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