-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
pygettext: non-standard timestamp format in POT-Creation-Date #62328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
pygettext uses non-standard timestamp format in the POT-Creation-Date field. For example: POT-Creation-Date: 2013-06-03 22:31+CEST whereas xgettext uses this format: POT-Creation-Date: 2013-06-03 22:31+0200 You could use this code to generate timestamps in the same format as xgettext: from time import time, localtime, strftime
from calendar import timegm
def gettext_timestamp():
now = int(time())
nowtuple = localtime(now)
offset = timegm(nowtuple) - now
sign = '-' if offset < 0 else '+'
hour, minute = divmod(abs(offset) // 60, 60)
return strftime('%Y-%m-%d %H:%M', nowtuple) + sign + '%02d%02d' % (hour, minute) |
It's probably worth changing. My only concern would be backwards compatibility issues. |
I'm going to be adding some tests around pygettext tool and then tackling this. |
Patch File iss18128.patch adds test_i18n to start testing the entire Tools/i18n package, and has a very simple fix. |
Post-review - new patch |
Barry, would you be OK with just applying this to 3.5? We can add a porting note to whatsnew. My guess, though, is that no one is going to notice. |
Oh, I forgot to say that the patch looks good to me. |
@rdm: I'm pretty sure you're right about nobody noticing. :) Make it so! |
New changeset c969413584cf by R David Murray in branch 'default': |
Thanks, Michael. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: