non-utf8 characters in Xorg.0.log cause color_depth_info and graphics_driver to throw UnicodeDecodeError exception

Bug #1048096 reported by Daniel Manrique
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Undecided
Daniel Manrique

Bug Description

One system contains weird characters in its Xorg.0.log file, this information is probably sent by the graphics chipset or firmware. This causes the mentioned tests to fail with this exception:

./color_depth_info
Traceback (most recent call last):
  File "./color_depth_info", line 58, in <module>
    main()
  File "./color_depth_info", line 55, in main
    print('Color Depth: %s\nPixmap Format: %s bpp' % get_color_depth("/home/roadmr/Desktop"))
  File "./color_depth_info", line 47, in get_color_depth
    f.read()):
  File "/usr/lib/python3.2/codecs.py", line 300, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position 32: invalid start byte

I'm attaching an example excerpt from Xorg.0.log which triggers the failure. Apologies for not including the complete file; this is a prerelease system and the file may contain confidential information.

Related branches

Revision history for this message
Daniel Manrique (roadmr) wrote :
Revision history for this message
Daniel Manrique (roadmr) wrote :

This is the error for graphics_driver:

$ ./graphics_driver
Traceback (most recent call last):
  File "./graphics_driver", line 323, in <module>
    sys.exit(main())
  File "./graphics_driver", line 314, in main
    xlog = XorgLog("/home/roadmr/Desktop/Xorg.0.log")
  File "./graphics_driver", line 63, in __init__
    self.parse(logfile)
  File "./graphics_driver", line 73, in parse
    for line in in_file.readlines():
  File "/usr/lib/python3.2/codecs.py", line 300, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position 32: invalid start byte

Daniel Manrique (roadmr)
Changed in checkbox:
status: New → In Progress
assignee: nobody → Daniel Manrique (roadmr)
Marc Tardif (cr3)
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.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

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