Summary: |
[igt] intel-gpu-tools/debugger/system_routine only builds in UTF-8 locales |
Product: |
DRI
|
Reporter: |
Adam Sampson <ats-fd> |
Component: |
DRM/Intel | Assignee: |
Intel GFX Bugs mailing list <intel-gfx-bugs> |
Status: |
CLOSED
FIXED
|
QA Contact: |
Intel GFX Bugs mailing list <intel-gfx-bugs> |
Severity: |
minor
|
|
|
Priority: |
medium
|
CC: |
intel-gfx-bugs
|
Version: |
unspecified | |
|
Hardware: |
All | |
|
OS: |
All | |
|
Whiteboard: |
|
i915 platform:
|
|
i915 features:
|
|
Attachments: |
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 102034 [details] Specify the encoding explicitly If you try to compile intel-gpu-tools 1.7 in the C locale, where the default encoding is ASCII, you'll get this error: make[5]: Entering directory '/src/xorg/intel-gpu-tools/work/intel-gpu-tools-1.7/ debugger/system_routine' ./pre_cpp.py ./sr.g4a > sr.cpp.tmp && mv sr.cpp.tmp sr.cpp Traceback (most recent call last): File "./pre_cpp.py", line 38, in <module> lines = file.readlines() File "/gar/lib/python3.4/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 16: ordinal not in range(128) That's because pre_cpp.py is a Python 3 program, and it's just called open() on the file, which contains a UTF-8-encoded copyright symbol, without specifying an encoding. In that case, Python 3 defaults to whatever the locale's encoding is, so this'll work if your locale's encoding is UTF-8, but will either crash or misinterpret the file if not. One fix is to explicitly specify the encoding when opening the file. Patch attached.