[issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file

2019-04-10 Thread Chris Siebenmann
New submission from Chris Siebenmann : The easiest reproduction of this is: import tarfile tarfile.open("/dev/zero", "r:") (If you use plain "r" you get a hang in attempted lzma decoding.) I believe this is probably due to a missing 'elif

[issue18391] socket.fromfd()'s API is difficult or impossible to use correctly in general

2013-07-06 Thread Chris Siebenmann
New submission from Chris Siebenmann: socket.fromfd() requires you to supply at least the family and type of the file descriptor that you are turning into a Python socket object. However the socket module provides no documented way to determine what these actually are and there are any number of

[issue18391] socket.fromfd()'s API is difficult or impossible to use correctly in general

2013-07-06 Thread Chris Siebenmann
Chris Siebenmann added the comment: As far as I know, you can recover everything except the protocol portably on Unix (and fromfd() will already handwave the protocol). getsockopt() with SO_TYPE will give you the type. The family can be recovered by calling getsockname() with a plain struct