Message262980
The general answer here is you should avoid mixing calls to different abstraction layers. Either use only the file descriptor or only the socket object.
This is not limited to lifetime issues, other issues can occur. For example, setting a timeout on a socket puts the underlying file descriptor in non-blocking mode. So code using the file descriptor can fail with EAGAIN.
If you really want to use *both* a file descriptor and a socket object, you can use os.dup() on the file descriptor, so that the OS resources are truly independent. |
|
Date |
User |
Action |
Args |
2016-04-07 06:44:52 | pitrou | set | recipients:
+ pitrou, docs@python, martin.panter, josh.r, JoshN |
2016-04-07 06:44:52 | pitrou | set | messageid: <1460011492.71.0.393410043354.issue26703@psf.upfronthosting.co.za> |
2016-04-07 06:44:52 | pitrou | link | issue26703 messages |
2016-04-07 06:44:52 | pitrou | create | |
|