#4032·Nuitka

MSYS2 PyWin32 DLL collection fails on unnormalized path (Python 3.14)

Author: abcfy2Created Sep 9, 2026Updated Sep 16, 2026
Labelsbugexcellent_report

Bug Report

Bug Description

On MSYS2 CLANG64 Python 3.14, compiling an otherwise minimal program that imports win32api fails in Nuitka's built-in dll-files plugin. It supplies the pywin32 pythoncom314.dll source path with forward slashes to an entry-point constructor that asserts the path is already normalized.

The program executes successfully with standard Python. The failure reproduces with Nuitka 4.2.1 and with current develop (4.3rc2, commit 58e718e956c98dc48f18666b5224439fc16291d9).

️ Environment

1. Nuitka Version, Python Version, OS, and Platform

Full output of D:\msys64\clang64\bin\python.exe -m nuitka --version:

4.2.1
Update status: up to date with stable release '4.2.1' (cached, 1 hour old).
Commercial: None
Python: 3.14.7 (main, Aug  8 2026, 15:00:43)  [MINGW Clang UCRT 22.1.8 64 bit (AMD64) (GCC)]
Flavor: MSYS2 MinGW
GIL: yes
Executable: D:\msys64\clang64\bin\python.exe
OS: Windows
Arch: x86_64
WindowsRelease: 11
Nuitka-Scons: Non downloaded winlibs-gcc 'D:\msys64\clang64\bin\gcc.exe' is being ignored, Nuitka is very dependent on the precise one.
FATAL: Error, cannot locate suitable C compiler. You have the following options:

a) If a suitable Visual Studio version is installed (check above trace
   outputs for rejection messages), it will be located automatically via
   registry. But not if you activate the wrong prompt, so don't do that
   unless you know what you are doing.

b) Using "--mingw64" forces Nuitka download MinGW64 for you, but only for
   Python version 3.12 and below, newer versions cannot use it. Note: MinGW64
   is the project name, it does *not* mean 64 bits, just a gcc with better
   Windows compatibility, it is available for 32 and 64 bits. Cygwin based
   gcc e.g. do not work.

c) Using "--zig" forces Nuitka download and use Zig for C compilation, but
   this only works with 64 bit Python versions.

The reproducer below explicitly uses --zig; Zig 0.17.0 is at D:\msys64\clang64\bin\zig.exe.

2. How Nuitka and Python Were Installed

  • Python: MSYS2 CLANG64 Python 3.14.7 at D:\msys64\clang64\bin\python.exe.
  • Nuitka 4.2.1: installed with pip --user, at C:\Users\FengYu\.local\lib\python3.14-mingw_x86_64_ucrt_llvm\site-packages.
  • Current develop: cloned from the Nuitka repository and invoked as python bin/nuitka; it also reproduced the failure.
  • pywin32: installed from MSYS2 as mingw-w64-clang-x86_64-python-pywin32.

3. Relevant PyPI Packages and Versions

Output of python -m pip show Nuitka pywin32:

Name: Nuitka
Version: 4.2.1
Summary: Python compiler with full language support and CPython compatibility
Home-page: https://nuitka.net
Author: Kay Hayen
Author-email: [email protected]
License: GNU Affero General Public License v3
Location: C:/Users/FengYu/.local/lib/python3.14-mingw_x86_64_ucrt_llvm/site-packages
Requires:
Required-by:
---
Name: pywin32
Version: 310
Summary: Python for Window Extensions
Home-page: https://github.com/mhammond/pywin32
Author: Mark Hammond (et al)
Author-email: [email protected]
License: PSF
Location: D:/msys64/clang64/lib/python3.14/site-packages
Requires:
Required-by:

Relevant entries from python -m nuitka --list-distribution-metadata:

Nuitka 4.2.1 pip
pywin32 310 MSYS2 MinGW
PyQt5 5.15.11 pyqtbuild
PyQt6 6.11.0 pyqtbuild

️ To Reproduce

1. "Hello World" Test

A print("hello world") program compiles successfully with Nuitka 4.2.1 and --zig. The following SSCCE executes successfully with standard Python:

win32api imported

2. Short, Self-Contained, Correct, Eligible (SSCCE) Example

python
import win32api

print("win32api imported")

3. Nuitka Command Line Options

