[issue38737] StreamReaderProtocol.eof_received() should return True only for _SSLProtocolTransport
New submission from Anthony Baire : We developed an alternate asyncio TLS transport based on GnuTLS (https://pypi.org/project/aio-gnutls-transport/). In this project we want to support half-closed TLS connections (WriteTransport.write_eof()). Unfortunately StreamReaderProtocol won't interoperate properly without a monkey patch because its eof_received() method returns True for any ssl transport (this is to avoid a warning in the _SSLProtocolTransport): def eof_received(self): self._stream_reader.feed_eof() if self._over_ssl: # Prevent a warning in SSLProtocol.eof_received: # "returning true from eof_received() # has no effect when using ssl" return False return True As this is an unspecified internal feature, very specific to the _SSLProtocolTransport class (which issues the warning), we think the test should be made explicitly against this class (see the attached patch). -- components: asyncio files: eof-received-over-ssl.diff keywords: patch messages: 356207 nosy: aba, asvetlov, yselivanov priority: normal severity: normal status: open title: StreamReaderProtocol.eof_received() should return True only for _SSLProtocolTransport type: behavior versions: Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file48701/eof-received-over-ssl.diff ___ Python tracker <https://bugs.python.org/issue38737> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)
Anthony Baire added the comment: I confirm the fix. It is clear that the separation between BaseChildWatcher and its subclasses is far from ideal. The first implementation was clean, but as the patch evolved interactions got complex to the point that BaseChildWatcher should not be considered as an API but rather as implementation details for the two other classes (eg. .add_child_handler() is implemented in subclasses whereas .remove_child_handler() is in the base class). At least it should be renamed as _BaseChildWatcher to make that clear. For set_loop, another possible name is 'attach_loop' (like in the doc string actually) -- nosy: +aba ___ Python tracker <http://bugs.python.org/issue19566> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)
Anthony Baire added the comment: I put a cleaner patch here: https://codereview.appspot.com/26220043/ -- ___ Python tracker <http://bugs.python.org/issue19566> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19850] asyncio: limit EINTR occurrences with SA_RESTART
Anthony Baire added the comment: The patch is fine, but it is hard to rely on it to prevent bugs from happening because that requires cooperation from all modules registering signal handlers. Anyway it facilitates reusing code that was not written for an event-driven context (and many will do that through .run_in_executor()). If the patch is accepted, it would be wise to write a note in .run_in_executor()'s doc saying that asyncio uses SA_RESTART by default in all its handler and that EINTR is prevented *as long as* no other handlers are registered elsewhere. -- nosy: +aba ___ Python tracker <http://bugs.python.org/issue19850> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com