cybozu / passh

Parallel SSH for cluster of hosts based on Python3 asyncio.
8 stars 2 forks source link

TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object #1

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi,

When i tried passh, it worked, but the Python code raised an exception:

$ python __init__.py ach 'ls /'
[ach] bin
[ach] boot
[ach] dev
[ach] etc
[ach] home
[ach] lib
[ach] lib64
[ach] lost+found
[ach] media
[ach] mnt
[ach] opt
[ach] proc
[ach] root
[ach] run
[ach] sbin
[ach] srv
[ach] sys
[ach] tmp
[ach] usr
[ach] var
Exception ignored in: <bound method BaseEventLoop.__del__ of <_UnixSelectorEventLoop running=False closed=True debug=False>>
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/base_events.py", line 381, in __del__
  File "/usr/lib/python3.5/asyncio/unix_events.py", line 58, in close
  File "/usr/lib/python3.5/asyncio/unix_events.py", line 139, in remove_signal_handler
  File "/usr/lib/python3.5/signal.py", line 47, in signal
TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object

Any idea why this exception was raised?

Have a nice day.

Cheers, Asher256

ymmt2005 commented 8 years ago

Thank you for the report. I will take a look in a week or so.

ghost commented 8 years ago

Thank you Yamamoto! Let me know. I'll try it again to confirm if the bug was fixed on my side.

ymmt2005 commented 8 years ago

This happens since Python 3.4.3 when they changed asyncio someway. https://bugs.python.org/issue23548

A design issue difficult for libraries like passh...

ymmt2005 commented 8 years ago

Asyncio programs are responsible to close the event loop by themselves. For non-asyncio programs, passh should create and use a dedicated event loop by asyncio.new_event_loop?

ymmt2005 commented 8 years ago

@Asher256 Could you try the new version?

ghost commented 8 years ago

I'm going to try it and let you know.

ghost commented 8 years ago

It works Yamamoto ! Thank you for the fix !

ymmt2005 commented 8 years ago

:+1: