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
2b27e2e6
Commit
2b27e2e6
authored
Mar 12, 2017
by
Nikolay Kim
Committed by
Yury Selivanov
Mar 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-29742: asyncio get_extra_info() throws exception (#525)
parent
783d0c1a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
Lib/asyncio/sslproto.py
Lib/asyncio/sslproto.py
+3
-1
Lib/test/test_asyncio/test_sslproto.py
Lib/test/test_asyncio/test_sslproto.py
+12
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/asyncio/sslproto.py
View file @
2b27e2e6
...
...
@@ -543,8 +543,10 @@ class SSLProtocol(protocols.Protocol):
def
_get_extra_info
(
self
,
name
,
default
=
None
):
if
name
in
self
.
_extra
:
return
self
.
_extra
[
name
]
el
s
e
:
el
if
self
.
_transport
is
not
Non
e
:
return
self
.
_transport
.
get_extra_info
(
name
,
default
)
else
:
return
default
def
_start_shutdown
(
self
):
if
self
.
_in_shutdown
:
...
...
Lib/test/test_asyncio/test_sslproto.py
View file @
2b27e2e6
...
...
@@ -95,5 +95,17 @@ class SslProtoHandshakeTests(test_utils.TestCase):
test_utils
.
run_briefly
(
self
.
loop
)
self
.
assertIsInstance
(
waiter
.
exception
(),
ConnectionAbortedError
)
def
test_get_extra_info_on_closed_connection
(
self
):
waiter
=
asyncio
.
Future
(
loop
=
self
.
loop
)
ssl_proto
=
self
.
ssl_protocol
(
waiter
)
self
.
assertIsNone
(
ssl_proto
.
_get_extra_info
(
'socket'
))
default
=
object
()
self
.
assertIs
(
ssl_proto
.
_get_extra_info
(
'socket'
,
default
),
default
)
self
.
connection_made
(
ssl_proto
)
self
.
assertIsNotNone
(
ssl_proto
.
_get_extra_info
(
'socket'
))
ssl_proto
.
connection_lost
(
None
)
self
.
assertIsNone
(
ssl_proto
.
_get_extra_info
(
'socket'
))
if
__name__
==
'__main__'
:
unittest
.
main
()
Misc/NEWS
View file @
2b27e2e6
...
...
@@ -335,6 +335,9 @@ Library
-
bpo
-
28518
:
Start
a
transaction
implicitly
before
a
DML
statement
.
Patch
by
Aviv
Palivoda
.
-
bpo
-
29742
:
get_extra_info
()
raises
exception
if
get
called
on
closed
ssl
transport
.
Patch
by
Nikolay
Kim
.
-
Issue
#
16285
:
urrlib
.
parse
.
quote
is
now
based
on
RFC
3986
and
hence
includes
'~'
in
the
set
of
characters
that
is
not
quoted
by
default
.
Patch
by
Christian
Theune
and
Ratnadeep
Debnath
.
...
...
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