Skip to content

Commit

Permalink
pause - fix curses.setupterm() error (#47851)
Browse files Browse the repository at this point in the history
* [Bugfix] curses.setupterm() error

When run playbook in celery task, curses.setupterm()  will be failed

```
  File "<frozen importlib._bootstrap>", line 675, in _load
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/Users/guang/.virtualenvs/ansible/lib/python3.6/site-packages/ansible/plugins/action/pause.py", line 45, in <module>
    curses.setupterm()
TypeError: argument must be an int, or have a fileno() method.

```

* Add changelog

Co-authored-by: Sam Doran <sdoran@redhat.com>
  • Loading branch information
ibuler and samdoran committed Jun 29, 2020
1 parent b491f77 commit c3fc2d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/pause-catch-error-when-no-std-exists.yml
@@ -0,0 +1,2 @@
bugfixes:
- pause - handle exception when there is no stdout (https://github.com/ansible/ansible/pull/47851)
2 changes: 1 addition & 1 deletion lib/ansible/plugins/action/pause.py
Expand Up @@ -41,7 +41,7 @@
try:
curses.setupterm()
HAS_CURSES = True
except curses.error:
except (curses.error, TypeError):
HAS_CURSES = False
except ImportError:
HAS_CURSES = False
Expand Down

0 comments on commit c3fc2d2

Please sign in to comment.