Comment 1 for bug 1911469

Revision history for this message
Cubic PPA (cubic-wizard) wrote :

An experiment demonstrating the issue.

Even though '%x %X' is used to format the time stamp, the resulting time stamp string can not be parsed using this same format.

$ sudo apt install language-pack-nb

$ python3.8

> import locale
> locale.setlocale(locale.LC_ALL, 'nb_NO.UTF-8')

  'nb_NO.UTF-8'

> import datetime
> time_stamp = datetime.datetime.now().strftime('%x %X')
> time_stamp

  '24. jan. 2021 kl. 19.48 '

> import time
> time.strptime(time_stamp, '%x %X')

  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3.8/_strptime.py", line 562, in _strptime_time
      tt = _strptime(data_string, format)[0]
    File "/usr/lib/python3.8/_strptime.py", line 349, in _strptime
      raise ValueError("time data %r does not match format %r" %
  ValueError: time data '24. jan. 2021 kl. 19.48 ' does not match format '%x %X'