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.

作者 sbt
收信人 Jimbofbx, asksol, dragonfyre13, dsvensson, gsson, jnoller, jodal, pitrou, sbt
日期 2012-04-07.17:26:04
SpamBayes Score -1.0
Marked as misclassified
Message-id <1333819565.61.0.292996682609.issue4892@psf.upfronthosting.co.za>
In-reply-to
内容
ForkingPickler is only used when creating a child process.  The multiprocessing.reduction module is only really intended for sending stuff to *pre-existing* processes.

As things stand, after importing multiprocessing.reduction you can do something like

  buf = io.BytesIO()
  pickler = ForkingPickler(buf)
  pickler.dump(conn)
  data = buf.getvalue()
  writer.send_bytes(data)

But that is rather less simple and obvious than just doing

  writer.send(conn)

which was possible in pyprocessing.

Originally just importing the module magically registered the reduce functions with copyreg.  Since this was undesirable, the reduction functions were instead registered with ForkingPickler.  But this fix rather missed the point of the module.
历史
日期 用户 动作 参数
2012-04-07 17:26:05sbt修改recipients: + sbt, pitrou, jnoller, gsson, dsvensson, asksol, jodal, Jimbofbx, dragonfyre13
2012-04-07 17:26:05sbt修改messageid: <1333819565.61.0.292996682609.issue4892@psf.upfronthosting.co.za>
2012-04-07 17:26:05sbt链接issue4892 messages
2012-04-07 17:26:04sbt创建