[Git][NTPsec/ntpsec][master] ntpclients/ntpviz.py: Better comment skewness and kurtosis in code.

Fred Wright fw at fwright.net
Wed Dec 18 04:40:15 UTC 2024


On Fri, 13 Dec 2024, Gary E. Miller via devel wrote:

> On Fri, 13 Dec 2024 05:46:32 +0000
> Matt Selsky via devel <devel at ntpsec.org> wrote:
>
>> math.isfinite() was added in Python 3.2
>> per https://docs.python.org/3/library/math.html.
>> Should we use math.isinf() instead in order to retain Python 2
>> compatibility until we decide to drop that?
>
> Good catch!  My bad.  Fix pushed.
>
> BTW, Python 2.7 is not going away.  There are even Python 2 forks
> being maintained.  Like this one:
>
>    https://github.com/naftaliharris/tauthon

Yeah.  If the python.org folks sanely wanted to retire Python 2, they 
shuldn't have made Python 3 so friggin' incompatible.

> And this needs fixing too:
>
>
> /usr/local/bin/ntpviz:1813: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
>  start_time = datetime.datetime.utcfromtimestamp(
> /usr/local/bin/ntpviz:1815: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
>  end_time = datetime.datetime.utcfromtimestamp(

But both attempts at fixing that fail in Python 2, where datetime.timzone 
doesn't exist.  I just submitted an MR to fix it.

Fred Wright


More information about the devel mailing list