[issue34852] Counter-intuitive behavior of Server.close() / wait_closed()

2021-05-30 Thread Aymeric Augustin
Aymeric Augustin added the comment: Would it make sense to add `await asyncio.sleep(0)` in `Server.wait_closed()` to ensure that all connections reach `connection_made()` before `wait_closed()` returns? This would be fragile but it would be an improvement over the current behavior

[issue41597] Fatal Error on SSL Transport - sslv3 alert bad record mac

2020-08-20 Thread Aymeric Augustin
Aymeric Augustin added the comment: websockets doesn't use threads (except where asyncio uses them under the hood e.g. for resolving addresses). Perhaps the OP's code passes asyncio connections (wrapped in websocket connections) unsafely across threads. -- nosy: +aymeric.augustin

[issue37639] What happened to StreamReaderProtocol?

2019-07-23 Thread Aymeric Augustin
Change by Aymeric Augustin : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue37639> ___ ___ Python-bugs-list

[issue37639] What happened to StreamReaderProtocol?

2019-07-21 Thread Aymeric Augustin
New submission from Aymeric Augustin : `StreamReaderProtocol` was a public API from Python 3.4 to 3.6: - https://docs.python.org/3.4/library/asyncio-stream.html?highlight=streamreaderprotocol#streamreaderprotocol - https://docs.python.org/3.5/library/asyncio-stream.html?highlight

[issue34506] Traceback logged when SSL handshake fails

2019-06-17 Thread Aymeric Augustin
Aymeric Augustin added the comment: Yes, that seems reasonable. -- ___ Python tracker <https://bugs.python.org/issue34506> ___ ___ Python-bugs-list mailin

[issue34506] Traceback logged when SSL handshake fails

2019-06-16 Thread Aymeric Augustin
Aymeric Augustin added the comment: The same issue was reported in the bug tracker for websockets: https://github.com/aaugustin/websockets/issues/614 -- nosy: +aymeric.augustin ___ Python tracker <https://bugs.python.org/issue34

[issue29980] OSError: multiple exceptions should preserve the exception type if it is common

2019-04-13 Thread Aymeric Augustin
Aymeric Augustin added the comment: A very similar issue came up here: https://github.com/aaugustin/websockets/issues/593 When raising an exception that gathers multiple sub-exceptions, it would be nice to be able to iterate the exception to access the sub-exceptions. -- nosy

[issue34852] Counter-intuitive behavior of Server.close() / wait_closed()

2018-09-30 Thread Aymeric Augustin
Aymeric Augustin added the comment: For now I will use the following hack: server.close() await server.wait_closed() # Workaround for wait_closed() not quite doing # what I want. await asyncio.sleep(0) # I believe that all accepted connections have reached

[issue34852] Counter-intuitive behavior of Server.close() / wait_closed()

2018-09-30 Thread Aymeric Augustin
New submission from Aymeric Augustin : **Summary** 1. Is it correct for `Server.wait_closed()` (as implemented in asyncio) to be a no-op after `Server.close()`? 2. How can I tell that all incoming connections have been received by `connection_made()` after `Server.close()`? **Details

[issue33727] Server.wait_closed() doesn't always wait for its transports to fihish

2018-09-30 Thread Aymeric Augustin
Aymeric Augustin added the comment: I believe this is by design: the documentation says: > The sockets that represent existing incoming client connections are left open. `Server` doesn't keep track of active transports serving requests. (That said, I haven't figured out what _wait

[issue31491] Add is_closing() to asyncio.StreamWriter.

2017-09-16 Thread Aymeric Augustin
New submission from Aymeric Augustin: asyncio.StreamWriter wraps a transport. The first three document methods of asyncio.BaseTransport are close(), is_closing() and get_extra_info(). It is somewhat surprising that StreamWriter provides close() and get_extra_info() but not is_closing(). I'm

[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

2017-09-09 Thread Aymeric Augustin
Aymeric Augustin added the comment: I worked around this bug in websockets by serializing access to `drain()` with a lock: https://github.com/aaugustin/websockets/commit/198b71537917adb44002573b14cbe23dbd4c21a2 I suspect this is inefficient but it beats crashing

[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

2017-03-29 Thread Aymeric Augustin
Aymeric Augustin added the comment: drain() returns when the write buffer reaches the low water mark, not when it's empty, so you don't have a guarantee that your bytes were written to the socket. https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/asyncio

[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

2017-03-28 Thread Aymeric Augustin
Aymeric Augustin added the comment: For context, websockets calls `yield from self.writer.drain()` after each write in order to provide backpressure. If the output buffer fills up, calling API coroutines that write to the websocket connection becomes slow and hopefully the backpressure

[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2016-09-07 Thread Aymeric Augustin
Aymeric Augustin added the comment: The latest patch removes the current statement parsing and unexpected implicit commits. It looks good to me. Unfortunately it also introduces a new kind of statement parsing that detects DDL statements and doesn't open a transaction in that case, while

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-18 Thread Aymeric Augustin
Aymeric Augustin added the comment: martin.panter: of course, I'm fine with integrating that code into Python. deronnax: could you create a ticket on https://code.djangoproject.com/ highlighting the differences between Django's original implementation and the improved version that you worked

[issue24539] StreamReaderProtocol.eof_received() should return True to keep the transport open

2015-10-31 Thread Aymeric Augustin
Aymeric Augustin added the comment: This change appears to have caused a non-obvious regression in `websockets`: https://github.com/aaugustin/websockets/issues/76 Perhaps I was relying on an implementation detail but that's annoying nonetheless. -- nosy: +aymeric.augustin

[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2015-08-25 Thread Aymeric Augustin
Aymeric Augustin added the comment: Since a better solution seems to be around the corner, I'm withdrawing my proposal. I'm attaching the current state of my patch. It isn't functional. Mostly it proves that my API proposal is very inconvenient to implement in C. That's why I kept it around

[issue24885] StreamReaderProtocol docs recommend using private API

2015-08-18 Thread Aymeric Augustin
New submission from Aymeric Augustin: https://docs.python.org/3/library/asyncio-stream.html?highlight=streamreaderprotocol#stream-functions says: (If you want to customize the StreamReader and/or StreamReaderProtocol classes, just copy the code – there’s really nothing special here except

[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2015-08-18 Thread Aymeric Augustin
Aymeric Augustin added the comment: This bug appears to be fixed upstream: https://github.com/ghaering/pysqlite/commit/f254c534948c41c0ceb8cbabf0d4a2f547754739 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10740

[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2014-06-15 Thread Aymeric Augustin
Aymeric Augustin added the comment: Jim, I believe this API decision doesn't affect the patch in a major way. I'll write the rest of the patch and the committer who reviews it will decide. -- ___ Python tracker rep...@bugs.python.org http

[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2014-06-14 Thread Aymeric Augustin
Aymeric Augustin added the comment: The idea was to not take away from what's there already: The sqlite3 module already has a feature to inspect a command and begin or commit automatically. Just stripping that away *removes* a feature that has been available for a long time. I'd rather

[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2014-06-14 Thread Aymeric Augustin
Aymeric Augustin added the comment: If this statement is accurate, the what you are proposing is just a different (presumably clearer) spelling for 'isolation_level = None'? This statement is accurate but it doesn't cover the whole scope of what I'm attempting to fix. I'm also trying

[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2014-06-13 Thread Aymeric Augustin
Aymeric Augustin added the comment: Thanks for your feedback! Indeed this is a documentation patch describing what I could implement if a core dev gave the slightest hint that it stands a small chance of getting included. There's no point in writing code that Python core doesn't want. I

[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2014-06-13 Thread Aymeric Augustin
Aymeric Augustin added the comment: The problem is super simple: connection = ... cursor = connection.cursor() cursor.execute(SAVEPOINT foo) cursor.execute(ROLLBACK TO SAVEPOINT foo) # will report that the savepoint doesn't exist. Please don't make it look more complicated than

[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2014-06-06 Thread Aymeric Augustin
Aymeric Augustin added the comment: I'm attaching a documentation patch describing improvements of the transaction management APIs that would address this issue as well as three others. It's preserving the current transaction handling by default for backwards compatibility. It's introducing