[issue43750] Undefined constant PACKET_MULTIHOST referred to in package socket

2021-04-06 Thread Tom Cook


New submission from Tom Cook :

The documentation for the `AF_PACKET` address family refers to 
`PACKET_MULTIHOST`.  I believe this should read `PACKET_MULTICAST`, which is 
defined on Linux systems (`PACKET_MULTIHOST` is not).

--
assignee: docs@python
components: Documentation
messages: 390345
nosy: Tom Cook, docs@python
priority: normal
severity: normal
status: open
title: Undefined constant PACKET_MULTIHOST referred to in package socket
type: enhancement
versions: Python 3.9

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



[issue20779] Add pathlib.chown method

2021-06-28 Thread Tom Cook


Tom Cook  added the comment:

+1 this.

I have a program that opens a UNIX socket as root for other processes to 
communicate with it.  I need to set the permissions to 0o775 and set the owner 
gid to a specific group so that members of that group can communicate with the 
process.  It's annoying to have to drop back to `os.chown(str(path), ...)` for 
this.

--
nosy: +Tom Cook

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



[issue32244] Multiprocessing: multiprocessing.connection.Listener.accept() should accept a timeout

2017-12-07 Thread Tom Cook

New submission from Tom Cook :

If nothing connects to it, `multiprocessing.connection.Listener.accept()` will 
block forever with no good way to interrupt it.

Supposing that a thread implements a loop like this:

def run(self):
l = Listener(socket_path, 'AF_UNIX')
while self.running:
c = l.accept()
while self.running:
data = c.recv()
self.process(data)

There is no obvious way to implement a `stop` method on this thread.  Setting 
`self.running = False` may never result in the thread terminating, as it may be 
that no client connects to it.  The following is a possible way of implementing 
it:

def stop(self):
self.running = False
try:
c = Client(socket_path, 'AF_UNIX')
except:
pass

however it seems fraught with race conditions.  Letting `accept()` accept a 
timeout would be a much cleaner solution to this and many similar problems.

--
components: Library (Lib)
messages: 307809
nosy: Tom Cook
priority: normal
severity: normal
status: open
title: Multiprocessing: multiprocessing.connection.Listener.accept() should 
accept a timeout
type: enhancement
versions: Python 3.6

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



[issue32244] Multiprocessing: multiprocessing.connection.Listener.accept() should accept a timeout

2017-12-07 Thread Tom Cook

Tom Cook  added the comment:

The same goes for `Connection.recv()`, as in the sample code another case where 
the thread will never terminate is when a `Client` is connected to the socket 
but never sends any messages; in this case, the call to `recv()` will block 
forever.  There is no way at all to interrupt this.

--

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