{"action":"created","issue":{"url":"https://api.github.com/repos/leo-editor/leo-editor/issues/541","repository_url":"https://api.github.com/repos/leo-editor/leo-editor","labels_url":"https://api.github.com/repos/leo-editor/leo-editor/issues/541/labels{/name}","comments_url":"https://api.github.com/repos/leo-editor/leo-editor/issues/541/comments","events_url":"https://api.github.com/repos/leo-editor/leo-editor/issues/541/events","html_url":"https://github.com/leo-editor/leo-editor/issues/541","id":249870117,"number":541,"title":"Editor does not open when using pythonw","user":{"login":"xgid","id":12764559,"avatar_url":"https://avatars2.githubusercontent.com/u/12764559?v=4","gravatar_id":"","url":"https://api.github.com/users/xgid","html_url":"https://github.com/xgid","followers_url":"https://api.github.com/users/xgid/followers","following_url":"https://api.github.com/users/xgid/following{/other_user}","gists_url":"https://api.github.com/users/xgid/gists{/gist_id}","starred_url":"https://api.github.com/users/xgid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xgid/subscriptions","organizations_url":"https://api.github.com/users/xgid/orgs","repos_url":"https://api.github.com/users/xgid/repos","events_url":"https://api.github.com/users/xgid/events{/privacy}","received_events_url":"https://api.github.com/users/xgid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-13T12:13:10Z","updated_at":"2017-09-13T14:52:28Z","closed_at":null,"author_association":"NONE","body":"When using the following to open Leo from a Windows console:\r\n```\r\npythonw.exe launchLeo.py\r\n```\r\n\r\nthe splash screen appears for a moment and then Leo exits quickly without giving any message.\r\n\r\nIf `python.exe` is used instead, as in:\r\n```\r\npython.exe launchLeo.py\r\n```\r\n\r\nLeo opens correctly!\r\n\r\nMy current installation is this one:\r\n```\r\nLeo 5.5, build 20170804155810, Fri Aug  4 15:58:10 CDT 2017\r\nGit repo info: branch = master, commit = ca18e51063a9\r\nPython 3.6.1, PyQt version 5.6.2\r\nWindows 10 AMD64 (build 10.0.15063) SP0\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/leo-editor/leo-editor/issues/comments/329193246","html_url":"https://github.com/leo-editor/leo-editor/issues/541#issuecomment-329193246","issue_url":"https://api.github.com/repos/leo-editor/leo-editor/issues/541","id":329193246,"user":{"login":"edreamleo","id":592928,"avatar_url":"https://avatars0.githubusercontent.com/u/592928?v=4","gravatar_id":"","url":"https://api.github.com/users/edreamleo","html_url":"https://github.com/edreamleo","followers_url":"https://api.github.com/users/edreamleo/followers","following_url":"https://api.github.com/users/edreamleo/following{/other_user}","gists_url":"https://api.github.com/users/edreamleo/gists{/gist_id}","starred_url":"https://api.github.com/users/edreamleo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edreamleo/subscriptions","organizations_url":"https://api.github.com/users/edreamleo/orgs","repos_url":"https://api.github.com/users/edreamleo/repos","events_url":"https://api.github.com/users/edreamleo/events{/privacy}","received_events_url":"https://api.github.com/users/edreamleo/received_events","type":"User","site_admin":false},"created_at":"2017-09-13T14:52:28Z","updated_at":"2017-09-13T14:52:28Z","author_association":"OWNER","body":"I have just found this excellent [stack overflow discussion about pythonw on Windows](https://stackoverflow.com/questions/24835155/pyw-and-pythonw-does-not-run-under-windows-7/30310192#30310192). This appears to be a known issue.\r\n\r\nThere is a workaround from the command line:\r\n\r\n```pythonw.exe  ...launchLeo.py --gui=qttabs %* 1> stdout.txt 2>stderr.txt```\r\n\r\nThe stack overflow page recommends adding this to the startup code:\r\n\r\n```python\r\nif sys.executable.endswith(\"pythonw.exe\"):\r\n  sys.stdout = open(os.devnull, \"w\");\r\n  sys.stderr = open(os.path.join(os.getenv(\"TEMP\"), \"stderr-\"+os.path.basename(sys.argv[0])), \"w\")\r\n```\r\n"}}
{"actor":{"display_login":"edreamleo"}}