Skip to content

Instantly share code, notes, and snippets.

@mattip
Created September 22, 2019 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattip/a65fcb97151e9e089eb0b994f94b75b7 to your computer and use it in GitHub Desktop.
Save mattip/a65fcb97151e9e089eb0b994f94b75b7 to your computer and use it in GitHub Desktop.
add to module/time/test/test_time.py
class AppTestLocaleTime:
spaceconfig = {
"usemodules": ['time', '_locale'],
}
def test_strftime_locale(self):
# issue bb-3079
import time, _locale, os
oldlocale = os.environ.get('LC_TIME', None)
_locale.setlocale(_locale.LC_TIME, 'fr_FR')
try:
s = time.strftime('%B', (2019, 8, 17, 0, 0, 0, 0, 0, 0))
print(s, s.encode('utf8'))
assert s.encode('utf8') == b'ao\xc3\xbbt'
finally:
if oldlocale:
_locale.setlocale(_locale.LC_TIME, oldlocale)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment