Live data from Hacker News

Python 2 removed from Debian

bugs.debian.org

441–450 of 513 posts

Re: Python 2 removed from Debian

#441

Earlier quoted context omitted.

Genuinely curious, what would you like it to look like?

I don't have skin in the game, but at least the .Net way is quite explicit, which I like: byte[] unicodeBytes = Encoding.UTF8.GetBytes(inputString); // Perform the conversion from one encoding to the other. byte[] asciiBytes = Encoding.Convert(Encoding.UTF8, Encoding.ASCII, unicodeBytes); string outputString = Encoding.ASCII.GetString(asciiBytes); Adapted from https://learn.microsoft.com/en-us/dotnet/api/system.text.…

You can do something similar in Python:

    utf8_bytes: bytes = bytes(input_string, encoding="utf-8")
    
    # Perform the conversion from one encoding to the other.
    unicode_string: str = str(utf8_bytes, encoding="utf-8")
    ascii_bytes: bytes = bytes(unicode_string, encoding="ascii")
    
    # The conversion could also be written as:
    ascii_bytes: bytes = utf8_bytes.decode("utf-8").encode("ascii")
    
    output_string: str = str(ascii_bytes, encoding="ascii")
The biggest difference is that the conversion step requires you to explicitly decode the bytes to a unicode string and then encode the unicode string back to bytes rather than providing a convert() method that does this internally.

Perhaps a convenience method would be nice, something like this, but it somewhat obscures the intermediate decode-to-unicode step:

    ascii_bytes: bytes = utf8_bytes.convert(to_encoding="ascii")

Re: Python 2 removed from Debian

#442
post #438

Earlier quoted context omitted.

> Avoid writing huge, long rambling comments and try to simplify your arguments to less than 100 words. You may find the fault, and the fix, becomes obvious. If you don't want to read the comment, then also don't bother responding. The comment is long because I am explaining a death by a thousand paper cuts situation. Don't worry, Python isn't going to die just because I don't like it. You don't have to defend Python…

It’s possible to explain a death by 1000 cuts situation in less than ~630 words. Despite that in the now nearly 1,000 words you’ve written in this sub thread alone you haven’t really asserted anything concrete. Start with trying to refute "The python2 executable still functions correctly as does all other code you have that relies on python2" without referencing anything specific to your build practices.

Sure, can't get python2 in Alpine 3.17. Few enough words for you?

Re: Python 2 removed from Debian

#443
post #438

Earlier quoted context omitted.

It’s possible to explain a death by 1000 cuts situation in less than ~630 words. Despite that in the now nearly 1,000 words you’ve written in this sub thread alone you haven’t really asserted anything concrete. Start with trying to refute "The python2 executable still functions correctly as does all other code you have that relies on python2" without referencing anything specific to your build practices.

Sure, can't get python2 in Alpine 3.17. Few enough words for you?

Yep! That’s perfect, thank you. If that’s your condensed point I’ll repeat my first comment: you’re looking for other people (alpine) to maintain python 2 for you forever.

Presumably you’re too “not caring about any of this” to just pin your image to “alpine:3.15” and have it just work exactly as before? And presumably you’re too not bothered with any of this to understand that you had to do this because you didn’t pin the image to begin with, so your builds are not reproducible?

And this is anyone else’s problem why?

Re: Python 2 removed from Debian

#444

Earlier quoted context omitted.

That's only true if you ever received Unicode input. There are plenty of uses of strings that never do - enums, DNS domain names, URLs, HTTP parsing, email addresses (from any sane provider) etc.

Strings are still strings in Python 3; if you do 'foo' == EnumValue then that will work fine in Python 2 and 3. If 'foo' is from an unknown source: yeah, you might get a bytes type in Python 3 and an error, but that's the entire point. Turns out that in practice, it can contain >0xff more often than you'd think. Certainly today DNS domain names, URLs, and email addresses can – and do – contain >0xff input, and for so…

I've seen way too many cases (possibly resulting from 2to3 autoconversion) where the code ran without errors, you just couldn't log in because the xsrf token was "b'123456'" instead of "123456".

Re: Python 2 removed from Debian

#445

Earlier quoted context omitted.

i think it’s clear this was a huge mistake. none of these changes were critical to pythons current success. python stalled for 10 years if not more because of these non-BC changes. it will fragmented indefinitely. this is a good case study of how one big ego can completely derail a massive project for decades

Can you explain how exactly Python stalled as a result?

A lot of devs were busy with the busywork of migration rather than improving their libraries. For a long while you often got stuck between one critical library that has no alternative only supporting 2, with a second critical library for some other thing that also has no alternative only supporting 3. So doing your project in Python wasn't feasible.

