{"action":"opened","issue":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1378","labels_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1378/labels{/name}","comments_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1378/comments","events_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1378/events","html_url":"https://github.com/pyinstaller/pyinstaller/issues/1378","id":98733782,"number":1378,"title":"'time' module not working with locales","user":{"login":"matysek","id":527280,"avatar_url":"https://avatars.githubusercontent.com/u/527280?v=3","gravatar_id":"","url":"https://api.github.com/users/matysek","html_url":"https://github.com/matysek","followers_url":"https://api.github.com/users/matysek/followers","following_url":"https://api.github.com/users/matysek/following{/other_user}","gists_url":"https://api.github.com/users/matysek/gists{/gist_id}","starred_url":"https://api.github.com/users/matysek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matysek/subscriptions","organizations_url":"https://api.github.com/users/matysek/orgs","repos_url":"https://api.github.com/users/matysek/repos","events_url":"https://api.github.com/users/matysek/events{/privacy}","received_events_url":"https://api.github.com/users/matysek/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/labels/@medium","name":"@medium","color":"FFD07D"},{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/labels/Linux","name":"Linux","color":"d4c5f9"},{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/labels/PY3","name":"PY3","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-03T12:31:24Z","updated_at":"2015-08-03T12:31:24Z","closed_at":null,"body":"It looks like pull request #1369 broke some python modules when using with non 'C' locales. On my system I use locale 'cs_CZ.UTF-8' and the test_time_module is failing.\r\n```\r\n(pyinst3) [martin@martin-laptop python3]$ export LC_ALL=C\r\n(pyinst3) [martin@martin-laptop python3]$ py.test\r\n========================================== test session starts ==========================================\r\nplatform linux -- Python 3.4.2 -- py-1.4.30 -- pytest-2.7.2 -- /home/martin/Projects/python/pyinst3/bin/python\r\nrootdir: /home/martin/Projects/pyinstaller/python3, inifile: setup.cfg\r\nplugins: xdist\r\ncollected 71 items \r\n\r\ntests/functional/test_basic.py::test_time_module[onedir] PASSED\r\n\r\n======================================= 1 passed in 8.41 seconds ========================================\r\n(pyinst3) [martin@martin-laptop python3]$ export LC_ALL=cs_CZ.UTF-8\r\n(pyinst3) [martin@martin-laptop python3]$ py.test\r\n========================================== test session starts ==========================================\r\nplatform linux -- Python 3.4.2 -- py-1.4.30 -- pytest-2.7.2 -- /home/martin/Projects/python/pyinst3/bin/python\r\nrootdir: /home/martin/Projects/pyinstaller/python3, inifile: setup.cfg\r\nplugins: xdist\r\ncollected 71 items \r\n\r\ntests/functional/test_basic.py::test_time_module[onedir] FAILED\r\n\r\n=============================================== FAILURES ================================================\r\n_______________________________________ test_time_module[onedir] ________________________________________\r\n\r\n----------------------------------------- Captured stdout call ------------------------------------------\r\nRUNNING: './pyi_time_module'\r\n----------------------------------------- Captured stderr call ------------------------------------------\r\nPyInstaller Bootloader 3.x\r\nLOADER: LC_CTYPE is C\r\nLOADER: Setting LC_CTYPE to \"\" (using current locale)\r\nLOADER: LC_CTYPE is now cs_CZ.UTF-8\r\nLOADER: executable is /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module/pyi_time_module\r\nLOADER: homepath is /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module\r\nLOADER: _MEIPASS2 is NULL\r\nLOADER: archivename is /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module/pyi_time_module\r\nLOADER: Extracting binaries\r\nLOADER: Executing self as child\r\nLOADER: set _MEIPASS2 to /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module\r\nLOADER: LD_LIBRARY_PATH=/tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module\r\nPyInstaller Bootloader 3.x\r\nLOADER: LC_CTYPE is C\r\nLOADER: Setting LC_CTYPE to \"\" (using current locale)\r\nLOADER: LC_CTYPE is now cs_CZ.UTF-8\r\nLOADER: executable is /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module/pyi_time_module\r\nLOADER: homepath is /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module\r\nLOADER: _MEIPASS2 is /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module\r\nLOADER: archivename is /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module/pyi_time_module\r\nLOADER: Already in the child - running user's code.\r\nLOADER: Python library: /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module/libpython3.4m.so.1.0\r\nLOADER: Loaded functions from Python library.\r\nLOADER: Manipulating environment (PYTHONPATH, PYTHONHOME)\r\nLOADER: Pre-init PYTHONPATH is /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module/base_library.zip:/tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module\r\nLOADER: PYTHONHOME is /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module\r\nLOADER: Setting runtime options\r\nLOADER: S\r\nLOADER: Initializing python\r\nLOADER: Overriding Python's sys.path\r\nLOADER: Post-init PYTHONPATH is /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module/base_library.zip:/tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module\r\nLOADER: Setting sys.argv\r\nLOADER: importing modules from CArchive\r\nLOADER: extracted struct\r\nLOADER: callfunction returned...\r\nLOADER: extracted pyimod01_os_path\r\nLOADER: callfunction returned...\r\nLOADER: extracted pyimod02_archive\r\nLOADER: callfunction returned...\r\nLOADER: extracted pyimod03_importers\r\nLOADER: callfunction returned...\r\nLOADER: Installing PYZ archive with Python modules.\r\nLOADER: out00-PYZ.pyz\r\nLOADER: import sys; sys.path.append(r\"/tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module/pyi_time_module?35568\")\r\nLOADER: Running scripts\r\nLOADER: RC: -1 from pyi_time_module\r\nLOADER: OK.\r\nLOADER: Cleaning up Python interpreter.\r\nTraceback (most recent call last):\r\n  File \"<string>\", line 12, in <module>\r\n  File \"/usr/lib64/python3.4/_strptime.py\", line 494, in _strptime_time\r\n    tt = _strptime(data_string, format)[0]\r\n  File \"/usr/lib64/python3.4/_strptime.py\", line 337, in _strptime\r\n    (data_string, format))\r\nValueError: time data 'Mon Aug  3 14:26:33 2015' does not match format '%a %b %d %H:%M:%S %Y'\r\nLOADER: Back to parent\r\nLOADER: Doing cleanup\r\nLOADER: Freeing archive status for /tmp/pytest-23/test_time_module_onedir_0/dist/pyi_time_module/pyi_time_module\r\n======================================== short test summary info ========================================\r\nFAIL tests/functional/test_basic.py::test_time_module[onedir]\r\n======================================= 1 failed in 8.92 seconds ========================================\r\n(pyinst3) [martin@martin-laptop python3]$ \r\n\r\n```\r\n\r\nAfter deeper analysis of the `time` module I found out that with locale cs_CZ.UTF-8:\r\n* `time.ctime()` returns current date in English but\r\n* `time.strptime()` uses locale cs_CZ.UTF-8 to parse the time string."}}