powershell
& 'D:\msys64\clang64\bin\python.exe' -m nuitka `
  --zig `
  --mode=standalone `
  --output-dir=C:\Users\FengYu\AppData\Local\Temp\nuitka-powershell-build `
  C:\Users\FengYu\AppData\Local\Temp\nuitka-pywin32-repro.py

The same command fails from both an MSYS2 shell and Windows PowerShell.

Expected Behavior

Nuitka should normalize the pywin32 DLL source path before creating its DLL entry point and compile the program successfully.

Actual Behavior & Output

Nuitka-Options: Used command line options:
Nuitka-Options:   --zig --mode=standalone --output-dir=C:\Users\FengYu\AppData\Local\Temp\nuitka-powershell-build ~\AppData\Local\Temp\nuitka-pywin32-repro.py
Nuitka: Starting Python compilation with:
Nuitka:   Version '4.2.1' on Python 3.14 (flavor 'MSYS2 MinGW') commercial grade 'not installed'.
Traceback (most recent call last):
  File "C:/Users/FengYu/.local/lib/python3.14-mingw_x86_64_ucrt_llvm/site-packages/nuitka/plugins/Plugins.py", line 110, in withPluginProblemReporting
    yield
  File "C:/Users/FengYu/.local/lib/python3.14-mingw_x86_64_ucrt_llvm/site-packages/nuitka/plugins/Plugins.py", line 782, in considerExtraDlls
    for entry_point in _iterateExtraBinaries(
                       ~~~~~~~~~~~~~~~~~~~~~^
        plugin, plugin.getExtraDlls(module)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ):
    ^
  File "C:/Users/FengYu/.local/lib/python3.14-mingw_x86_64_ucrt_llvm/site-packages/nuitka/plugins/Plugins.py", line 771, in _iterateExtraBinaries
    for val in value:
               ^^^^^
  File "C:/Users/FengYu/.local/lib/python3.14-mingw_x86_64_ucrt_llvm/site-packages/nuitka/plugins/standard/DllFilesPlugin.py", line 440, in getExtraDlls
    yield self.makeDllEntryPoint(
          ~~~~~~~~~~~~~~~~~~~~~~^
        source_path=pythoncom_dll_path,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        reason="needed by '%s'" % full_name.asString(),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:/Users/FengYu/.local/lib/python3.14-mingw_x86_64_ucrt_llvm/site-packages/nuitka/plugins/PluginBase.py", line 941, in makeDllEntryPoint
    return makeDllEntryPoint(
        logger=self,
    ...<4 lines>...
        reason=reason,
    )
  File "C:/Users/FengYu/.local/lib/python3.14-mingw_x86_64_ucrt_llvm/site-packages/nuitka/freezer/IncludedEntryPoints.py", line 228, in makeDllEntryPoint
    return _makeDllOrExeEntryPoint(
        logger=logger,
    ...<7 lines>...
        tags=tags,
    )
  File "C:/Users/FengYu/.local/lib/python3.14-mingw_x86_64_ucrt_llvm/site-packages/nuitka/freezer/IncludedEntryPoints.py", line 196, in _makeDllOrExeEntryPoint
    return _makeIncludedEntryPoint(
        logger=logger,
    ...<7 lines>...
        tags=tags,
    )
  File "C:/Users/FengYu/.local/lib/python3.14-mingw_x86_64_ucrt_llvm/site-packages/nuitka/freezer/IncludedEntryPoints.py", line 150, in _makeIncludedEntryPoint
    assert source_path == getNormalizedPath(source_path), source_path
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: D:/msys64/clang64/lib/python3.14/site-packages/pywin32_system32/pythoncom314.dll
FATAL: dll-files: Plugin issue while working on 'module 'win32api''. Please report the bug with the above traceback included.

↩️ Regression (if applicable)

No known successful Nuitka version for this MSYS2 Python + pywin32 combination. Nuitka 4.1.3 previously failed earlier during constants generation with a separate MSYS2 path-normalization error, so it cannot establish a last known working version for this pywin32 path.

Additional Context (Optional)

The issue is not caused by the interactive shell: explicitly invoking the same MSYS2 Python executable from Windows PowerShell produces the identical assertion. Using a separate, non-MSYS2 CPython installation would be a different interpreter, package installation, and path flavor; it has not been tested here.

The closely related constants-generation issue was fixed by commit 169d10b6e55253ec2f4408a9d9078f60343ea86d (MSYS2: Fix paths needs to be normalized). This pywin32 DLL path appears to need the same normalization treatment.