Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7285] multiprocessing module, example code error

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 7, 2009, 6:32 PM

Post #1 of 3 (201 views)
Permalink
[issue7285] multiprocessing module, example code error

New submission from Kouki Hashimoto <hsmtkk [at] gmail>:

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 [at] gmail

----------
assignee: georg.brandl
components: Documentation
files: multiprocessing.rst.diff
keywords: patch
messages: 95035
nosy: georg.brandl, hsmtkk
severity: normal
status: open
title: multiprocessing module, example code error
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file15288/multiprocessing.rst.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7285>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 7, 2009, 8:35 PM

Post #2 of 3 (199 views)
Permalink
[issue7285] multiprocessing module, example code error [In reply to]

Changes by Benjamin Peterson <benjamin [at] python>:


----------
assignee: georg.brandl -> jnoller
nosy: +jnoller

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7285>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 21, 2009, 4:03 AM

Post #3 of 3 (148 views)
Permalink
[issue7285] multiprocessing module, example code error [In reply to]

Changes by Ask Solem <askh [at] opera>:


Added file: http://bugs.python.org/file15374/7285.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7285>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.