Skip to content

Conversation

asvetlov
Copy link
Contributor

@asvetlov asvetlov commented Sep 14, 2019

@asvetlov
Copy link
Contributor Author

@1st1 here is a draft for the change you requested.
It needs more tests and docs update but the main code is done.
Please review to confirm that you agree with the design.

@tirkarthi
Copy link
Member

It creates some warnings as below :

➜  cpython git:(pr_16148) ./python.exe -Wall -m test test_asyncio
Run tests sequentially
0:00:00 load avg: 2.69 [1/1] test_asyncio
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_streams.py:1201: RuntimeWarning: The method Stream.close() is not awaited
  stream.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_streams.py:960: RuntimeWarning: The method Stream.write() is not awaited
  stream.write(b"foo\n")
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:171: DeprecationWarning: The method Stream.write() is not awaited
  self.stdin.write(input)
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:244: DeprecationWarning: The method Stream.write() is not awaited
  proc.stdin.write(data)
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:245: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await proc.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:119: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await proc.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:120: DeprecationWarning: The method Stream.close() is not awaited
  proc.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:171: DeprecationWarning: The method Stream.write() is not awaited
  self.stdin.write(input)
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:244: DeprecationWarning: The method Stream.write() is not awaited
  proc.stdin.write(data)
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:245: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await proc.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:119: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await proc.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:120: DeprecationWarning: The method Stream.close() is not awaited
  proc.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:171: DeprecationWarning: The method Stream.write() is not awaited
  self.stdin.write(input)
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:244: DeprecationWarning: The method Stream.write() is not awaited
  proc.stdin.write(data)
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:245: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await proc.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:119: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await proc.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:120: DeprecationWarning: The method Stream.close() is not awaited
  proc.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:171: DeprecationWarning: The method Stream.write() is not awaited
  self.stdin.write(input)
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:244: DeprecationWarning: The method Stream.write() is not awaited
  proc.stdin.write(data)
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:245: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await proc.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:176: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await self.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:184: DeprecationWarning: The method Stream.close() is not awaited
  self.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:119: DeprecationWarning: Stream.drain() method is deprecated since 3.8 and scheduled for removal in 3.12
  await proc.stdin.drain()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_asyncio/test_subprocess.py:120: DeprecationWarning: The method Stream.close() is not awaited
  proc.stdin.close()
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/asyncio/subprocess.py:92: DeprecationWarning: The method Stream.close() is not awaited
  pipe.close()
test_asyncio passed in 57 sec 220 ms

== Tests result: SUCCESS ==

1 test OK.

Total duration: 57 sec 229 ms
Tests result: SUCCESS

@asvetlov
Copy link
Contributor Author

Thanks for the comment.
I thought I ran tests with -Werror before submitting the patch.

@tirkarthi
Copy link
Member

The commit on my local branch is 1a801bd . FWIW I have proposed running CI on -Werror to catch these :) https://discuss.python.org/t/run-test-suite-with-werror-on-ci/2333

@asvetlov asvetlov closed this Dec 7, 2019
@asvetlov asvetlov deleted the bpo-38164-polishing-asyncio-Streams-API branch January 15, 2020 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants