[issue26756] fileinput handling of unicode errors from standard input

2016-04-14 Thread Joel Barry
New submission from Joel Barry: The openhook for fileinput currently will not be called when the input is from sys.stdin. However, if the input contains invalid UTF-8 sequences, a program with a hook that specifies errors='replace' will not behave as expected: $ cat x.py import

[issue26756] fileinput handling of unicode errors from standard input

2016-04-14 Thread Joel Barry
Joel Barry added the comment: I was suggesting that the openhook could somehow be applied to a *reopening* of sys.stdin. Something like this: 326c326,329 < self._file = sys.stdin --- > if self._openhook: > self._fi