Re: Python 2 removed from Debian

#446
post #443

Earlier quoted context omitted.

Sure, can't get python2 in Alpine 3.17. Few enough words for you?

Yep! That’s perfect, thank you. If that’s your condensed point I’ll repeat my first comment: you’re looking for other people (alpine) to maintain python 2 for you forever. Presumably you’re too “not caring about any of this” to just pin your image to “alpine:3.15” and have it just work exactly as before? And presumably you’re too not bothered with any of this to understand that you had to do this because you didn’t p…

You are certainly making progress on the argument you believe you are having.

My point has always been simple: Python causes more pain than other languages when you're not directly using it. I can get node 0.10 on alpine 3.17 just fine. This demonstrates that your comparisons to server JS are completely wrong. But I know, you're going to tell me this is my problem and I expect the world to do work for me or something. Nope. As I've repeatedly stated, I've taken the time to get it to work already. I know you want to believe I'm here waiting for you to fix it, but I'm not. All I've said is: "Huh, I don't have this problem with anything else. I'll keep that in mind before I decide to use stuff from this ecosystem in the future".

Re: Python 2 removed from Debian

#447
post #354

Earlier quoted context omitted.

> I write a lot of Python code and don’t really run into Python 2 vs 3 issues anymore. I think you are missing the key point here: I don't write a ton of Python. I don't write any Python. Of course you think this is old news. You write a lot of Python. You're totally plugged in. You've known this is coming, this inside baseball is "the thing" for you. My point is that, believe it or not, the rest of the world does no…

This is such an odd and entitled take for a person who is really trying hard not to care about python.

How is it odd and entitled for an end user to not like it when things suddenly break?

That is, I believe, the entire point of the parent, is it not? That this whole migration was not quarantined to the Python developer community. That it spilled over to users in totally unrelated spaces.

Re: Python 2 removed from Debian

#448

Earlier quoted context omitted.

That is precisely what happened: I don't write Python (grandma doesn't write JS). Python changed (JS changed). Environment stopped supporting the old one (browser for grandma, package manager for me). End-user apps didn't keep up (website for grandma, the apps for me). I am now forced to go resolve these issues. This is 100% analogous. Please explain how it is not. In both scenarios you would blame the "app developer…

What "end user apps" are you talking about? The "magic date" when the breaking update came was 15 years ago. Python gave this developer 10 years to get with the program and update to the new version, and Debian kept it alive for an additional 5 just in case. If a developer can't get their act together to change over their codebase to preserve minimum functionality despite FIFTEEN YEARS of warning, I don't want to be…

Let me add these types of users rarely think about sponsoring such ‘important’ projects that they seem to not be able to live happily without.

It’s called open source entitlement. The kind of people who fill up your issues and don’t push PRs and only donate with their melodramatic keyboard.

Re: Python 2 removed from Debian

#449
post #424
post #375

Earlier quoted context omitted.

Ok, so what happens when several of your dependencies never ported? This isn't strawmanning - this is literally the case for a codebase I'm working with today .

You should not be using those dependencies today . Looks like they have been unmaintained for a decade and can contain a ton of vulnerabilities. Though I find it hard to believe that there are some useful dependencies that have not been ported and don't have better alternatives. Typically a "never ported" dependency is never ported because it is deprecated in favor of something better.

We're in a rather niche market. It's geocoding related stuff that only talks to a trusted endpoint.

Re: Python 2 removed from Debian

#450
post #443

Earlier quoted context omitted.

Yep! That’s perfect, thank you. If that’s your condensed point I’ll repeat my first comment: you’re looking for other people (alpine) to maintain python 2 for you forever. Presumably you’re too “not caring about any of this” to just pin your image to “alpine:3.15” and have it just work exactly as before? And presumably you’re too not bothered with any of this to understand that you had to do this because you didn’t p…

You are certainly making progress on the argument you believe you are having. My point has always been simple: Python causes more pain than other languages when you're not directly using it. I can get node 0.10 on alpine 3.17 just fine. This demonstrates that your comparisons to server JS are completely wrong. But I know, you're going to tell me this is my problem and I expect the world to do work for me or something…

You can’t get node 0.10 on alpine Linux 3.17 from the official main repository. That 18.x/19.x. So you’re using a community one. And so, you could use a community python2 APK/install process. Except that doesn’t exist. Because nobody wants it. And you’re unwilling to make it yourself, thus you’re complaining that nobody else is maintaining this port for you.

The argument I’m making is none of your issues stem from Python specifically. As others have said, you are conflating your own confusion and unwillingness to understand with systemic toolchain issues that do exist. Except, you are not being bitten by those - you’re still at the “shoot myself in the foot and blame the gun” stage.

Post reply on HN