Skip to content

Commit

Permalink
Optional disabling of prevent_sigint.
Browse files Browse the repository at this point in the history
This is a workaround for a strange hang on fork() when `Popen` is called with
a `preexec_fn` (see #58). If the environment variable
`IMAGEIO_FFMPEG_NO_PREVENT_SIGINT` is not empty, `preexec_fn` is set to
None.
  • Loading branch information
Bulkin committed Aug 13, 2021
1 parent 615cbcc commit f5f6d4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions imageio_ffmpeg/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ def _popen_kwargs(prevent_sigint=False):
creationflags = 0x00000200
else:
preexec_fn = os.setpgrp # the _pre_exec does not seem to work

if os.getenv('IMAGEIO_FFMPEG_NO_PREVENT_SIGINT', ''):
# Unset preexec_fn to work around a strange hang on fork() (see #58)
preexec_fn = None

return {
"startupinfo": startupinfo,
"creationflags": creationflags,
Expand Down

0 comments on commit f5f6d4a

Please sign in to comment.