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
eded3499
Commit
eded3499
authored
May 20, 2004
by
Piers Lauder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed IMAP4_SSL read and readlines code per patch 956394
parent
f74fd2bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
Lib/imaplib.py
Lib/imaplib.py
+10
-7
No files found.
Lib/imaplib.py
View file @
eded3499
...
@@ -1100,21 +1100,24 @@ class IMAP4_SSL(IMAP4):
...
@@ -1100,21 +1100,24 @@ class IMAP4_SSL(IMAP4):
def
read
(
self
,
size
):
def
read
(
self
,
size
):
"""Read 'size' bytes from remote."""
"""Read 'size' bytes from remote."""
# sslobj.read() sometimes returns < size bytes
# sslobj.read() sometimes returns < size bytes
data
=
self
.
sslobj
.
read
(
size
)
chunks
=
[]
while
len
(
data
)
<
size
:
read
=
0
data
+=
self
.
sslobj
.
read
(
size
-
len
(
data
))
while
read
<
size
:
data
=
self
.
sslobj
.
read
(
size
-
read
)
read
+=
len
(
data
)
chunks
.
append
(
size
)
return
data
return
''
.
join
(
chunks
)
def
readline
(
self
):
def
readline
(
self
):
"""Read line from remote."""
"""Read line from remote."""
# NB: socket.ssl needs a "readline" method, or perhaps a "makefile" method.
# NB: socket.ssl needs a "readline" method, or perhaps a "makefile" method.
line
=
""
line
=
[]
while
1
:
while
1
:
char
=
self
.
sslobj
.
read
(
1
)
char
=
self
.
sslobj
.
read
(
1
)
line
+=
char
line
.
append
(
char
)
if
char
==
"
\
n
"
:
return
line
if
char
==
"
\
n
"
:
return
''
.
join
(
line
)
def
send
(
self
,
data
):
def
send
(
self
,
data
):
...
...
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