{"action":"created","issue":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1705","labels_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1705/labels{/name}","comments_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1705/comments","events_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1705/events","html_url":"https://github.com/pyinstaller/pyinstaller/issues/1705","id":120197482,"number":1705,"title":"Python 3.5 code compiled with PyInstaller 3.0 crashes running under code page 65001 on Windows","user":{"login":"ShaiWavesAudio","id":3169014,"avatar_url":"https://avatars.githubusercontent.com/u/3169014?v=3","gravatar_id":"","url":"https://api.github.com/users/ShaiWavesAudio","html_url":"https://github.com/ShaiWavesAudio","followers_url":"https://api.github.com/users/ShaiWavesAudio/followers","following_url":"https://api.github.com/users/ShaiWavesAudio/following{/other_user}","gists_url":"https://api.github.com/users/ShaiWavesAudio/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaiWavesAudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaiWavesAudio/subscriptions","organizations_url":"https://api.github.com/users/ShaiWavesAudio/orgs","repos_url":"https://api.github.com/users/ShaiWavesAudio/repos","events_url":"https://api.github.com/users/ShaiWavesAudio/events{/privacy}","received_events_url":"https://api.github.com/users/ShaiWavesAudio/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/PY3.5","name":"PY3.5","color":"fef2c0"},{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/labels/Windows","name":"Windows","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-03T15:32:30Z","updated_at":"2015-12-03T16:25:59Z","closed_at":null,"body":"I'm compiling a command line application using PyInstaller 3.0 with python 3.5 on Windows.\r\n\r\nWhen I run the application under CMD.EXE configured for **code page 65001**, the compiled executable will not run, with the message:\r\n\r\nFatal Python error: Py_Initialize: can't initialize sys standard streams\r\nLookupError: unknown encoding: cp65001\r\n\r\nIf CMD.EXE is configured for it's default code page (437) the compiled executable will run without problem.\r\n\r\nThe program can be as small as \r\n``` python\r\nprint(\"\")\r\n```\r\n\r\nwithout any import statements.\r\n\r\n\r\nWhat I already tried:\r\n\r\n* inserted the following code as the very first thing my application calls:\r\n``` python\r\n import codecs\r\n codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None)\r\n```\r\n* Called 'chcp 65001' before compiling with PyInstaller, so the whole compilation is done under code page 65001\r\n\r\n* Ran cmd.exe in admin mode\r\n\r\nThese did not solve the problem.\r\n\r\nSystem information:\r\n\r\n* Windows 7 Enterprise, Service Pack 1\r\n* Python 3.5\r\n* PyInstaller 3.0\r\n* The command I use to change the code page: chcp 65001\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/comments/161704380","html_url":"https://github.com/pyinstaller/pyinstaller/issues/1705#issuecomment-161704380","issue_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1705","id":161704380,"user":{"login":"ShaiWavesAudio","id":3169014,"avatar_url":"https://avatars.githubusercontent.com/u/3169014?v=3","gravatar_id":"","url":"https://api.github.com/users/ShaiWavesAudio","html_url":"https://github.com/ShaiWavesAudio","followers_url":"https://api.github.com/users/ShaiWavesAudio/followers","following_url":"https://api.github.com/users/ShaiWavesAudio/following{/other_user}","gists_url":"https://api.github.com/users/ShaiWavesAudio/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaiWavesAudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaiWavesAudio/subscriptions","organizations_url":"https://api.github.com/users/ShaiWavesAudio/orgs","repos_url":"https://api.github.com/users/ShaiWavesAudio/repos","events_url":"https://api.github.com/users/ShaiWavesAudio/events{/privacy}","received_events_url":"https://api.github.com/users/ShaiWavesAudio/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T16:25:59Z","updated_at":"2015-12-03T16:25:59Z","body":"codewarrior0 thanks. As I'm new to PyInstaller, is there a workaround on my side? Should I include some code in my spec file?"}}