>>> import ipaddress
>>> ipaddress.ip_address('010.0.0.1').is_private
True
Even though the documentation claims that "Leading zeroes are tolerated only for values less than 8 (as there is no ambiguity between the decimal and octal interpretations of such strings)."https://docs.python.org/3.9/library/ipaddress.html#ipaddress...
But this is not an issue:
>>> import ipaddress
>>> ipaddress.IPv4Address('010.0.0.1')
IPv4Address('10.0.0.1')https://pypi.org/simple/ (caution— multi-megabyte html)
It's great to have high quality third party libraries but stuff like most of lodash should be in a stdlib, already.
Say you grab a 10 years old Java/.Net project source and a node one, and try to setup a developer environment to be able to create a fix. Would you bet that on average is 10X harder to get stuff to run on node ?
I think you’re being a little optimistic there.
Consider Java’s URL class, for instance. Its equals() implementation will resolve the hostname in both URLs and consider them equal if they resolve to the same IP address. So that’s a) completely wrong, b) a potential source of security problems (consider an attacker pointing their hostname to your IP address to control URLs that are “equal” to your URLs, for instance), c) horribly unpredictable (two URLs may or may not be the same depending on whether you are online or not), and d) awful for performance (introduces a network lookup even for hashcode(), for instance).
That’s significantly worse than a bug like this, which is essentially an oversight that failed to consider an obscure notation nobody uses.
> Say you grab a 10 years old Java/.Net project source and a node one, and try to setup a developer environment to be able to create a fix. Would you bet that on average is 10X harder to get stuff to run on node ?
Java is probably okay, but I’ve tried this with .NET and it was extremely painful.
I would bet that on average Java standard library code(that is not deprecated) will be higher quality then npm packages.
With many small libraries there often is a single person working on it and others assuming "oh, somebody will have reviewed it"
This can happen with a big library as well (as individual maintainers "own" specific parts) but there it is easier to establish a review culture.
(Whether a review would have caught this specific case is yet another question, but again having an organisation could guarantee a timely response, is read if depending on a single contributor)
This of course depends on the library in question, as some non-std libraries are certainly subjected to more checks than others.
Both are open-sourced and are written by pretty much the same people.