PDA

View Full Version : Get "...is not a valid Win32 application." when trying to run Python script


bwilder
04-04-2013, 09:53 AM
Hi,
VBP 8.0 x64
Windows 7 ultimate host

I'm trying to run a new Python script through a Batch File step and the step is immediately failing with the error "... is not a valid Win32 application." The script pushes files from the localhost up to a remote linux server. When I run the script from the command line, it works as expected. No error, all files go where I expect.

I've got several other python scripts used for things like checking file sizes, parsing logs, and moving files that all work fine through VBP without issue. I've tried this script on a couple of different windows hosts all with the same results; script runs fine from command line, but dies immediately in VBP.

Any thoughts?

bwilder
04-04-2013, 10:43 AM
Turns out that this issue was caused by attempting to re-use/re-purpose a VBP step.

I previously had a Batch File step that executed a .bat script to push files to a remote server. I later created a .py script to replace the batch script and just updated the VBP step with the new file.py. When I attempted to execute the step with the changed .py script, it failed with the error I noted above.

Dragging a new Batch File step into the project and configuring it to execute the .py script allowed it to work as expected.

This seems like a bug to me, but the workaround is a viable resolution.

kinook
04-05-2013, 05:31 PM
There must be some difference between the 2 Batch File steps that would account for the difference in behavior?

bwilder
04-06-2013, 06:16 AM
The only difference was the type of script being run:

c:\heres\my\path\script.bat became c:\heres\my\path\script.py. Everything else was the same. No user params, everything is local.

kinook
04-06-2013, 07:28 AM
I guess that difference matters? If you can post a .bld file demonstrating the two steps, that might help. Thanks.

bwilder
04-06-2013, 09:46 AM
Right, which is why I feel it's a bug. I should not have to recreate a step from scratch just to change the file it's pointing to. The current behavior is confusing, to say the least.

kinook
04-06-2013, 09:49 AM
All of the step properties can be modified, so I don't follow why would you need to create the step from scratch to change the file it's pointing to. Again, if you can post a .bld file with both steps, it might help.