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
78378e89
Commit
78378e89
authored
Jul 31, 2015
by
Robert Collins
Browse files
Options
Browse Files
Download
Plain Diff
Issue #23779: imaplib raises TypeError if authenticator tries to abort.
Patch from Craig Holmquist.
parents
659fcb0a
5ccc18f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
1 deletion
+25
-1
Lib/imaplib.py
Lib/imaplib.py
+1
-1
Lib/test/test_imaplib.py
Lib/test/test_imaplib.py
+20
-0
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/imaplib.py
View file @
78378e89
...
@@ -1353,7 +1353,7 @@ class _Authenticator:
...
@@ -1353,7 +1353,7 @@ class _Authenticator:
def
process
(
self
,
data
):
def
process
(
self
,
data
):
ret
=
self
.
mech
(
self
.
decode
(
data
))
ret
=
self
.
mech
(
self
.
decode
(
data
))
if
ret
is
None
:
if
ret
is
None
:
return
'*'
# Abort conversation
return
b'*'
# Abort conversation
return
self
.
encode
(
ret
)
return
self
.
encode
(
ret
)
def
encode
(
self
,
inp
):
def
encode
(
self
,
inp
):
...
...
Lib/test/test_imaplib.py
View file @
78378e89
...
@@ -419,6 +419,26 @@ class ThreadedNetworkedTests(unittest.TestCase):
...
@@ -419,6 +419,26 @@ class ThreadedNetworkedTests(unittest.TestCase):
ret
,
data
=
client
.
login_cram_md5
(
"tim"
,
b"tanstaaftanstaaf"
)
ret
,
data
=
client
.
login_cram_md5
(
"tim"
,
b"tanstaaftanstaaf"
)
self
.
assertEqual
(
ret
,
"OK"
)
self
.
assertEqual
(
ret
,
"OK"
)
@
reap_threads
def
test_aborted_authentication
(
self
):
class
MyServer
(
SimpleIMAPHandler
):
def
cmd_AUTHENTICATE
(
self
,
tag
,
args
):
self
.
_send_textline
(
'+'
)
self
.
response
=
yield
if
self
.
response
==
b'*
\
r
\
n
'
:
self
.
_send_tagged
(
tag
,
'NO'
,
'[AUTHENTICATIONFAILED] aborted'
)
else
:
self
.
_send_tagged
(
tag
,
'OK'
,
'MYAUTH successful'
)
with
self
.
reaped_pair
(
MyServer
)
as
(
server
,
client
):
with
self
.
assertRaises
(
imaplib
.
IMAP4
.
error
):
code
,
data
=
client
.
authenticate
(
'MYAUTH'
,
lambda
x
:
None
)
def
test_linetoolong
(
self
):
def
test_linetoolong
(
self
):
class
TooLongHandler
(
SimpleIMAPHandler
):
class
TooLongHandler
(
SimpleIMAPHandler
):
def
handle
(
self
):
def
handle
(
self
):
...
...
Misc/ACKS
View file @
78378e89
...
@@ -603,6 +603,7 @@ Gerrit Holl
...
@@ -603,6 +603,7 @@ Gerrit Holl
Shane Holloway
Shane Holloway
Rune Holm
Rune Holm
Thomas Holmes
Thomas Holmes
Craig Holmquist
Philip Homburg
Philip Homburg
Naofumi Honda
Naofumi Honda
Jeffrey Honig
Jeffrey Honig
...
...
Misc/NEWS
View file @
78378e89
...
@@ -13,6 +13,9 @@ Core and Builtins
...
@@ -13,6 +13,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #23779: imaplib raises TypeError if authenticator tries to abort.
Patch from Craig Holmquist.
- Issue #23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch
- Issue #23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch
written by Matthieu Gautier.
written by Matthieu Gautier.
...
...
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