Skip to content

bpo-37027: Return a proxy socket object from transp.get_extra_info('socket')#13530

Merged
miss-islington merged 2 commits intopython:masterfrom
1st1:pseudo
May 27, 2019
Merged

bpo-37027: Return a proxy socket object from transp.get_extra_info('socket')#13530
miss-islington merged 2 commits intopython:masterfrom
1st1:pseudo

Conversation

@1st1
Copy link
Copy Markdown
Member

@1st1 1st1 commented May 23, 2019

Return a safe to use proxy socket object from transport.get_extra_info('socket')

https://bugs.python.org/issue37027

@1st1 1st1 requested a review from asvetlov May 23, 2019 22:48
@1st1 1st1 changed the title bpo-37027: Return a proxy socket object from transp.get_extra_info('s… bpo-37027: Return a proxy socket object from transp.get_extra_info('socket') May 23, 2019
Copy link
Copy Markdown
Contributor

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asyncio saves at least "process" and "pipe" in extra info.
Should we wrap these things too?
Should we wrap sockets from asyncio.Server()?

@1st1
Copy link
Copy Markdown
Member Author

1st1 commented May 27, 2019

Andrew, please re-review this PR (and please hit the merge button if it's ready). I've relaxed this PR - now all socket methods can be called as they are in 3.7, but we issue a warning that we won't support that in 3.9.

Comment thread Lib/asyncio/trsock.py

def shutdown(self, how):
# asyncio doesn't currently provide a high-level transport API
# to shutdown the connection.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically there is transport.write_eof() for closing writing.
There is no API for closing reading though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and I know some people use sock.shutdown for that. Should we add an API to transports?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, to make the transition to new Python smoother.
Not urgent, though. Minor thing.

@miss-islington
Copy link
Copy Markdown
Contributor

@1st1: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 8cd5165 into python:master May 27, 2019
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…ocket') (pythonGH-13530)

Return a safe to use proxy socket object from `transport.get_extra_info('socket')`




https://bugs.python.org/issue37027
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants