Repository: ipython/ipython

Issue:
SIGUSR1 not available on Windows
From the mailing list. Assigned to @ivanov , see commit 7902355526a44087dd25e4cb13231e0145b9c9ea.

```
C:\Users\dhirschfeld>ipython notebook
[NotebookApp] Using existing profile dir:
u'C:\\Users\\dhirschfeld\\.ipython\\profile_default'
Traceback (most recent call last):
  File "C:\dev\bin\Python27\Scripts\ipython-script.py", line 9, in <module>
    load_entry_point('ipython==1.0.dev', 'console_scripts', 'ipython')()
  File "c:\dev\code\ipython\IPython\frontend\terminal\ipapp.py", line 390, in
launch_new_instance
    app.initialize()
  File "<string>", line 2, in initialize
  File "c:\dev\code\ipython\IPython\config\application.py", line 84, in
catch_config_error
    return method(app, *args, **kwargs)
  File "c:\dev\code\ipython\IPython\frontend\terminal\ipapp.py", line 315, in
initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "c:\dev\code\ipython\IPython\config\application.py", line 84, in
catch_config_error
    return method(app, *args, **kwargs)
  File "c:\dev\code\ipython\IPython\core\application.py", line 323, in
initialize
    self.parse_command_line(argv)
  File "c:\dev\code\ipython\IPython\frontend\terminal\ipapp.py", line 310, in
parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "c:\dev\code\ipython\IPython\config\application.py", line 84, in
catch_config_error
    return method(app, *args, **kwargs)
  File "c:\dev\code\ipython\IPython\config\application.py", line 428, in
parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "c:\dev\code\ipython\IPython\config\application.py", line 84, in
catch_config_error
    return method(app, *args, **kwargs)
  File "c:\dev\code\ipython\IPython\config\application.py", line 367, in
initialize_subcommand
    self.subapp.initialize(argv)
  File "<string>", line 2, in initialize
  File "c:\dev\code\ipython\IPython\config\application.py", line 84, in
catch_config_error
    return method(app, *args, **kwargs)
  File "c:\dev\code\ipython\IPython\frontend\html\notebook\notebookapp.py", line
616, in initialize
    self.init_signal()
  File "c:\dev\code\ipython\IPython\frontend\html\notebook\notebookapp.py", line
553, in init_signal
    signal.signal(signal.SIGUSR1, self._signal_info)
AttributeError: 'module' object has no attribute 'SIGUSR1'
```



Discussion:

Resolving patch:
diff --git a/IPython/frontend/html/notebook/notebookapp.py b/IPython/frontend/html/notebook/notebookapp.py
--- a/IPython/frontend/html/notebook/notebookapp.py
+++ b/IPython/frontend/html/notebook/notebookapp.py
@@ -550,7 +550,9 @@ def init_signal(self):
             # but it will work
             signal.signal(signal.SIGINT, self._handle_sigint)
         signal.signal(signal.SIGTERM, self._signal_stop)
-        signal.signal(signal.SIGUSR1, self._signal_info)
+        if hasattr(signal, 'SIGUSR1'):
+            # Windows doesn't support SIGUSR1
+            signal.signal(signal.SIGUSR1, self._signal_info)
         if hasattr(signal, 'SIGINFO'):
             # only on BSD-based systems
             signal.signal(signal.SIGINFO, self._signal_info)


Test patch: