Skip to content

Commit

Permalink
Merge pull request #2887 from laloch/sudo-permission-error
Browse files Browse the repository at this point in the history
Fix exception when trying to send SIGSTOP to finished sudo child
  • Loading branch information
melund committed Oct 17, 2018
2 parents 03d436f + 2c9d8bc commit a3a0bf9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion news/TEMPLATE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

**Removed:** None

**Fixed:** None
**Fixed:**

* Fixed a bug which under very rare conditions could cause the shell
to die with PermissionError exception while sending SIGSTOP signal
to a child process.

**Security:** None
5 changes: 4 additions & 1 deletion xonsh/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2419,7 +2419,10 @@ def pause_call_resume(p, f, *args, **kwargs):
hasattr(p, "send_signal") and ON_POSIX and not ON_MSYS and not ON_CYGWIN
)
if can_send_signal:
p.send_signal(signal.SIGSTOP)
try:
p.send_signal(signal.SIGSTOP)
except PermissionError:
pass
try:
f(*args, **kwargs)
except Exception:
Expand Down

0 comments on commit a3a0bf9

Please sign in to comment.