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
dbe7519d
Commit
dbe7519d
authored
Nov 16, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #10429: IMAP.starttls() stored the capabilities as bytes objects,
rather than strings.
parent
36c0dbc9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
Lib/imaplib.py
Lib/imaplib.py
+11
-11
Lib/test/test_imaplib.py
Lib/test/test_imaplib.py
+6
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/imaplib.py
View file @
dbe7519d
...
...
@@ -196,13 +196,7 @@ class IMAP4:
else
:
raise
self
.
error
(
self
.
welcome
)
typ
,
dat
=
self
.
capability
()
if
dat
==
[
None
]:
raise
self
.
error
(
'no CAPABILITY response from server'
)
dat
=
str
(
dat
[
-
1
],
"ASCII"
)
dat
=
dat
.
upper
()
self
.
capabilities
=
tuple
(
dat
.
split
())
self
.
_get_capabilities
()
if
__debug__
:
if
self
.
debug
>=
3
:
self
.
_mesg
(
'CAPABILITIES: %r'
%
(
self
.
capabilities
,))
...
...
@@ -737,10 +731,7 @@ class IMAP4:
self
.
sock
=
ssl_context
.
wrap_socket
(
self
.
sock
)
self
.
file
=
self
.
sock
.
makefile
(
'rb'
)
self
.
_tls_established
=
True
typ
,
dat
=
self
.
capability
()
if
dat
==
[
None
]:
raise
self
.
error
(
'no CAPABILITY response from server'
)
self
.
capabilities
=
tuple
(
dat
[
-
1
].
upper
().
split
())
self
.
_get_capabilities
()
else
:
raise
self
.
error
(
"Couldn't establish TLS session"
)
return
self
.
_untagged_response
(
typ
,
dat
,
name
)
...
...
@@ -956,6 +947,15 @@ class IMAP4:
return
typ
,
data
def
_get_capabilities
(
self
):
typ
,
dat
=
self
.
capability
()
if
dat
==
[
None
]:
raise
self
.
error
(
'no CAPABILITY response from server'
)
dat
=
str
(
dat
[
-
1
],
"ASCII"
)
dat
=
dat
.
upper
()
self
.
capabilities
=
tuple
(
dat
.
split
())
def
_get_response
(
self
):
# Read response and store.
...
...
Lib/test/test_imaplib.py
View file @
dbe7519d
...
...
@@ -208,6 +208,8 @@ class RemoteIMAPTest(unittest.TestCase):
self
.
server
.
logout
()
def
test_logincapa
(
self
):
for
cap
in
self
.
server
.
capabilities
:
self
.
assertIsInstance
(
cap
,
str
)
self
.
assertTrue
(
'LOGINDISABLED'
in
self
.
server
.
capabilities
)
self
.
assertTrue
(
'AUTH=ANONYMOUS'
in
self
.
server
.
capabilities
)
rs
=
self
.
server
.
login
(
self
.
username
,
self
.
password
)
...
...
@@ -228,6 +230,8 @@ class RemoteIMAP_STARTTLSTest(RemoteIMAPTest):
self
.
assertEqual
(
rs
[
0
],
'OK'
)
def
test_logincapa
(
self
):
for
cap
in
self
.
server
.
capabilities
:
self
.
assertIsInstance
(
cap
,
str
)
self
.
assertFalse
(
'LOGINDISABLED'
in
self
.
server
.
capabilities
)
...
...
@@ -237,6 +241,8 @@ class RemoteIMAP_SSLTest(RemoteIMAPTest):
imap_class
=
IMAP4_SSL
def
test_logincapa
(
self
):
for
cap
in
self
.
server
.
capabilities
:
self
.
assertIsInstance
(
cap
,
str
)
self
.
assertFalse
(
'LOGINDISABLED'
in
self
.
server
.
capabilities
)
self
.
assertTrue
(
'AUTH=PLAIN'
in
self
.
server
.
capabilities
)
...
...
Misc/NEWS
View file @
dbe7519d
...
...
@@ -13,6 +13,9 @@ Core and Builtins
Library
-------
- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects,
rather than strings.
What's New in Python 3.2 Alpha 4?
=================================
...
...
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