fedora-python / pyp2rpm

Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
MIT License
123 stars 39 forks source link

Localized date in %changelog #126

Closed hroncok closed 6 years ago

hroncok commented 7 years ago
$ locale
LANG=cs_CZ.utf8
LC_CTYPE="cs_CZ.utf8"
LC_NUMERIC="cs_CZ.utf8"
LC_TIME="cs_CZ.utf8"
LC_COLLATE="cs_CZ.utf8"
LC_MONETARY="cs_CZ.utf8"
LC_MESSAGES="cs_CZ.utf8"
LC_PAPER="cs_CZ.utf8"
LC_NAME="cs_CZ.utf8"
LC_ADDRESS="cs_CZ.utf8"
LC_TELEPHONE="cs_CZ.utf8"
LC_MEASUREMENT="cs_CZ.utf8"
LC_IDENTIFICATION="cs_CZ.utf8"
LC_ALL=

$ ./mybin.py -b 3 blurb
...
%changelog
* Čt čen 29 2017 Miro Hrončok <mhroncok@redhat.com> - 1.0.0.post1-1
- Initial package.

This is on Fedora 26. i don't think it happened before on Fedora 25.

mcyprian commented 6 years ago

I cannot reproduce this for some reason. I am running F26 and my locale output is exactly the same ^^.

hroncok commented 6 years ago

Funny enough, I can reproduce, but running he code that produces this isolated, will not reproduce:

>>> import time
>>> time.strftime('%a %b %d %Y', time.gmtime())
'Tue Jul 18 2017'
hroncok commented 6 years ago

So for some reason, when I put this in front of that call:

print(locale.getlocale(locale.LC_TIME))

It gives me ('cs_CZ', 'UTF-8'). I don't know when this is being taken from, but it can be reset fairly simple, PR will follow.