[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-09-06 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests:  -26608

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-09-06 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +iritkatriel
nosy_count: 6.0 -> 7.0
pull_requests: +26608
pull_request: https://github.com/python/cpython/pull/23688

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-01-18 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-01-18 Thread Eryk Sun


Eryk Sun  added the comment:

FYI, Windows is not a POSIX operating system and does not implement Unix 
signals in the kernel. That said, the C language serves as a base level of 
cross-platform support for language runtimes across most operating systems, and 
there's significant coupling between C and Unix. Standard C requires six Unix 
signals to be supported in some fashion: SIGABRT, SIGTERM, SIGFPE, SIGILL, 
SIGSEGV, and SIGINT. 

The C runtime in Windows implements SIGABRT and SIGTERM only within the 
process, e.g. with C raise() and abort(). There's no mechanism to send these 
signals to another process. It implements SIGFPE, SIGILL, SIGSEGV using an OS 
structured exception handler, but these can't and shouldn't be handled in 
Python. 

That leaves SIGINT, which is implemented for console applications using a 
console control handler for the cancel event (CTRL_C_EVENT). The same handler 
also implements non-standard SIGBREAK for the other console control events: 
break, close, logoff, and shutdown. 

There's limited support to send the cancel and break events (CTRL_C_EVENT and 
CTRL_BREAK_EVENT) to other processes via WinAPI 
GenerateConsoleCtrlEvent(ctrlEvent, processGroupId). The event can be sent to a 
process group in the current console session or to all processes (group 0) in 
the console session. The process group ID (pgid) of a process cannot be 
directly queried. The only way to know a pgid is to create a process as the 
leader of a new group with the creation flag CREATE_NEW_PROCESS_GROUP, in which 
case the pgid is the pid. A new process group initially has the cancel event 
ignored, until a process manually enables it. So in practice you can only rely 
on sending the break event. This is implemented in Python via os.kill(pgid, 
event) and subprocess.Popen.send_signal(event). But remember the target pgid 
must be either 0 or a known pgid. Using a pid that's not a pgid has undefined 
behavior.

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-01-18 Thread Guido van Rossum


Guido van Rossum  added the comment:

As the docs explain, SIGHUP is not available on Windows. This is as designed.

--
nosy: +gvanrossum
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-01-18 Thread Joel Ewaldo


New submission from Joel Ewaldo :

I have already tried uninstalling and reinstalling python 3.7.9 via the 64-bit 
installer on the official python website. Also, I am on the latest version of 
windows. I have also made sure that signal.py was not a file in my directory 
and when I import _signal followed with print(dir(_signal)), it returns 
['CTRL_BREAK_EVENT', 'CTRL_C_EVENT', 'NSIG', 'SIGABRT', 'SIGBREAK', 'SIGFPE', 
'SIGILL', 'SIGINT', 'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_IGN', '__doc__', 
'__loader__', '__name__', '__package__', 
'__spec__', 'default_int_handler', 'getsignal', 'set_wakeup_fd', 'signal'].

--
components: Windows
files: unknown (2).png
messages: 385227
nosy: ametatheton2, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: AttributeError: module 'signal' has no attribute 'SIGHUP'
type: compile error
versions: Python 3.9
Added file: https://bugs.python.org/file49748/unknown (2).png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com