pythonpython-3.xnuitka

Does Nuitka onefile mode displays my python code in tracebacks?


Here is an example code:

while True:  # here is a comment
    pass

Here is my Python and Nuitka version:

D:\test>py -m nuitka --version
2.6.8
Commercial: None
Python: 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)]
Flavor: CPython Official
Executable: ~\AppData\Local\Programs\Python\Python38-32\python.exe
OS: Windows
Arch: x86
WindowsRelease: 10
Version C compiler: ~\AppData\Local\Nuitka\Nuitka\Cache\DOWNLO~1\gcc\x86\14.2.0posix-19.1.1-12.0.0-msvcrt-r2\mingw32\bin\gcc.exe (gcc 14.2.0).

I ran the command py -m nuitka --standalone --onefile test.py and finally got test.exe. Then I ran test.exe and pressed Ctrl+C in the windows terminal. I got a traceback like this:

Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Temp\ONEFIL~3\test.py", line 1, in <module>
    while True:  # here is a comment
KeyboardInterrupt
^C

I found the source code even with the comment. But most people say that programs compiled by Nuitka is irreversible. So what's wrong?


Solution

  • In the Nuitka page you can read that

    Nuitka Standard
    The standard edition bundles your code, dependencies and data into a single executable if you want. It also does acceleration, just running faster in the same environment, and can produce extension modules as well. It is freely distributed under the Apache license.

    Nuitka Commercial
    The commercial edition additionally protects your code, data and outputs, so that users of the executable cannot access these. This a private repository of plugins that you pay to get access to. Additionally, you can purchase priority support.

    So to encrypt all traceback outputs you have to buy the Commercial version.

    In this Nuitka Commercial you can see the features only Nuitka Commercial offers.


    Onefile:

    Standalone:

    For Nuitka to display source code lines within tracebacks, the original Python source files must be present in the same location when the compiled program is executed.