Skip to content

Commit f1dbf49

Browse files
committed
fixup! Reorder requirements file decoding
1 parent 5c49381 commit f1dbf49

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/pip/_internal/req/req_file.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,11 @@ def get_file_content(url: str, session: "PipSession") -> Tuple[str, str]:
595595

596596

597597
def _decode_req_file(data: bytes, url: str) -> str:
598+
# NOTE: Byte Order Marks other than the UTF-8 BOM (used by PEP 263)
599+
# aren't allowed as per the requirements.txt spec, but deprecating
600+
# them isn't feasible as Windows Powershell uses UTF-16 (usually
601+
# encountered while redirecting output to a requirements.txt).
602+
# Thus, they remain as implementation-defined behaviour :/
598603
for bom, encoding in BOMS:
599604
if data.startswith(bom):
600605
return data[len(bom) :].decode(encoding)

0 commit comments

Comments
 (0)