Skip to content

Pylauncher does not correctly detect a BOM when searching for the shebang #131020

Closed
@chris-eibl

Description

@chris-eibl

Bug report

Bug description:

This is due to

cpython/PC/launcher2.c

Lines 1080 to 1081 in 475f933

if (bytesRead > 3 && *b == 0xEF) {
if (*++b == 0xBB && *++b == 0xBF) {

for wich clang-cl creates the following warnings:

1>..\PC\launcher2.c(1080,29): warning : result of comparison of constant 239 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
1>..\PC\launcher2.c(1081,34): warning : result of comparison of constant 191 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
1>..\PC\launcher2.c(1081,18): warning : result of comparison of constant 187 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsbuildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions