Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 719110 - sys-apps/portage-2.3.89-r3 fails to check timestamp.chk if LANG is not C or en
Summary: sys-apps/portage-2.3.89-r3 fails to check timestamp.chk if LANG is not C or en
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-23 18:13 UTC by PF4Public
Modified: 2020-04-23 19:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description PF4Public 2020-04-23 18:13:38 UTC
running `emerge --sync` with LANG=de_DE.utf8 fails timestamp.chk verification since this code fails:

timestamp = time.mktime(time.strptime(content[0],TIMESTAMP_FORMAT))

for some reason strptime fails with "ValueError: time data 'Thu, 23 Apr 2020 14:45:01 +0000' does not match format '%a %b %d %H:%M:%S %Y'"

`LANG=en_GB.UTF8 emerge --sync` or `LANG=C emerge --sync` works fine

Reproducible: Always

Steps to Reproduce:
Run `emerge --sync` with `LANG=de_DE.utf8` in environment
Actual Results:  
emerge doesn't check timestamp.chk and performs full resync

Expected Results:  
emerge does check timestamp.chk and performs full resync only if needed
Comment 1 PF4Public 2020-04-23 19:29:20 UTC
I have modified rsync.py, adding these lines:

print("timestamp: " + str(time.strptime(content[0],TIMESTAMP_FORMAT)))
print("TIMESTAMP_FORMAT: " + str(TIMESTAMP_FORMAT))
print("timestamp: " + str(time.mktime(time.strptime(content[0],TIMESTAMP_FORMAT))))

Results are as follows:

LANG=en_GB.UTF8 emerge --sync gentoo
>>> Syncing repository 'gentoo' into '/var/db/repos/gentoo'...
 * Using keys from /usr/share/openpgp-keys/gentoo-release.asc
 * Refreshing keys via WKD ...                                                     [ ok ]
timestamp: time.struct_time(tm_year=2020, tm_mon=4, tm_mday=23, tm_hour=18, tm_min=15, tm_sec=1, tm_wday=3, tm_yday=114, tm_isdst=-1)
TIMESTAMP_FORMAT: %a, %d %b %Y %H:%M:%S +0000
timestamp: 1587654901.0
>>> Starting rsync with rsync://*/gentoo-portage...
>>> Checking server timestamp ...


LANG=C emerge --sync gentoo
>>> Syncing repository 'gentoo' into '/var/db/repos/gentoo'...
 * Using keys from /usr/share/openpgp-keys/gentoo-release.asc
 * Refreshing keys via WKD ...                                                     [ ok ]
timestamp: time.struct_time(tm_year=2020, tm_mon=4, tm_mday=23, tm_hour=18, tm_min=15, tm_sec=1, tm_wday=3, tm_yday=114, tm_isdst=-1)
TIMESTAMP_FORMAT: %a, %d %b %Y %H:%M:%S +0000
timestamp: 1587654901.0
>>> Starting rsync with rsync://*/gentoo-portage...
>>> Checking server timestamp ...


LANG=de_DE.UTF8 emerge --sync gentoo
>>> Syncing repository 'gentoo' into '/var/db/repos/gentoo'...
 * Using keys from /usr/share/openpgp-keys/gentoo-release.asc
 * Refreshing keys via WKD ...                                                     [ ok ]
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/portage/util/_async/AsyncFunction.py", line 39, in _run
    result = self.target(*(self.args or []), **(self.kwargs or {}))
  File "/usr/lib64/python3.6/site-packages/portage/sync/controller.py", line 169, in sync
    taskmaster.run_tasks(tasks, func, status, options=task_opts)
  File "/usr/lib64/python3.6/site-packages/portage/sync/controller.py", line 68, in run_tasks
    result = getattr(inst, func)(**kwargs)
  File "/usr/lib64/python3.6/site-packages/portage/sync/syncbase.py", line 311, in sync
    return self.update()
  File "/usr/lib64/python3.6/site-packages/portage/sync/modules/rsync/rsync.py", line 176, in update
    print("timestamp: " + str(time.strptime(content[0],TIMESTAMP_FORMAT)))
  File "/usr/lib64/python3.6/_strptime.py", line 559, in _strptime_time
    tt = _strptime(data_string, format)[0]
  File "/usr/lib64/python3.6/_strptime.py", line 362, in _strptime
    (data_string, format))
ValueError: time data 'Thu, 23 Apr 2020 18:15:01 +0000' does not match format '%a, %d %b %Y %H:%M:%S +0000'