Skip to content

[BUG] On Windows, liboslquery will have errors on import with invalid PATH variables #2109

@Alaska-001

Description

@Alaska-001

Describe the bug

When running import oslquery in Python, and you have a invalid path like C: in your environment variables, you will get a error.

To Reproduce

On Windows:

Evidence

Error message:

Traceback (most recent call last):
  File "/path/to/oslquery/__init__.py", line 10, in <module>
    os.add_dll_directory(path)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "<frozen os>", line 1165, in add_dll_directory
OSError: [WinError 87] The parameter is incorrect: 'C:'
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions