[issue45682] Nicer default logging format

2021-10-31 Thread Olaf van der Spek
Olaf van der Spek added the comment: > Except that people may have used the current basic format in, for example, > unit tests, and that code could break after a change like the one proposed. They too could pass a format argument themselves rather then relying on the default format

[issue45682] Nicer default logging format

2021-10-31 Thread Olaf van der Spek
New submission from Olaf van der Spek : The default logging format will print something like: WARNING:root:Hello Python! Could it default to something like this instead? 2021-10-31 14:52:36,490 WARNING: Hello Python! logging.basicConfig(format='%(asctime)s %(levelname)s: %(mess

[issue45351] List all sockets in TCP echo server using streams

2021-10-08 Thread Olaf van der Spek
Olaf van der Spek added the comment: > server = await asyncio.start_server(handle_echo, '127.0.0.1', ) If 127.0.0.1 is replaced by localhost, the server might listen on ::1 and 127.0.0.1 but only one address will be printed, which is confusing (and wrong IMO). So the

[issue45351] List all sockets in TCP echo server using streams

2021-10-03 Thread Olaf van der Spek
New submission from Olaf van der Spek : Replace: addr = server.sockets[0].getsockname() print(f'Serving on {addr}') By: for socket in server.sockets: addr = socket.getsockname() print(f'Serving on {addr}') https://docs.python.org/3/library/asyncio-stream.html -