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
dd888920
Commit
dd888920
authored
Jun 06, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #11893: Remove obsolete internal wrapper class `SSLFakeFile` in the smtplib module.
Patch by Catalin Iacob.
parent
c177a918
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
23 deletions
+6
-23
Lib/smtplib.py
Lib/smtplib.py
+3
-23
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/smtplib.py
View file @
dd888920
...
@@ -172,27 +172,6 @@ try:
...
@@ -172,27 +172,6 @@ try:
except ImportError:
except ImportError:
_have_ssl = False
_have_ssl = False
else:
else:
class SSLFakeFile:
"""A fake file like object that really wraps a SSLObject.
It only supports what is needed in smtplib.
"""
def __init__(self, sslobj):
self.sslobj = sslobj
def readline(self):
str = b""
chr = None
while chr != b"
\
n
":
chr = self.sslobj.read(1)
if not chr:
break
str += chr
return str
def close(self):
pass
_have_ssl = True
_have_ssl = True
...
@@ -322,6 +301,7 @@ class SMTP:
...
@@ -322,6 +301,7 @@ class SMTP:
if self.debuglevel > 0:
if self.debuglevel > 0:
print('
connect
:
', (host, port), file=stderr)
print('
connect
:
', (host, port), file=stderr)
self.sock = self._get_socket(host, port, self.timeout)
self.sock = self._get_socket(host, port, self.timeout)
self.file = None
(code, msg) = self.getreply()
(code, msg) = self.getreply()
if self.debuglevel > 0:
if self.debuglevel > 0:
print("connect:", msg, file=stderr)
print("connect:", msg, file=stderr)
...
@@ -669,7 +649,7 @@ class SMTP:
...
@@ -669,7 +649,7 @@ class SMTP:
self
.
sock
=
context
.
wrap_socket
(
self
.
sock
)
self
.
sock
=
context
.
wrap_socket
(
self
.
sock
)
else
:
else
:
self
.
sock
=
ssl
.
wrap_socket
(
self
.
sock
,
keyfile
,
certfile
)
self
.
sock
=
ssl
.
wrap_socket
(
self
.
sock
,
keyfile
,
certfile
)
self
.
file
=
SSLFakeFile
(
self
.
sock
)
self
.
file
=
None
# RFC 3207:
# RFC 3207:
# The client MUST discard any knowledge obtained from
# The client MUST discard any knowledge obtained from
# the server, such as the list of SMTP service extensions,
# the server, such as the list of SMTP service extensions,
...
@@ -853,7 +833,6 @@ if _have_ssl:
...
@@ -853,7 +833,6 @@ if _have_ssl:
new_socket
=
self
.
context
.
wrap_socket
(
new_socket
)
new_socket
=
self
.
context
.
wrap_socket
(
new_socket
)
else
:
else
:
new_socket
=
ssl
.
wrap_socket
(
new_socket
,
self
.
keyfile
,
self
.
certfile
)
new_socket
=
ssl
.
wrap_socket
(
new_socket
,
self
.
keyfile
,
self
.
certfile
)
self
.
file
=
SSLFakeFile
(
new_socket
)
return
new_socket
return
new_socket
__all__
.
append
(
"SMTP_SSL"
)
__all__
.
append
(
"SMTP_SSL"
)
...
@@ -890,6 +869,7 @@ class LMTP(SMTP):
...
@@ -890,6 +869,7 @@ class LMTP(SMTP):
# Handle Unix-domain sockets.
# Handle Unix-domain sockets.
try
:
try
:
self
.
sock
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
self
.
sock
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
self
.
file
=
None
self
.
sock
.
connect
(
host
)
self
.
sock
.
connect
(
host
)
except
socket
.
error
as
msg
:
except
socket
.
error
as
msg
:
if
self
.
debuglevel
>
0
:
if
self
.
debuglevel
>
0
:
...
...
Misc/NEWS
View file @
dd888920
...
@@ -187,6 +187,9 @@ Core and Builtins
...
@@ -187,6 +187,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #11893: Remove obsolete internal wrapper class ``SSLFakeFile`` in the
smtplib module. Patch by Catalin Iacob.
- Issue #12080: Fix a Decimal.power() case that took an unreasonably long time
- Issue #12080: Fix a Decimal.power() case that took an unreasonably long time
to compute.
to compute.
...
...
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