Skip to content

DLL load fails when on any drive other than C: #753

@ghost

Description

If the current working directory is not in the C: drive, then importing the win32api module will fail.

I:\>python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32api
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified path is invalid.
>>> quit()

I:\>C:

C:\>python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32api
>>> # No traceback is appears.
>>> quit()

C:\>

As you can see in the example above, when the command prompt is in the I: drive, the import statement fails. If the user switches to the C: drive and tries again, then the import statement succeeds.

Reported by: wecsam

Original Ticket: pywin32/bugs/753

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions