Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify hidden source code claims #5662

Closed
simaoafonso-pwt opened this issue Mar 22, 2021 · 2 comments
Closed

Clarify hidden source code claims #5662

simaoafonso-pwt opened this issue Mar 22, 2021 · 2 comments

Comments

@simaoafonso-pwt
Copy link

The documentation mentions the source code is hidden when compiling executables.

https://pyinstaller.readthedocs.io/en/stable/operating-mode.html#hiding-the-source-code

However, on runtime when the program exists with an exception, the traceback includes the filename and line numbers for the compiled code.

File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "PyInstaller/loader/pyimod03_importers.py", line 531, in exec_module
  File "main.py", line 4, in <module>
  File "<REDACTED_FILE>", line 423, in entrypoint

Encrypting the bytecode does nothing.

Where is this information stored, and can I remove it from the generated binaries?

@rokm
Copy link
Member

rokm commented Mar 22, 2021

The full filename leaking in tracebacks is a bug that's been (hopefully) resolved in develop branch.

If you consider tracebacks to be still revealing too much information about your code (line numbers, function and module names), then either disable traceback or handle the exception yourself.

@simaoafonso-pwt
Copy link
Author

The full filename leaking in tracebacks is a bug that's been (hopefully) resolved in develop branch.

That seems to be b9fcbbf(#5563), thanks.

The sys.tracebacklimit option seems to be what I was looking for, thanks for the pointer. Closing this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants