This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients christian.heimes, martin.panter, neologix, pitrou
Date 2017-01-23.22:03:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM11j-cbRjQB-CGhX1kvrrM4-QvNUnwwu-WFJQK_YgXk2Q@mail.gmail.com>
In-reply-to <1485092861.97.0.0667849204017.issue29343@psf.upfronthosting.co.za>
Content
FWIW I agree with Antoine and Martin: ignoring EBADF is a bad idea,
quite dangerous.
The man page probably says this to highlight that users shouldn't
*retry* close():
"""
       Retrying the close() after a failure return is the wrong thing to do,
       since this may cause a reused file descriptor from another thread to
       be closed.  This can occur because the Linux kernel always releases
       the file descriptor early in the close operation, freeing it for
       reuse; the steps that may return an error, such as flushing data to
       the filesystem or device, occur only later in the close operation.

"""

(Including on EINTR).

In short, I think that the change is a good idea: Socket.close() is
guaranteed to be idempotent, so this error can only happen in case of
invalid usage.
History
Date User Action Args
2017-01-23 22:03:48neologixsetrecipients: + neologix, pitrou, christian.heimes, martin.panter
2017-01-23 22:03:48neologixlinkissue29343 messages
2017-01-23 22:03:48neologixcreate