mirror of
https://github.com/brentvollebregt/auto-py-to-exe.git
synced 2026-04-26 12:15:50 +03:00
[GH-ISSUE #58] TypeError: startfile() takes no keyword arguments #55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joker8989 on GitHub (Jun 7, 2019).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/58
I am trying to convert my file that uses exec() built in function to execute a string with base64
and when i use your app i get an error:
"Object of NoneType has no len()"
any idea how to convert it anyway ?
(replace maybe the exec somehow?)
@brentvollebregt commented on GitHub (Jun 8, 2019):
Could you give an example on how to reproduce this?
@joker8989 commented on GitHub (Jun 8, 2019):
I am not sure what do you mean by to reproduce this?
my problem is that my script use exec() function to execute a base64(string) the script itself works fine but when i try to convert it to exe i get the error above..
is there a way to replace the exec() function to something to return me a value and then your program will work or to do something else, for example convert to exe although the return value is None by adding this feature to your program
@brentvollebregt commented on GitHub (Jun 9, 2019):
An example of how to reproduce this would be the code that you can prove doesn't work. Here is one that I made up:
Running that will Python, you will see that the
execworks and "1" is printed. After packaging this with auto-py-to-exe and running it again, you will see that "1" is printed again.This snippet however shows that
execdoes in-fact work. Do you have an example that doesn't work? Are you checking your code actually works in Python before packaging it?@joker8989 commented on GitHub (Jun 9, 2019):
yes can you please provide me your email or something that i can contact
with you cause its kind of private... :)
sry for sharing my problems :(
@brentvollebregt commented on GitHub (Jun 9, 2019):
No, I only want a small snippet of your code (like a proof of concept) so that I can package it and then execute the output to debug the error you are saying there is with auto-py-to-exe.
I would rather that you put the script here as it relates directly to this GitHub issue you have created.
@joker8989 commented on GitHub (Jun 9, 2019):
Ok i am goiing back home and i will upload my script in like 2-3 hours
@joker8989 commented on GitHub (Jun 10, 2019):
Ok so i ran some tests and at the first time since we spoke the convertion was successful but the file could not been executed cause "No module named Math" with capital M is this a issue that u familiar with? or..
i dont know how to resolve it for now but after that i will post the real problem with exec() command that probably won't work but the file was converted to exe so... that's a start :)
thankx for your support
@brentvollebregt commented on GitHub (Jun 10, 2019):
Have you actually run this code in Python? There is no module named
Mathin the Python standard library and there is also no module namedMathon PyPI so I am going to have to assume thatMathis a custom module you made, thus you need to import it correctly.@joker8989 commented on GitHub (Jun 10, 2019):
No its not i installed your program with pip install auto-py-to-exe
and run in the cmd auto-py-to-exe.... that;s it i dont have module Math at all
i know there is no module Math in python (math includes in python lib)
so i will setup a VM and run some tests on it and let u know :)
@brentvollebregt commented on GitHub (Jun 10, 2019):
Right, sorry, I had assumed it was your application as you have covered up half the terminal with a completed package in auto-py-to-exe.
Could you supply the error here (copy and paste). This looks like an issue with the "Open Output Folder" button call; did you click this when the error occurred? Would be good to know this.
@joker8989 commented on GitHub (Jun 10, 2019):
It seems something went wrong with the file i created (although the file works fine) there is no error
"No module named Math" anymore
but the rest of the error still appears from the above screenshot (line 766) /src/gevenet/greenlet.py ......
can't open the file location from "open output folder"
(maybe that's the error above have not look at this yet)
again let me run some tests i have win 10 VB installed i will try in an hour and let u know..
maybe its a BUG or something is wrong with this specific virtual machine(cause i had some issues with this VM i dont know if it has any connection with auto-py-to-exe)
@brentvollebregt commented on GitHub (Jun 10, 2019):
Could you please paste the error here? Also did you click on the "Open Output Folder" button for this to occur.
@joker8989 commented on GitHub (Jun 10, 2019):
Yes i press the "Open Output Folder" and then the error occurs ...
this is what i have just tested:
no exec command a simple script..
Well it seems the exec() command is not "The problem" i tested a simple script by the screenshot above with Onefile & Noconsole (hidden console) and the script could not be executed..
i tried with console(show console) the console appears asks me to "enter:" something and when i do it,
its quickly exit the console and i cant even see the "print" command in action (not showing me the output from the input i entered)
i got to go now i will be back and keep testing it..
@brentvollebregt commented on GitHub (Jun 10, 2019):
Did you read the post that is linked at the end of every conversion? I wrote this to help debug situations exactly like this.
What do you actually believe is wrong with auto-py-to-exe? Also, as I asked twice previously, can you please paste the error here you get from pressing the "Open Output Folder" button.
@joker8989 commented on GitHub (Jun 11, 2019):
sorry for no being active for a long time even now i am leaving but you asked me to share the error code from the "Open Output Folder" so here it is:
as u can see the Math module is not displays as error so it was a problem with the vm as i said..
i clicked twice "Open Output Folder" to u to see the error and figured it out
when i am back i read your post and continue testing it...
@brentvollebregt commented on GitHub (Jun 11, 2019):
Thank you, I now see what this error is. The function
os.startfilein Python 2.7 does not take the keywordoperation; it is suppose to be a positional argument. The error is:@brentvollebregt commented on GitHub (Jun 11, 2019):
I have just fixed this issue. If you now pull down master and run auto-py-to-exe, you should no longer get this issue. Tested in Python 2.7 and 3.5 on Windows 10.
If this works, I can deploy to PyPI some time in the next couple of days.
@brentvollebregt commented on GitHub (Jun 11, 2019):
Sorry, forgot that keyword in the commit closes a issue.
Could you please run the latest version on master to check that this has now been fixed? Thank you very much for your time.
@joker8989 commented on GitHub (Jun 11, 2019):
Yes i can confirm it is working from the Master pack there is no error on CMD and the button opens me the output folfer
good job! 👍
i think you should upload it to pypi it is more easier to install (1 command - for others)
@joker8989 commented on GitHub (Jun 11, 2019):
leading to my problem (not the main problem(exec)) the aa.py file that i posted above that there is a fatal error
with the
x = raw_input("enter something")
print x
input() <-- Added for debugging and used console based
i see that the file works fine in Idle i am using auto-py-to-exe with console based to see if the file can be converted and no error is occurred i removed the debugging (i tried even without debugging the script worked) and when i'm trying the windows based(hidden console) the Fatal error occurs and can't execute the exe file..
@brentvollebregt commented on GitHub (Jun 11, 2019):
After every build in auto-py-to-exe there is a link that appears that the bottom of the UI directing users to a post I wrote if they are having issues. I recommend reading this, specifically the header Fatal Error: failed to execute.
This will help you find the real error that is occurring.
@joker8989 commented on GitHub (Jun 12, 2019):
I tried debugging the issue with this simple script (aa.py) no debug was displayed i dont know if its a bug or something else..
if u can please check it in your side if the file above is working or not (with onefile) with debugging and without..(debugging = with window console)
again in the debugging nothing was displayed the file was just regular executed i enter something and it showed the result
thankx for your time
@brentvollebregt commented on GitHub (Jun 12, 2019):
Your snippet above doesn't run in Python (I'm assuming this is what you are asking me to test, there is no other code you have provided):
I tested this with Python 2 and
input()raised aSyntaxError: invalid syntaxas expected because Python 2 does not supportinput()(it's Python 3 syntax).@joker8989 commented on GitHub (Jun 12, 2019):
sorry for editing i have just tested it again the file runs the code and then raised the error yes u right but that's not an excuse why the program aa.py does not work :(
cause the program above does not have input()
the code is just:
func name:
x = raw_input("enter: ")
print x
test it with onefile(console hidden) the file will get fatal error and cant be executed
yes u right if u put the input() u will get an error... but remove the input and see the result with debugging without debuuging with console without console
@brentvollebregt commented on GitHub (Jun 12, 2019):
Did you read the post that I linked you? If so, what is appearing in the output? If you're getting a dialog displaying "fatal error" then there will be an error printed to stdout.
@joker8989 commented on GitHub (Jun 12, 2019):
I dont know if u understand what i am trying solve
again i dont see any output errors maybe if u check this out u will understand if u do so well.. id ont know why casue when i try with console based(with debugging and without) no errors are appeared but its only when i try to run it from windows based(without console) so when i run the file from cmd or by clicking on it the error above is displayed
"Fatal error detected"
"Failed to execute script aa"
if u could provide a screen shot what do u see maybe it will solve the problem and i will figure it out
@brentvollebregt commented on GitHub (Jun 12, 2019):
I created a script with the contents below:
When running this with Python 3, it asks for my input and prints it back out (as expected).
I then packaged the exe to an executable by using auto-py-to-exe with the only setting being changed being "Console Window" set to "Window Based (hide the console)".
Opening cmd and executing this, it shows a dialog with the message
Failed to execute script [script name]. When double clicking, this occurs again. Yes, you are correct.So here is my explanation as to why this does not work; ask yourself, where is the
inputcall meant to get the input from and theprintcall output to? You just disabled console window from appearing, so what can Python use to execute these commands?The answer is nothing, you have deprived the script of components required to execute and thus the script crashes.
@brentvollebregt commented on GitHub (Jun 12, 2019):
If you feel this situation I have mentioned is a bug, bring it up with pyinstaller, as this occurs in the packaging process (because you have disabled the console - it did what you asked).
@joker8989 commented on GitHub (Jun 13, 2019):
Well yea this explanation ran in my mind but wanted to ignore it, hoped its still possible. thankx for the clear explanation and your great support :)
I will keep testing this project
And if i find something i will let u know
@brentvollebregt commented on GitHub (Jun 13, 2019):
As described in my explanation, it is possible to make this work; do not disable the console. If you don't disable the console, then Python will have somewhere to read for
input()and output forprintand your example will work.@joker8989 commented on GitHub (Jun 13, 2019):
yea understood thankx .... just 1 question if i use pyinstaller/auto py to
exe on linux for example ubuntu/mint/debian i won't be able to run this on
windows right? cause linux does not have the win32 API ths files that do
most of the errors: win32com,win32api....
?
thankx again
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On Thu, Jun 13, 2019 at 8:21 AM Brent Vollebregt notifications@github.com
wrote:
@brentvollebregt commented on GitHub (Jun 13, 2019):
Stated in the pyinstaller GitHub Wiki:
@joker8989 commented on GitHub (Jun 14, 2019):
Sorry for being annoyin but does pyintstaller/auto py to exe support encryption? cause what i was telling u before that the exec does not work well it works :) but when i tried to encrypt my file and run it with pyinstaler/auto py to exe the Math module appears again :(
i use AES for encryption..
when i encrypt my py file i can still able to run it (the problem is to convert it to exe)
no errors was displayed except "no module named Math"
maybe back then i tried to convert encrypted code and that's why i got Math module that we did know what the hell is that..
anyway does it support encryption?
@brentvollebregt commented on GitHub (Jun 14, 2019):
That explanation is far beyond me... Not quite sure if that was a tangent or relevant. Never the less, what you are looking for in in pyinstaller's documentation:
Might pay to know that PyCrypto is no longer maintained (it's been 5 years since it was touched) and has some nasty bugs/vulnerabilities in it. I imagine the functions pyinstaller uses may be ok though.
Also might pay to simply search "pyinstaller encryption" in Google next time.
@joker8989 commented on GitHub (Jun 14, 2019):
Did not fully understand what you mean? The key the pyinstaller offers i am
familiar with that.. but i wanted to make my own 1 inside their's key..
(Also i heard that doing "reverse engineerng" with an encrypted file that
touched the function --key of pyinstaller is very easy that's why i wanted
to make a "backup" And protect my code as possible..
U r saying pycrypto does not "exist" anymore but pyinstaller uses that? Did
not fully understand..
Also it does not solve the Math module that for me is not related to my
code or anything else..
@brentvollebregt commented on GitHub (Jun 14, 2019):
You can't make your own encryption in their key; that doesn't make sense. I think you're asking how to encrypt your executable using other methods; if that is the case, that is fully up to you on how you do it.
PyCrypto does exist and PyInstaller still uses it, but it is now un-maintained. Yes, reverse engineering this encryption/decryption process is not difficult as the source is publicly available.
I don't believe the errors regarding the Math module have anything to do with the Math module as we proved before.
@joker8989 commented on GitHub (Jun 14, 2019):
I ran some test and i found something.. Crypto.Cipher is no longer suppored to work on pyinstaller that;s why i got the error(dont know why "No module named Math")
BUTTTTTT
pycryptodome is the enhanced version of crypto from what i understood so basically it works for me :)
I did not test it on my project(not yet) but i made new file and convert it with the AES and i am able to run it without problem with auto_py_to_exe :)
if u want to improve your project that but i dont know how many people do what i am doing so... your choise :)
(They can still pip the module on their own)