[Bug 80734] New: intel-gpu-tools/debugger/system_routine only builds in UTF-8 locales

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jun 30 15:19:20 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=80734

          Priority: medium
            Bug ID: 80734
          Assignee: chris at chris-wilson.co.uk
           Summary: intel-gpu-tools/debugger/system_routine only builds in
                    UTF-8 locales
        QA Contact: intel-gfx-bugs at lists.freedesktop.org
          Severity: minor
    Classification: Unclassified
                OS: All
          Reporter: ats-fd at offog.org
          Hardware: All
            Status: NEW
           Version: git
         Component: Driver/intel
           Product: xorg

Created attachment 102034
  --> https://bugs.freedesktop.org/attachment.cgi?id=102034&action=edit
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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-gfx-bugs/attachments/20140630/8b2cbd50/attachment-0001.html>


More information about the intel-gfx-bugs mailing list