From: Terry Jan Reedy Date: Thu, 9 May 2013 03:42:41 +0000 (-0400) Subject: Issue 16584: in filecomp._cmp, catch IOError as well as os.error. X-Git-Tag: v2.7.5~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=673770c59d6b68c05aaa37cb3e45fb7f86aa7db3;p=thirdparty%2FPython%2Fcpython.git Issue 16584: in filecomp._cmp, catch IOError as well as os.error. Patch by Till Maas. --- diff --git a/Lib/filecmp.py b/Lib/filecmp.py index 4728317fce99..3a793819c642 100644 --- a/Lib/filecmp.py +++ b/Lib/filecmp.py @@ -268,7 +268,7 @@ def cmpfiles(a, b, common, shallow=1): def _cmp(a, b, sh, abs=abs, cmp=cmp): try: return not abs(cmp(a, b, sh)) - except os.error: + except (os.error, IOError): return 2 diff --git a/Misc/ACKS b/Misc/ACKS index 660f52ce1459..9e09abdf78ac 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -626,6 +626,7 @@ Mark Lutz Jim Lynch Mikael Lyngvig Martin von Löwis +Till Maas Jeff MacDonald John Machin Andrew I MacIntyre diff --git a/Misc/NEWS b/Misc/NEWS index 867ebc558a01..6eea7de41820 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -26,6 +26,9 @@ Core and Builtins Library ------- +- Issue 16584: in filecomp._cmp, catch IOError as well as os.error. + Patch by Till Maas. + - Issue #17926: Fix dbm.__contains__ on 64-bit big-endian machines. - Issue #17918: When using SSLSocket.accept(), if the SSL handshake failed