Comment 1 for bug 844733

Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote : Re: oneiric hook /usr/share/apport/package-hooks//xserver-xorg-core.py crash ValueError: need more than 1 value to unpack

     for paragraph in display_pci.split('\n\n'):
        for line in paragraph.split('\n'):
            if ':' not in line:
                continue
            key, value = line.split(': ', 1)
            value = value.strip()
            key = key.strip()

The ValueError occurs on the line
    key, value = line.split(': ', 1)

The problem is line.split returns ['\t\tDevCap:\tMaxPayload 128 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited']
Note :\t is not matched by the split on ': '

Fix:

--- /usr/share/apport/package-hooks/xserver-xorg-core.py.orig 2011-09-14 03:00:44.392362002 +0100
+++ /usr/share/apport/package-hooks/xserver-xorg-core.py 2011-09-14 03:01:52.102362002 +0100
@@ -338,7 +338,10 @@
         for line in paragraph.split('\n'):
             if ':' not in line:
                 continue
- key, value = line.split(': ', 1)
+ m = re.match(r'(.*?):\s(.*)', line)
+ if not m:
+ continue
+ key, value = m.group(1), m.group(2)
             value = value.strip()
             key = key.strip()
             if "VGA compatible controller" in key: