UnicodeDecode error when running lsmod_info script with "C" locale

Bug #1055730 reported by Daniel Manrique
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Medium
Daniel Manrique

Bug Description

This was observed when running Checkbox as root, such that LANG and LANGUAGE are set to "C".

Steps to reproduce:

$ LANG=C LANGUAGE=C /usr/share/checkbox/scripts/lsmod_info

Expected result:
- List of modules and versions

Actual result:
- When hitting "drm" module, which has a non-ASCII character (José), this trace appears:

dm_raid45: 3.2.0-30-generic
dm_region_hash: 3.2.0-30-generic
Traceback (most recent call last):
  File "/usr/share/checkbox/scripts/lsmod_info", line 32, in <module>
    sys.exit(main())
  File "/usr/share/checkbox/scripts/lsmod_info", line 18, in main
    stream, err = process.communicate()
  File "/usr/lib/python3.2/subprocess.py", line 819, in communicate
    return self._communicate(input)
  File "/usr/lib/python3.2/subprocess.py", line 1440, in _communicate
    self.stdout.encoding)
  File "/usr/lib/python3.2/subprocess.py", line 759, in _translate_newlines
    return data.decode(encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 207: ordinal not in range(128)

If modinfo will always output utf-8, one thing to do would be forcing string handling to use utf-8 always, regardless of autodetected charset based on locale.

Related branches

Daniel Manrique (roadmr)
Changed in checkbox:
status: New → Triaged
importance: Undecided → Medium
Changed in checkbox:
status: Triaged → In Progress
assignee: nobody → Brendan Donegan (brendan-donegan)
Changed in checkbox:
assignee: Brendan Donegan (brendan-donegan) → nobody
Changed in checkbox:
status: In Progress → Confirmed
Daniel Manrique (roadmr)
Changed in checkbox:
assignee: nobody → Daniel Manrique (roadmr)
status: Confirmed → In Progress
Zygmunt Krynicki (zyga)
Changed in checkbox:
status: In Progress → Fix Committed
Changed in checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.