[issue21927] BOM appears in stdin when using Powershell

Jason R. Coombs report at bugs.python.org
Sun Jul 6 16:39:22 CEST 2014


New submission from Jason R. Coombs:

Consider this simple example in Powershell (Windows 8.1):

C:\Users\jaraco> cat .\print-input.py
import sys
print(next(sys.stdin))

C:\Users\jaraco> echo foo | .\print-input.py
foo

The BOM (byte order mark) appears in the standard input stream. When using cmd.exe, the BOM is not present. This behavior occurs in CP1252 as well as CP65001.

I suspect that Python should be detecting/stripping and possibly honoring the BOM when decoding input on stdin.

This issue is present in Python 3.4.0 and Python 3.4.1. I have not tested other Python versions.

----------
components: Unicode, Windows
messages: 222406
nosy: ezio.melotti, haypo, jason.coombs
priority: normal
severity: normal
status: open
title: BOM appears in stdin when using Powershell
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21927>
_______________________________________


More information about the Python-bugs-list mailing list