Skip to content

[Wine] SLVersionChecker crashes on wine due to lack of powershell support #20

@FelixWolf

Description

@FelixWolf
Traceback (most recent call last):
  File "SLVersionChecker.py", line 659, in <module>
  File "SLVersionChecker.py", line 655, in main
  File "SLVersionChecker.py", line 138, in leap
  File "SLVersionChecker.py", line 246, in leap_body
  File "util.py", line 100, in wrapper
  File "update_manager.py", line 406, in query_vvm
  File "update_manager.py", line 304, in make_VVM_UUID_hash
IndexError: list index out of range

My understanding is wine doesn't support powershell properly, as such the version checker will crash because the returned string is empty at

muuid = [line for line in muuid.splitlines() if line][-1].rstrip()

This occurs because [line for line in "".splitlines() if line][-1] evaluates all lines that are equal to "" as False, thus a empty array can occur.

There is two ways to fix this, I'm not sure which way is preferred:
1.

muuid = [line for line in muuid.splitlines() if line]
if len(muuid) == 0:
    muuid = None
else:
    muuid = muuid[-1].rstrip()
try:
    muuid = [line for line in muuid.splitlines() if line][-1].rstrip()
except IndexError:
    muuid = None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions