mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 01:41:58 +08:00
Serialize StringIO with pickle (#5781)
This commit is contained in:
@@ -8,6 +8,7 @@ import atexit
|
||||
import faulthandler
|
||||
import hashlib
|
||||
import inspect
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
import numpy as np
|
||||
@@ -1278,6 +1279,16 @@ def _initialize_serialization(job_id, worker=global_worker):
|
||||
local=True,
|
||||
job_id=job_id,
|
||||
class_id="ray.signature.FunctionSignature")
|
||||
# Tell Ray to serialize StringIO with pickle. We do this because
|
||||
# Ray's default __dict__ serialization is incorrect for this type
|
||||
# (the object's __dict__ is empty and therefore doesn't
|
||||
# contain the full state of the object).
|
||||
register_custom_serializer(
|
||||
io.StringIO,
|
||||
use_pickle=True,
|
||||
local=True,
|
||||
job_id=job_id,
|
||||
class_id="io.StringIO")
|
||||
|
||||
|
||||
def init(address=None,
|
||||
|
||||
Reference in New Issue
Block a user