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
9045199c
Commit
9045199c
authored
Jul 31, 2018
by
twisteroid ambassador
Committed by
Andrew Svetlov
Jul 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-33833: Fix ProactorSocketTransport AssertionError (#7893)
parent
6921ef7b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
Lib/asyncio/proactor_events.py
Lib/asyncio/proactor_events.py
+4
-0
Lib/test/test_asyncio/test_proactor_events.py
Lib/test/test_asyncio/test_proactor_events.py
+13
-0
Misc/NEWS.d/next/Library/2018-06-17-11-46-20.bpo-33833.RnEqvM.rst
...S.d/next/Library/2018-06-17-11-46-20.bpo-33833.RnEqvM.rst
+2
-0
No files found.
Lib/asyncio/proactor_events.py
View file @
9045199c
...
...
@@ -343,6 +343,10 @@ class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport,
def
_loop_writing
(
self
,
f
=
None
,
data
=
None
):
try
:
if
f
is
not
None
and
self
.
_write_fut
is
None
and
self
.
_closing
:
# XXX most likely self._force_close() has been called, and
# it has set self._write_fut to None.
return
assert
f
is
self
.
_write_fut
self
.
_write_fut
=
None
self
.
_pending_write
=
0
...
...
Lib/test/test_asyncio/test_proactor_events.py
View file @
9045199c
...
...
@@ -257,6 +257,19 @@ class ProactorSocketTransportTests(test_utils.TestCase):
self
.
assertEqual
(
None
,
tr
.
_buffer
)
self
.
assertEqual
(
tr
.
_conn_lost
,
1
)
def
test_loop_writing_force_close
(
self
):
exc_handler
=
mock
.
Mock
()
self
.
loop
.
set_exception_handler
(
exc_handler
)
fut
=
asyncio
.
Future
(
loop
=
self
.
loop
)
fut
.
set_result
(
1
)
self
.
proactor
.
send
.
return_value
=
fut
tr
=
self
.
socket_transport
()
tr
.
write
(
b'data'
)
tr
.
_force_close
(
None
)
test_utils
.
run_briefly
(
self
.
loop
)
exc_handler
.
assert_not_called
()
def
test_force_close_idempotent
(
self
):
tr
=
self
.
socket_transport
()
tr
.
_closing
=
True
...
...
Misc/NEWS.d/next/Library/2018-06-17-11-46-20.bpo-33833.RnEqvM.rst
0 → 100644
View file @
9045199c
Fixed bug in asyncio where ProactorSocketTransport logs AssertionError if
force closed during write.
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