Public bug reported:

python's time.mktime calls onto os native mktime(). It throws overflow
error for time_structs having daylight saving.

def get_tz_time_from_epoch(ctz, epoch):

    dt = datetime.datetime.fromtimestamp(epoch, pytz.timezone(ctz))
  
    return time.mktime(dt.timetuple())


this python function work fine on Ubuntu 18.04 but throws error on Ubuntu20.04.3

** Affects: ubuntu
     Importance: Undecided
         Status: New

** Affects: glibc (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: bot-comment

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1945345

Title:
  mktime throws overflow error with daylight saving on

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/1945345/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to