Windows & Python (htmldiff.py)
Permalink
Ok, so I've been runing a WAMP stack for years on this particular server where I'm profiling C5 for a client. The server has been running python CGI functionality since inception (BOOOOM). I figured the reason I was getting the "must be executable" error isn't really because the script has permission errors, but simply because that's just a default error thrown when C5 runs into some undefined Windows error.
First thing I checked was the shebang path at the beginning of the .py script, and of course it's wrong for windows. It needs to point to your local installation of python, and should look something like:
#!C:/WAMP/www/python/bin/python.exe
Or wherever you have python installed. So I fixed that but I'm still getting the "must be executable error." Other .py scripts on the server are working without issue, so I'm guessing this particular script may be using some 'nix specifc functions and/or assumptions within the code (?) Or maybe some specific python library/update needs to be installed (the server is using a pretty old python install, v. 2.3.5 )
And yes, I know htmldiff is "optional," but for my current client to adopt this CMS, it is "required." (as is running C5 on a WAMP stack). Otherwise they'll just keep their current (crappy) .asp built CMS (Oh the horror!).
I'll try to debug further, but if anyone has already dealt with this issue for windows (without resorting to the py2exe converter), please feel free to share your solution. I also noticed in the site search while researching this issue that someone fixed their issue by installing the GD library (?) but that's also been on my server for years. Thx!
First thing I checked was the shebang path at the beginning of the .py script, and of course it's wrong for windows. It needs to point to your local installation of python, and should look something like:
#!C:/WAMP/www/python/bin/python.exe
Or wherever you have python installed. So I fixed that but I'm still getting the "must be executable error." Other .py scripts on the server are working without issue, so I'm guessing this particular script may be using some 'nix specifc functions and/or assumptions within the code (?) Or maybe some specific python library/update needs to be installed (the server is using a pretty old python install, v. 2.3.5 )
And yes, I know htmldiff is "optional," but for my current client to adopt this CMS, it is "required." (as is running C5 on a WAMP stack). Otherwise they'll just keep their current (crappy) .asp built CMS (Oh the horror!).
I'll try to debug further, but if anyone has already dealt with this issue for windows (without resorting to the py2exe converter), please feel free to share your solution. I also noticed in the site search while researching this issue that someone fixed their issue by installing the GD library (?) but that's also been on my server for years. Thx!
This function does not work as expected within a windows environment - it only checks for a particular subset of extensions, not what's actually present in the PATHEXT env variable (which defines the entire list of which extensions are executable on that particular machine) as documented here:
http://bugs.php.net/bug.php?id=41062&edit=1...
I changed the function to is_file() and got a bit further, but it's still not behaving as expected. Instead of the error thrown from is_executable() from the versions.php file, I'm getting the exception from the .py script itself:
htmldiff: highlight the differences between two html files usage: C:\apache2triad\htdocs\concrete\concrete\libraries\3rdparty\htmldiff.py a b
I'm thinking that perhaps the file paths are constructed in 'nix format, so windows can't find the files to compare. I'll post again if I find a working solution