Issue 178262
Summary shtest-encoding.py breaks with python 3.14
Labels new issue
Assignees
Reporter igorluppi
    The llvm-21-tools package ships a test file that contains non-UTF-8 characters without an encoding declaration, causing package installation to fail with Python 3.14.

**Affected Package**
llvm-21-tools 1:21.1.8-1ubuntu1

**Problematic File**
/usr/lib/llvm-21/build/utils/lit/tests/shtest-encoding.py

**Error**
When Python 3.14 is the default interpreter, installing llvm-21-tools triggers:
 SyntaxError: Non-UTF-8 code starting with '\xc2' on line 3, but no encoding declared

This occurs during package post-installation when Python attempts to byte-compile the file. The error causes llvm-21-tools configuration to fail, which blocks installation of:
- clang-tidy-21
- python3-pygments (via rtupdate hooks)
- Any package build-depending on LLVM 21 toolchain

**Impact**
This is a Python 3.14 transition blocker affecting the entire Ubuntu archive. Any package that build-depends on clang-21, clang-tidy-21, clang-tools-21, llvm-21-dev, or llvm-21-tools will fail to build when Python 3.14 is default.

**Technical Details**
Line 3 of shtest-encoding.py contains byte 0xc2 (non-UTF-8 character) but lacks a PEP 263 encoding declaration (e.g., # -*- coding: utf-8 -*-). Python 3.14 enforces PEP 263 strictly and fails to compile such files, while Python 3.13 is more lenient.

Verification:
$ python3.14 -m py_compile /usr/lib/llvm-21/build/utils/lit/tests/shtest-encoding.py
  File "/usr/lib/llvm-21/build/utils/lit/tests/shtest-encoding.py", line 3
SyntaxError: Non-UTF-8 code starting with '\xc2'

$ sed -n '3p' /usr/lib/llvm-21/build/utils/lit/tests/shtest-encoding.py | xxd
(shows 0xc2 byte)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to