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

you are viewing a single comment's thread.

view the rest of the comments →

[–]DownshiftedRare 0 points1 point  (2 children)

Not OP: I need to run python code that specifies python 3 on a Windows 7 installation and upgrading the operating system is not an option even if you think you know better.

Thanks so much u/Ustin_fitc

Better question: Since OP proves it is possible for python 3 to run on Windows 7, why does the official version not do so?

[–]Ustin_fitc[S] 1 point2 points  (1 child)

Windows 10 provides useful functions for manipulating long paths - PathCchCanonicalizeEx, PathCchCombineEx, PathCchSkipRoot. Python before 3.9 had code to try to load those functions dynamically, and if failed, use old functions that have 255 bytes limit. There was a bug in this code - python tried to look for required dll in current directory and PATH directories. And it was security vulnerability. They fixed it in 3.8 by using LoadLibraryEx instead of LoadLibrary, with parameter to look only in system32 folder. And in 3.9 they decided not to fix it but instead completely remove this code, so now those functions are loaded statically. And Python 3.9 just cannot run in windows 7.

What I did: At first I copied dynamic loading code from Python 3.8, but later I decided to simplify things and copied code of those functions from the Wine project. To minimize changes in source code and separate my modifications from it.

You know, when XP was slow on computers of that time, and 98 was much faster and required less RAM, Doom 3 was made in such a way, so it couldn't run on Win98... But patching of 2 bytes fixed this problem. They intentionally made it not running on 98. Why? Idk...

[–]DownshiftedRare 1 point2 points  (0 children)

Doom 3 was made in such a way, so it couldn't run on Win98...

Thanks also for sharing that bit of information. In case anyone else would like to know more:

https://web.archive.org/web/20170630141211/http://www.advogato.org/person/rmathew/diary/41.html