This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hsmtkk
Recipients georg.brandl, hsmtkk
Date 2009-11-08.02:31:56
SpamBayes Score 4.979819e-09
Marked as misclassified No
Message-id <1257647520.68.0.169575152715.issue7285@psf.upfronthosting.co.za>
In-reply-to
Content
Example codes on multiprocessing module occur errors.
I attached the patch to fix these errors.

http://docs.python.org/dev/py3k/library/multiprocessing.html#module-
multiprocessing
"16.6.2.10. Listeners and Clients" section

Fix points are
1. Listener argument "authkey" must be a byte string
2. Client argument "authkey" must be a byte string
3. send_bytes argument must be a byte string

This is the server code listed on the section.
$ cat mpserver.py
from multiprocessing.connection import Listener
from array import array
address = ('localhost', 6000)     # family is deduced to be 'AF_INET'
listener = Listener(address, authkey='secret password')
conn = listener.accept()
print('connection accepted from', listener.last_accepted)
conn.send([2.25, None, 'junk', float])
conn.send_bytes('hello')
conn.send_bytes(array('i', [42, 1729]))
conn.close()
listener.close()

And the error is
$ python3.2 mpserver.py
Traceback (most recent call last):
  File "mpserver1.py", line 5, in <module>
    listener = Listener(address, authkey='secret password')
  File 
"/Users/kosmos/local/stow/py3k/lib/python3.2/multiprocessing/connection.
py", line 100, in __init__
    raise TypeError('authkey should be a byte string')
TypeError: authkey should be a byte string

My source code is svn revision 76151.
Regards.

---
Kouki Hashimoto
hsmtkk@gmail.com
History
Date User Action Args
2009-11-08 02:32:01hsmtkksetrecipients: + hsmtkk, georg.brandl
2009-11-08 02:32:00hsmtkksetmessageid: <1257647520.68.0.169575152715.issue7285@psf.upfronthosting.co.za>
2009-11-08 02:31:58hsmtkklinkissue7285 messages
2009-11-08 02:31:58hsmtkkcreate