Skip to content

Conversation

@bainewedlock
Copy link

Description

In lock.py: changed

                _, val = lines

to

                val = lines[-1]

because it works with the current WMIC version and is generally less brittle.

Motivation and Context

#3050

I got the following error everytime I tried to run a luigi task:

ERROR: Uncaught exception in luigi
Traceback (most recent call last):
  (...)
  File "(...)\.venv\Lib\site-packages\luigi\lock.py", line 42, in getpcmd
    _, val = lines
    ^^^^^^
ValueError: too many values to unpack (expected 2)

Have you tested this? If so, how?

Tested on Windows 11.

@bainewedlock bainewedlock requested review from a team and dlstadther as code owners August 26, 2025 07:51
@dlstadther
Copy link
Collaborator

dlstadther commented Aug 27, 2025

Quick googling uncovers that wmic has been deprecated since Windows 10, version 21H1 and replaced by a powershell command. When asking an AI assistant for the powershell equivalent of this command, it gave:

Get-CimInstance Win32_Process -Filter "ProcessId={pid}" | Select-Object CommandLine

Perhaps see if the following can be a replacement command:

cmd = f"powershell.exe -Command Get-CimInstance Win32_Process -Filter \"ProcessId={pid}\" | Select-Object CommandLine"

Note: this is untested.

@bainewedlock
Copy link
Author

Quick googling uncovers that wmic has been deprecated since Windows 10, version 21H1 and replaced by a powershell command. When asking an AI assistant for the powershell equivalent of this command, it gave:

Get-CimInstance Win32_Process -Filter "ProcessId={pid}" | Select-Object CommandLine

Perhaps see if the following can be a replacement command:

cmd = f"powershell.exe -Command Get-CimInstance Win32_Process -Filter \"ProcessId={pid}\" | Select-Object CommandLine"

Note: this is untested.

Great thats even better, I added it

Copy link
Collaborator

@dlstadther dlstadther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for my absence here. This lgtm, but does need to be adjusted to pass the flake8 linting test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants