You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Formatting a datetime expires value uses the process locale for day and month names #658
When expires is passed as a datetime, it is formatted with strftime('%a, %d %b %Y %H:%M:%S GMT'), which uses the process locale for %a and %b. If the host program has called setlocale for a non-English locale, the header value has non-English names and is not a valid HTTP date. Other HTTP code in the library guards against this by using the C locale.
Where
b2sdk/_internal/bucket.py:143-145 (_merge_file_info_and_headers_params); the guard elsewhere is at b2sdk/_internal/b2http.py:70-76.
Why it matters
Impact: Wrong request or result, silent. Severity: Medium, because it needs the host application to have changed LC_TIME, which Python does not do by default.
How to check
Call locale.setlocale(locale.LC_TIME, 'de_DE.UTF-8') (if installed) and upload with expires=datetime(...); the stored b2-expires value has German names. Found by reading the code, not reproduced.
Version
Seen at v2.13.4. Present on the default branch: present.
Activity