mauricelambert / PyObfuscator

This module obfuscates python code.
GNU General Public License v3.0
16 stars 7 forks source link

name 'copyright' is not defined #19

Open AsafCN opened 1 month ago

AsafCN commented 1 month ago

I am obfuscating my code and then making it exe i saw in the readme.md that there is a problem with pyinsaller so i added to my code this to my main.py: copyright="""Copyright (c) 2001-2021 Python Software Foundation. All Rights Reserved.

Copyright (c) 2000 BeOpen.com. All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved.""" credits=""" Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information.""" help="Type help() for interactive help, or help(object) for help about object." quit="Use quit() or Ctrl-Z plus Return to exit" license="Type license() to see the full license text" cached=""

and i still having the same error: image

mauricelambert commented 2 weeks ago

Thanks for opening the issue !

Did you add the code:

from builtins import exit
copyright="""Copyright (c) 2001-2021 Python Software Foundation.
All Rights Reserved.

Copyright (c) 2000 BeOpen.com.
All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved."""
credits="""    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information."""
help="Type help() for interactive help, or help(object) for help about object."
quit="Use quit() or Ctrl-Z plus Return to exit"
license="Type license() to see the full license text"
__cached__=""

on the top of the obfuscated file ? Not in your code before obfuscation ?

AsafCN commented 2 weeks ago

Thanks for opening the issue !

Did you add the code:

from builtins import exit
copyright="""Copyright (c) 2001-2021 Python Software Foundation.
All Rights Reserved.

Copyright (c) 2000 BeOpen.com.
All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved."""
credits="""    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information."""
help="Type help() for interactive help, or help(object) for help about object."
quit="Use quit() or Ctrl-Z plus Return to exit"
license="Type license() to see the full license text"
__cached__=""

on the top of the obfuscated file ? Not in your code before obfuscation ?

hi, Thanks for answering. i added this t my code and now its showing me this: image

mauricelambert commented 2 weeks ago

What version of python are you using ?

AsafCN commented 2 weeks ago

Python 3.11.9

mauricelambert commented 2 weeks ago

Okay so check this URL: https://github.com/dashingsoft/pyarmor/issues/1728 it's probably an error with PyInstaller and python version. I will check with multiples python versions, if this bug come with all new pyinstaller versions or python versions i will fix it.

AsafCN commented 1 week ago

you have checked? and you have discord or something that i could connect you quicker?

mauricelambert commented 1 week ago

Yes i have check and i will commit the new version tomorrow.

Thanks for the issue, it's a good bug.

No, i don't have, and this year I will take a long time to fix, I will resume development and rapid maintenance in September 2025 (i have certifications to validate, my tools will be better after that).

mauricelambert commented 6 days ago

Thanks @AsafCN for the issue, i write a little workaround for this bug and i will fix it in the next major version (with other bugs with pyinstaller).

You should add the line at the top of the file:

from sys import exit

It's written in the documentation now.

Sorry for the long time to fix it.