Python print and wc with invalid argument leads to OSError
问题 I've come across some (to me) weird behaviour when piping the output of a Python script into wc with invalid arguments. λ python test.py Hello! λ python test.py | wc -li wc: unknown option -- i Try 'wc --help' for more information. Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='cp1252'> OSError: [Errno 22] Invalid argument What is happening here? My configuration is Windows 10 Cmder msysgit 2.5.1.windows.1 来源: https://stackoverflow.com/questions/32555219/python