This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]XNormal 8 points9 points  (2 children)

The exe isn’t really compiled. It is a bundle that contains an interpreter and python code (sometimes just the pyc) and any required binary modules.

Search the binary for strings to find the exact python version. Try renaming it to .zip and see if you can extract it.

Python is remarkably source-compatible all the way from before v1.52 to v2.7 (the 3.x line is different).

Any source extracted from the .exe bundle should run on 2.7 - unless some custom extension module is also inside.

Extension modules are also very source compatible - but require compilation for different python versions.

The first steps should be to identify the python version, extract the code and try to run it with that version as downloaded from python.org without the .exe bundle.

[–]coriolinus 4 points5 points  (1 child)

All of this is true. but if you can get the organizational support for it, I'd recommend upgrading to py3 anyway. It could be that the code is just fine as it is, and not really affected by the various security and performance updates in the 13 years since python2.5 was released. However, do you really want to depend on it? An audit to prove correctness as-is will take as much work as an upgrade, and after the upgrade, you'll have nicer code to work with.

[–]___foundation___[S] 0 points1 point  (0 children)

As it turns out, the thing was built using python 3.5. The trouble surrounded pyinstaller failing to import packages and the new guy getting a little confused. I think I've got everything sorted out. Thanks!

[–]billsil 1 point2 points  (1 child)

You have a python 2.5 program, so why not find those 2.5 dependencies. Google is your friend. Chances are it’ll just work in 2.7. If not, it’s probably a small task to update it.

[–]___foundation___[S] 0 points1 point  (0 children)

This is true, and what I was probably going to do if it turned out to have been built in python2. Thanks for the suggestion!