Live data from Hacker News

2020 Leap Day Bugs

codeofmatt.com

1–10 of 150 posts

Re: 2020 Leap Day Bugs

#4
A line in one of my Python daemons has been crashing it repeatedly all day:

  isotime = datetime.strptime(time.get('title'), '%a %d %b %I:%M:%S %p').replace(year=YEAR, tzinfo=TZ).isoformat()
    ValueError: day is out of range for month
It's not mission-critical, so I'm just going to wait it out until tomorrow.

EDIT: Hacked it out.

  isotime = datetime.strptime(f"{time.get('title')} {YEAR} {tzoffset:+03d}00", '%a %d %b %I:%M:%S %p %Y %z').isoformat()

Re: 2020 Leap Day Bugs

#7
post #4

A line in one of my Python daemons has been crashing it repeatedly all day: isotime = datetime.strptime(time.get('title'), '%a %d %b %I:%M:%S %p').replace(year=YEAR, tzinfo=TZ).isoformat() ValueError: day is out of range for month It's not mission-critical, so I'm just going to wait it out until tomorrow. EDIT: Hacked it out. isotime = datetime.strptime(f"{time.get('title')} {YEAR} {tzoffset:+03d}00", '%a %d %b %I:%M…

https://bugs.python.org/issue26460

Re: 2020 Leap Day Bugs

#8
post #4

A line in one of my Python daemons has been crashing it repeatedly all day: isotime = datetime.strptime(time.get('title'), '%a %d %b %I:%M:%S %p').replace(year=YEAR, tzinfo=TZ).isoformat() ValueError: day is out of range for month It's not mission-critical, so I'm just going to wait it out until tomorrow. EDIT: Hacked it out. isotime = datetime.strptime(f"{time.get('title')} {YEAR} {tzoffset:+03d}00", '%a %d %b %I:%M…

That strap time parsing doesn't fail under python 2.7.17 or 3.8.1

Re: 2020 Leap Day Bugs

#10
Stupid Q:

Why doesn't the syslog protocol (RFC5424) deal with leap seconds (the seconds field goes to 00-59, not 00-60)? Are they using UTC (they would have to ignore LS and have crappier logs) or TAI (doesn't have LS)?

https://mailarchive.ietf.org/arch/msg/syslog/DDLgKsRPITFXYSB...

http://www.madore.org/~david/computers/unix-leap-seconds.htm...

https://tools.ietf.org/html/rfc5424

https://cr.yp.to/libtai/tai64.html

https://cr.yp.to/libtai.html

Post reply on HN