[Bug 795346] New: /etc/os-release parser fails on comments or empty lines

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Apr 18 07:04:39 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=795346

            Bug ID: 795346
           Summary: /etc/os-release parser fails on comments or empty
                    lines
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: cerbero
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: wwwutz at gmail.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

command: ./cerbero-uninstalled bootstrap


If there is an empty line in /etc/os-release cerbero fails with

Traceback (most recent call last):
  File "./cerbero-uninstalled", line 8, in <module>
    from cerbero.main import main
  File "./cerbero/main.py", line 19, in <module>
    from cerbero import hacks
  File "./cerbero/hacks.py", line 95, in <module>
    from cerbero.utils.shell import call as shell_call
  File "./cerbero/utils/shell.py", line 45, in <module>
    PLATFORM = system_info()[0]
  File "./cerbero/utils/__init__.py", line 169, in system_info
    k,v = line.rstrip().split("=")
ValueError: not enough values to unpack (expected 2, got 1)

Comments introduced by '#' are parsed, so a missing '=' in the comment will
also trigger

Traceback (most recent call last):
  File "./cerbero-uninstalled", line 8, in <module>
    from cerbero.main import main
  File "./cerbero/main.py", line 19, in <module>
    from cerbero import hacks
  File "./cerbero/hacks.py", line 95, in <module>
    from cerbero.utils.shell import call as shell_call
  File "./cerbero/utils/shell.py", line 45, in <module>
    PLATFORM = system_info()[0]
  File "./cerbero/utils/__init__.py", line 169, in system_info
    k,v = line.rstrip().split("=")
ValueError: not enough values to unpack (expected 2, got 1)

whereas a commented '=' won't.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list