diff --git a/platypush/plugins/media/mplayer.py b/platypush/plugins/media/mplayer.py index 871c74a7a5..4d879f24d4 100644 --- a/platypush/plugins/media/mplayer.py +++ b/platypush/plugins/media/mplayer.py @@ -112,13 +112,15 @@ class MediaMplayerPlugin(MediaPlugin): if arg not in args: args.append(arg) - env = os.environ.copy() - if self._env: - env.update(self._env) + popen_args = { + 'stdin': subprocess.PIPE, + 'stdout': subprocess.PIPE, + } - self._mplayer = subprocess.Popen(args, env=env, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE) + if self._env: + popen_args['env'] = self._env + + self._mplayer = subprocess.Popen(args, **popen_args) def _build_actions(self): """ Populates the actions list by introspecting the mplayer executable """