{"action":"created","issue":{"url":"https://api.github.com/repos/sampsyo/audioread/issues/20","labels_url":"https://api.github.com/repos/sampsyo/audioread/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/sampsyo/audioread/issues/20/comments","events_url":"https://api.github.com/repos/sampsyo/audioread/issues/20/events","html_url":"https://github.com/sampsyo/audioread/pull/20","id":64502848,"number":20,"title":"fix: do not display windows error popup when ffmpeg crashes","user":{"login":"jcsaaddupuy","id":11556,"avatar_url":"https://avatars.githubusercontent.com/u/11556?v=3","gravatar_id":"","url":"https://api.github.com/users/jcsaaddupuy","html_url":"https://github.com/jcsaaddupuy","followers_url":"https://api.github.com/users/jcsaaddupuy/followers","following_url":"https://api.github.com/users/jcsaaddupuy/following{/other_user}","gists_url":"https://api.github.com/users/jcsaaddupuy/gists{/gist_id}","starred_url":"https://api.github.com/users/jcsaaddupuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcsaaddupuy/subscriptions","organizations_url":"https://api.github.com/users/jcsaaddupuy/orgs","repos_url":"https://api.github.com/users/jcsaaddupuy/repos","events_url":"https://api.github.com/users/jcsaaddupuy/events{/privacy}","received_events_url":"https://api.github.com/users/jcsaaddupuy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-26T11:27:04Z","updated_at":"2015-03-26T17:08:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sampsyo/audioread/pulls/20","html_url":"https://github.com/sampsyo/audioread/pull/20","diff_url":"https://github.com/sampsyo/audioread/pull/20.diff","patch_url":"https://github.com/sampsyo/audioread/pull/20.patch"},"body":"Hi.\r\nOn another poject using ffmpeg, I came accross a nasty behavior on windows when, for any reason, a process spawned by subprocess.popen crashes.\r\n\r\nBy default,  windows will display an error pop-up like this one, instead of lettting the process die silently (in a user perspective)\r\n\r\n(in this case, this is ffprobe crashing when trying to read an h264 video, but the result would be the same with an ffmpeg crash if/when it would happen)\r\n \r\n![screen shot 2015-03-26 at 11 13 55](https://cloud.githubusercontent.com/assets/11556/6844757/0392b15a-d3ae-11e4-8c94-0a0cddbad0f8.png)\r\n\r\nWindows will display one pop-up per crash (and if this happen on a large number of files, this would be total a mess for the user)\r\n\r\nThis PR aims to avoid this behavior on windows by setting error mode to [SEM_NOGPFAULTERRORBOX](https://msdn.microsoft.com/en-us/library/windows/desktop/ms680621%28v=vs.85%29.aspx) and pass SEM_NOOPENFILEERRORBOX as a a flag to popen.\r\nThis solution is based on this [stack overflow answer](http://stackoverflow.com/a/5103935)."},"comment":{"url":"https://api.github.com/repos/sampsyo/audioread/issues/comments/86627563","html_url":"https://github.com/sampsyo/audioread/pull/20#issuecomment-86627563","issue_url":"https://api.github.com/repos/sampsyo/audioread/issues/20","id":86627563,"user":{"login":"sampsyo","id":188033,"avatar_url":"https://avatars.githubusercontent.com/u/188033?v=3","gravatar_id":"","url":"https://api.github.com/users/sampsyo","html_url":"https://github.com/sampsyo","followers_url":"https://api.github.com/users/sampsyo/followers","following_url":"https://api.github.com/users/sampsyo/following{/other_user}","gists_url":"https://api.github.com/users/sampsyo/gists{/gist_id}","starred_url":"https://api.github.com/users/sampsyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sampsyo/subscriptions","organizations_url":"https://api.github.com/users/sampsyo/orgs","repos_url":"https://api.github.com/users/sampsyo/repos","events_url":"https://api.github.com/users/sampsyo/events{/privacy}","received_events_url":"https://api.github.com/users/sampsyo/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T17:08:27Z","updated_at":"2015-03-26T17:08:27Z","body":"Here's one SO answer that demonstrates resetting the error mode: http://stackoverflow.com/questions/4058303/silently-catch-windows-error-popups-when-calling-loadlibrary\r\n\r\nPerhaps doing this around the spawn call itself would be enough so that the subprocess inherits the parent's error mode. Then we wouldn't need to leave the mode modified for the entire decoding interval."}}