Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
897d20ff
Commit
897d20ff
authored
Dec 12, 2017
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add and fix test_ftplib.py and test_asyncore.py for 3.6. See #1050 for a description of failures.
parent
4f9bb1d9
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1965 additions
and
9 deletions
+1965
-9
CHANGES.rst
CHANGES.rst
+4
-0
src/gevent/_ssl3.py
src/gevent/_ssl3.py
+19
-8
src/gevent/_sslgte279.py
src/gevent/_sslgte279.py
+4
-1
src/greentest/3.6/test_asyncore.py
src/greentest/3.6/test_asyncore.py
+847
-0
src/greentest/3.6/test_ftplib.py
src/greentest/3.6/test_ftplib.py
+1091
-0
No files found.
CHANGES.rst
View file @
897d20ff
...
...
@@ -156,6 +156,10 @@
``filename`` attribute set.
- The :class:`threading.Timer` class is now monkey-patched and can
be joined.
- :meth:`gevent.ssl.SSLSocket.unwrap` behaves more like the standard
library, including returning a SSLSocket and allowing certain
timeout-related SSL errors to propagate. The added standard
library tests ``test_ftplib.py`` now passes.
1.2.2 (2017-06-05)
==================
...
...
src/gevent/_ssl3.py
View file @
897d20ff
...
...
@@ -142,6 +142,7 @@ class SSLSocket(socket):
server_hostname
=
None
,
_session
=
None
,
# 3.6
_context
=
None
):
# pylint:disable=too-many-locals,too-many-statements,too-many-branches
if
_context
:
self
.
_context
=
_context
...
...
@@ -513,22 +514,32 @@ class SSLSocket(socket):
s
=
self
.
_sslobj
.
shutdown
()
break
except
SSLWantReadError
:
# Callers of this method expect to get a socket
# back, so we can't simply return 0, we have
# to let these be raised
if
self
.
timeout
==
0.0
:
r
eturn
0
r
aise
self
.
_wait
(
self
.
_read_event
)
except
SSLWantWriteError
:
if
self
.
timeout
==
0.0
:
r
eturn
0
r
aise
self
.
_wait
(
self
.
_write_event
)
self
.
_sslobj
=
None
# The return value of shutting down the SSLObject is the
# original wrapped socket, i.e., _contextawaresock. But that
# object doesn't have the gevent wrapper around it so it can't
# be used. We have to wrap it back up with a gevent wrapper.
sock
=
socket
(
family
=
s
.
family
,
type
=
s
.
type
,
proto
=
s
.
proto
,
fileno
=
s
.
fileno
())
s
.
detach
()
return
sock
# original wrapped socket passed to _wrap_socket, i.e.,
# _contextawaresock. But that object doesn't have the
# gevent wrapper around it so it can't be used. We have to
# wrap it back up with a gevent wrapper.
assert
s
is
self
.
_sock
# In the stdlib, SSLSocket subclasses socket.socket and passes itself
# to _wrap_socket, so it gets itself back. We can't do that, we have to
# pass our subclass of _socket.socket, _contextawaresock.
# So ultimately we should return ourself.
# See test_ftplib.py:TestTLS_FTPClass.test_ccc
return
self
else
:
raise
ValueError
(
"No SSL wrapper around "
+
str
(
self
))
...
...
src/gevent/_sslgte279.py
View file @
897d20ff
...
...
@@ -553,7 +553,10 @@ class SSLSocket(socket):
if
self
.
_sslobj
:
s
=
self
.
_sslobj_shutdown
()
self
.
_sslobj
=
None
return
socket
(
_sock
=
s
)
# match _ssl2; critical to drop/reuse here on PyPy
# match _ssl2; critical to drop/reuse here on PyPy
# XXX: _ssl3 returns an SSLSocket. Is that what the standard lib does on
# Python 2? Should we do that?
return
socket
(
_sock
=
s
)
else
:
raise
ValueError
(
"No SSL wrapper around "
+
str
(
self
))
...
...
src/greentest/3.6/test_asyncore.py
0 → 100644
View file @
897d20ff
This diff is collapsed.
Click to expand it.
src/greentest/3.6/test_ftplib.py
0 → 100644
View file @
897d20ff
This diff is collapsed.
Click to expand it.
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