[issue26756] fileinput handling of unicode errors from standard input

2016-05-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue26756] fileinput handling of unicode errors from standard input

2016-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Calling the openhook for the stdin will break existing code. Third-party openhooks don't special case the '' name, which is legitimate file name. Instead I recommend to patch sys.stdin explicitly in your program. sys.stdin =

[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._file =

[issue26756] fileinput handling of unicode errors from standard input

2016-04-14 Thread SilentGhost
SilentGhost added the comment: While documentation seems not entirely clear, the openhook only applies to files. I'm not sure what is the logic behind the suggested change, what would openhook do in your situation? -- components: +Library (Lib) nosy: +SilentGhost, serhiy.storchaka

[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 fileinput