work around incomplete broken pipe handling
Sascha Steinbiss
4 years ago
3 | 3 |
* Bump Standards-Version.
|
4 | 4 |
* Use debhelper 12.
|
5 | 5 |
* Add patch to disable test that assumes being run in a git workdir.
|
|
6 |
* Add patch to workaround incomplete broken pipe handling.
|
6 | 7 |
|
7 | 8 |
-- Sascha Steinbiss <satta@debian.org> Wed, 25 Sep 2019 21:35:22 +0200
|
8 | 9 |
|
|
0 |
Description: fix closed pipe handling
|
|
1 |
Author: Sascha Steinbiss <satta@debian.org>
|
|
2 |
Bug: https://github.com/jeffkaufman/icdiff/issues/156
|
|
3 |
Forwarded: https://github.com/jeffkaufman/icdiff/pull/165
|
|
4 |
Last-Update: 2019-09-25
|
|
5 |
--- a/icdiff
|
|
6 |
+++ b/icdiff
|
|
7 |
@@ -594,7 +594,22 @@
|
|
8 |
validate_has_two_arguments(parser, args)
|
|
9 |
if not options.cols:
|
|
10 |
set_cols_option(options)
|
|
11 |
- diff(options, *args)
|
|
12 |
+ try:
|
|
13 |
+ diff(options, *args)
|
|
14 |
+ except KeyboardInterrupt:
|
|
15 |
+ pass
|
|
16 |
+ except IOError as e:
|
|
17 |
+ if e.errno == errno.EPIPE:
|
|
18 |
+ pass
|
|
19 |
+ else:
|
|
20 |
+ raise
|
|
21 |
+
|
|
22 |
+ # Close stderr to prevent printing errors when icdiff is piped to
|
|
23 |
+ # something that closes before icdiff is done writing
|
|
24 |
+ #
|
|
25 |
+ # See: https://stackoverflow.com/questions/26692284/...
|
|
26 |
+ # ...how-to-prevent-brokenpipeerror-when-doing-a-flush-in-python
|
|
27 |
+ sys.stderr.close()
|
|
28 |
|
|
29 |
|
|
30 |
def codec_print(s, options):
|
|
31 |
@@ -755,18 +770,4 @@
|
|
32 |
|
|
33 |
|
|
34 |
if __name__ == "__main__":
|
|
35 |
- try:
|
|
36 |
- start()
|
|
37 |
- except KeyboardInterrupt:
|
|
38 |
- pass
|
|
39 |
- except IOError as e:
|
|
40 |
- if e.errno == errno.EPIPE:
|
|
41 |
- pass
|
|
42 |
- else:
|
|
43 |
- raise
|
|
44 |
- # Close stderr to prevent printing errors when icdiff is piped to
|
|
45 |
- # something that closes before icdiff is done writing
|
|
46 |
- #
|
|
47 |
- # See: https://stackoverflow.com/questions/26692284/
|
|
48 |
- # how-to-prevent-brokenpipeerror-when-doing-a-flush-in-python
|
|
49 |
- sys.stderr.close()
|
|
50 |
+ start()
|
|
0 |
fix-pipe-handling-installed.patch
|
0 | 1 |
use-python3.patch
|
1 | 2 |
disable-git-test.patch
|