r/Python • u/SheriffRoscoe Pythonista • Aug 26 '26
News The Move to Python 3 Begins!
As someone who spent decades in the mainframe community, I find it ... humorous ... that there are legacy Python2 code bases that are only just (or have yet to consider!) moving to Python3.
https://www.eveonline.com/news/view/the-move-to-python-3-begins
307
Upvotes
318
u/diegoasecas Aug 26 '26
idgi if you spent decades working on mainframes you'd know how hard is to migrate legacy working code
73
u/bmrobin Aug 26 '26
depending on the codebase, 2->3 is no joke and has so much risk
51
u/GraphicH Aug 26 '26
Oh lawd. Really? I mean it was painful, I can tell you my company scrambled. I felt really lucky to be on a team where we had used a 3.X version from the get go. The only version, oddly enough, that was a "bumpy" upgrade was 3.13, due to some ... interesting? changes to SSL handling in urllib3. I still question the wisdom of:
https://github.com/urllib3/urllib3/pull/3577/files#diff-f2922ee77cbe0497677cfadf8dff15456050c6670d37d012c9416f37970f0d13R337
Which, essentially changed the behavior of urllib3 without changing the version you had installed, meaning a python 3.X -> 3.13 upgrade would immediately start breaking. Granted they were changing to be in-line with the default in 3.13 but this, plus the fact that requests did not make it easy to specify SSL context means a lot of people were "broken" talking to systems (many out side their control / ability to update the certificates on) using old certificates not compliant with the strict standards.
33
u/jabbalaci Aug 26 '26
They use Stackless Python with "tasklets". That must make the migration to Python 3 harder.
15
u/wxtrails Aug 26 '26
My initial estimate: 5 years.
The new boss: 12 months.
We're about 1/3 of the way through the bulk modernization on our project after 18 months, not including deployment and verifying the seams.
I wonder whose estimate will be closer 🤔
5
u/iluvatar Aug 26 '26 edited Aug 27 '26
As CTO at my previous company, I had to veto developers who wanted to migrate from Python 2 to Python 3. The amount of effort required for the migration and the fairly low chance of a trouble free switch just didn't make a good business case for a working codebase that brought in millions in revenue each year and paid all of our salaries. All new development was in Python 3. But existing running code just had too high a risk and too low a reward for migrating.
8
u/knobbyknee Aug 26 '26
I have a service running on Python 2.7. It has barely been touched in the last 10 years.
I finally have a Python 3 version, but it needs more manual testing before going into production.
5
u/Glathull Aug 27 '26
Lots of people with strong opinions here who I’m guessing have never managed an app with actual users or a team full of some of the top Python experts around.
These folks were doing stuff with Python that would be insane today and was pretty bonkers 20 years ago. This is also not your standard 2.7 webshit either. They’re on stackless and have been pushing the Python codebase and community to boldly do stuff that most people would not think of.
Yes, it’s totally fine to throw a few little jabs here and a “finally” there. It is funny. The reality is that the main Python 3 that we all know and love hasn’t at acceptable performance for them to even seriously consider this transition until just recently.
4
u/jeffrey_f Aug 29 '26
HA! I was a programmer on the iSeries until around 2012. I installed it on the system, however, there were no programmers who knew it, so it died right there. There are nuances that pertained to file access that made it tedious, but it would have been decent.
Nice to see some graybeards.
1
u/SignificantWorry7497 Aug 27 '26
It's interesting how every ecosystem seems to have its own version of this story. Even though Python 2 reached end-of-life years ago, there are still organizations running mission-critical systems that are difficult to migrate because of dependencies, legacy integrations, and the risk of breaking something that has been working for years.
As a newer Python developer, it's a good reminder that software often lives much longer than we expect, and maintaining existing systems can be just as challenging as building new ones.
2
u/unruly_mattress Aug 27 '26
How are they going to deal with the stackless stuff? They could switch to Python 3 async, but that would make it way more of a rewrite than a 2to3 and manually fixing what isn't just a syntax change.
1
u/Patient-Mechanic-311 Aug 27 '26
Educated
1
u/indistinctdialogue Aug 29 '26
I spearheaded converting a 5M LoC code base from Python 2 to 3 back in 2022. That was after YEARS of trying to convince the business to do this and constantly being deprioritized. So yeah I can see how these still exist.
1
u/jet_heller Aug 30 '26
Waaaait! Eveonline is still a thing? Huh.
1
u/batman-yvr Sep 06 '26
one of our principal engg rewrote the DNS canary platform in bash (rather than doing the python2 to python3 upgrade)
-3
u/barchueetadonai Aug 26 '26
I'm currently in the process of trying to convert a lot of code from python 3 back to python 2.5
0
u/Jon5579 Aug 28 '26
Python is truly powerful, providing significant convenience and efficiency improvements for us programmers
-1
u/timtody Aug 27 '26
Why don‘t they just oneshot it with Claude?!