News for hackers. Stuff that matters.
Re:Python 2.7.18, the last release of Python 2 by mywittyname on Monday April 20, 2020 @04:45PM (#22928324)
I upgraded from 3.7 to 3.8 and found out they removed a function in the time package required by crypto.

I do strongly feel that removing functions from the core library is a huge no-no for point releases.

Re:Python 2.7.18, the last release of Python 2 by elcritch on Monday April 20, 2020 @05:01PM (#22928498)
From afar, Python 3.x releases seem more like major updates than point releases. There’s entirely blocks of functionality/syntax between 3.x releases.
Re:Python 2.7.18, the last release of Python 2 by brianwawok on Monday April 20, 2020 @06:19PM (#22929391)
Except it is mostly additive.

Adding new features will seldom break old stuff. It is the removing part that is hard.

(With the exception being when like a variable broke because it became a keyword, but if you made a variable something like async I am not sure you are entirely innocent).

Re:Python 2.7.18, the last release of Python 2 by xxpor on Monday April 20, 2020 @05:01PM (#22928502)
You're supposed to pay attention to DeprecationWarnings.
Re:Python 2.7.18, the last release of Python 2 by MattGaiser on Monday April 20, 2020 @06:18PM (#22929374)
The problem is that the entire ecosystem needs to pay attention to such warnings and it doesn't happen. As a result, these changes end up breaking code in places the program authors never touched.
Re:Python 2.7.18, the last release of Python 2 by xxpor on Monday April 20, 2020 @07:28PM (#22930058)
That's true in one respect, but you as an end user can use them to know not to upgrade before your deps have changed what they need to.
Re:Python 2.7.18, the last release of Python 2 by scoot_718 on Monday April 20, 2020 @10:36PM (#22931264)
What? You upgrade your dependencies when there's a feature or improvement you need. Not because they don't have some warnings. Who cares?

The old version you implicitly claim is better isn't, it just doesn't have the warnings from their dependencies in place yet.

Re:Python 2.7.18, the last release of Python 2 by xxpor on Tuesday April 21, 2020 @10:44AM (#22935334)
I mean, if you're going to upgrade your python version, you should check your logs to see if you have had any DWs recently. If you have, upgrade your deps before upgrading python. If theres no new version available, you can't upgrade python yet.
Re:Python 2.7.18, the last release of Python 2 by scoot_718 on Monday April 20, 2020 @10:34PM (#22931249)
In my experience DeprecationWarnings get turned off so frequently because I'm not forking big library to fix all of it's Deprecated uses of their dependencies.

The warnings are useless if they're not from my code, so they get turned off once globally.

Re:Python 2.7.18, the last release of Python 2 by takeda on Tuesday April 21, 2020 @12:21AM (#22931837)
They are still important. Because even if dependency has this warning, it will still break your code.
Re:Python 2.7.18, the last release of Python 2 by afiori on Tuesday April 21, 2020 @02:04AM (#22932439)
but they are also not actionable
Re:Python 2.7.18, the last release of Python 2 by sambe on Tuesday April 21, 2020 @12:23PM (#22936383)
You can file an issue/PR in most cases, and if you don't get a response you may need to worry about moving libraries.
Re:Python 2.7.18, the last release of Python 2 by takeda on Tuesday April 21, 2020 @02:49AM (#22932621)
well actually they are, they essentially saying that in future version your application will break.

Yes, it is not your package that is responsible, but it still affects your application, you could open a ticket, or submit a PR. If you had that message you should also hold of with upgrading to newer python until this is resolved.

Re:Python 2.7.18, the last release of Python 2 by scoot_718 on Tuesday April 28, 2020 @11:04PM (#23014847)
> well actually they are, they essentially saying that in future version your application will break.

No, you idiot. It's a deprecated usage in a dependency.

What happens in the future is I update pandas, it stops using the deprecated numpy method, and the warning just disappears with very little action on my part.

It's a useless warning.

And submit a PR every time this happens? How about I request you pull me?

> If you had that message you should also hold of with upgrading to newer python until this is resolved.

1. Upgrading to newer python? Who fucking cares

2. Upgrading resolves the warning entirely.

Re:Python 2.7.18, the last release of Python 2 by sigzero on Monday April 20, 2020 @05:05PM (#22928542)
"The function time.clock() has been removed, after having been deprecated since Python 3.3"

Python 3.3 was release in 2012. You've had 8 years.

Re:Python 2.7.18, the last release of Python 2 by mywittyname on Monday April 20, 2020 @05:34PM (#22928842)
Well, technically we already moved to 3.8, after which needed a library that only works up until 3.7.

It would be nice if library developers kept their code up to date, but that doesn't always happen. Python core devs know this; well all know this, yet they consciously screw with the core libraries with the principle, caveat emptor.

I don't understand why they don't ear-mark these changes for 4.0. These kind of things are a universal frustration with the community and they are so easily avoidable.

Re:Python 2.7.18, the last release of Python 2 by nitroll on Tuesday April 21, 2020 @05:16PM (#22939412)
What difference would it make whether the change had been called 3.8 or 4.0?
Re:Python 2.7.18, the last release of Python 2 by mehrdadn on Monday April 20, 2020 @05:30PM (#22928803)
I'm confused, who exactly has had 8 years to do what? Should he have dumped the crypto module because it was using a deprecated feature?
Re:Python 2.7.18, the last release of Python 2 by glyph on Monday April 20, 2020 @11:02PM (#22931405)
The reason the crypto module was using this particular deprecated feature is that it hasn't been updated at all in 8 years.

The OP should have dropped it because it's unmaintained, and a maintained replacement has existed for a long time: https://cryptography.io/

This is an especially important consideration for security-critical libraries like cryptographic libraries.

Re:Python 2.7.18, the last release of Python 2 by mehrdadn on Monday April 20, 2020 @11:52PM (#22931684)
See, when you explain what's wrong it's so much better than just blaming the victim with "You've had 8 years"!
Re:Python 2.7.18, the last release of Python 2 by toyg on Tuesday April 21, 2020 @05:20AM (#22933326)
One issue the ecosystem currently has, really (and its not the only one, I believe it's difficult almost everywhere), is that tracking dependency-rot is hard. Unless something breaks outright, you'll never know if a library has been abandoned; and manually checking dozens of github/gitlab repos is expensive and tedious.

Pypi has an api (https://pypi.org/pypi/<pkg-name>/json) that can be leveraged to implement alerts like "this pkg last released 5 years ago, it might be dead!". I guess that's what the "security" package uses already. It would be cool if they added an option to report on this sort of thing.

Re:Python 2.7.18, the last release of Python 2 by mywittyname on Monday April 20, 2020 @11:29PM (#22931575)
OP here, thanks a bunch for this! I will take your advice and dump the crypto library for this one.
Re:Python 2.7.18, the last release of Python 2 by takeda on Tuesday April 21, 2020 @12:28AM (#22931881)
this is text from maual:

> Deprecated since version 3.3, will be removed in version 3.8: The behaviour of this function depends on the platform: use perf_counter() or process_time() instead, depending on your requirements, to have a well defined behaviour.

I would be wary of any crypto library that continued to work with a warning for 8 years and no one bothered to fix it. Most likely no one was maintaining it.

Re:Python 2.7.18, the last release of Python 2 by petre on Monday April 20, 2020 @06:25PM (#22929458)
Perl does it as well, but then you've only got point releases because it's stuck at 5.
Re:Python 2.7.18, the last release of Python 2 by takeda on Tuesday April 21, 2020 @12:23AM (#22931843)
I think at this point they should jump to perl7 and resume normal versioning