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 terry.reedy
Recipients docs@python, sbt, terry.reedy
Date 2014-08-29.23:25:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1409354738.95.0.628176067564.issue22304@psf.upfronthosting.co.za>
In-reply-to
Content
https://docs.python.org/2/library/multiprocessing.html#examples
contains several examples in Python2 code that need to be updated for Python 3. Richard, if you have them in .py files, perhaps you could run them through 2to3 and then test.

# Example where a pool of http servers share a single listening socket
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
...
    print 'Serving at http://%s:%d using %d worker processes' % \
          (ADDRESS[0], ADDRESS[1], NUMBER_OF_PROCESSES)
    print 'To exit press Ctrl-' + ['C', 'Break'][sys.platform=='win32']

#update
from http.server import HTTPServer, SimpleHTTPRequestHandler
...
    print('Serving at http://%s:%d using %d worker processes' % \
          (ADDRESS[0], ADDRESS[1], NUMBER_OF_PROCESSES))
    print('To exit press Ctrl-' + ['C', 'Break'][sys.platform=='win32'])


This still does not run on Windows 
_pickle.PicklingError: Can't pickle <class '_thread.lock'>: attribute lookup lock on _thread failed
but that was true in 2.7 also (#21204).
History
Date User Action Args
2014-08-29 23:25:39terry.reedysetrecipients: + terry.reedy, docs@python, sbt
2014-08-29 23:25:38terry.reedysetmessageid: <1409354738.95.0.628176067564.issue22304@psf.upfronthosting.co.za>
2014-08-29 23:25:38terry.reedylinkissue22304 messages
2014-08-29 23:25:38terry.reedycreate