diff --git a/.travis/install-dependencies.sh b/.travis/install-dependencies.sh index 3ec2ea79b..3357d81d7 100755 --- a/.travis/install-dependencies.sh +++ b/.travis/install-dependencies.sh @@ -24,7 +24,7 @@ if [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "linux" ]]; then wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh -nv bash miniconda.sh -b -p $HOME/miniconda export PATH="$HOME/miniconda/bin:$PATH" - pip install -q numpy cloudpickle==0.3.0 cython cmake funcsigs click colorama psutil redis tensorflow gym flatbuffers opencv-python + pip install -q numpy cloudpickle cython cmake funcsigs click colorama psutil redis tensorflow gym flatbuffers opencv-python elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then sudo apt-get update sudo apt-get install -y cmake pkg-config python-dev python-numpy build-essential autoconf curl libtool unzip @@ -32,7 +32,7 @@ elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh -nv bash miniconda.sh -b -p $HOME/miniconda export PATH="$HOME/miniconda/bin:$PATH" - pip install -q numpy cloudpickle==0.3.0 cython cmake funcsigs click colorama psutil redis tensorflow gym flatbuffers opencv-python + pip install -q numpy cloudpickle cython cmake funcsigs click colorama psutil redis tensorflow gym flatbuffers opencv-python elif [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "macosx" ]]; then # check that brew is installed which -s brew @@ -48,7 +48,7 @@ elif [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "macosx" ]]; then wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh -nv bash miniconda.sh -b -p $HOME/miniconda export PATH="$HOME/miniconda/bin:$PATH" - pip install -q numpy cloudpickle==0.3.0 cython cmake funcsigs click colorama psutil redis tensorflow gym flatbuffers opencv-python + pip install -q numpy cloudpickle cython cmake funcsigs click colorama psutil redis tensorflow gym flatbuffers opencv-python elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "macosx" ]]; then # check that brew is installed which -s brew @@ -64,7 +64,7 @@ elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "macosx" ]]; then wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh -nv bash miniconda.sh -b -p $HOME/miniconda export PATH="$HOME/miniconda/bin:$PATH" - pip install -q numpy cloudpickle==0.3.0 cython cmake funcsigs click colorama psutil redis tensorflow gym flatbuffers opencv-python + pip install -q numpy cloudpickle cython cmake funcsigs click colorama psutil redis tensorflow gym flatbuffers opencv-python elif [[ "$LINT" == "1" ]]; then sudo apt-get update sudo apt-get install -y cmake build-essential autoconf curl libtool unzip diff --git a/python/ray/worker.py b/python/ray/worker.py index a2a5048a8..8dd8b9c8e 100644 --- a/python/ray/worker.py +++ b/python/ray/worker.py @@ -299,7 +299,10 @@ class Worker(object): .format(type(e.example_object))) print(warning_message) except (serialization.RayNotDictionarySerializable, - pickle.pickle.PicklingError): + pickle.pickle.PicklingError, + Exception): + # We also handle generic exceptions here because + # cloudpickle can fail with many different types of errors. _register_class(type(e.example_object), use_pickle=True) warning_message = ("WARNING: Falling back to serializing " "objects of type {} by using pickle. " diff --git a/python/setup.py b/python/setup.py index 66196329d..f87b1a46e 100644 --- a/python/setup.py +++ b/python/setup.py @@ -108,7 +108,7 @@ setup(name="ray", "psutil", "pytest", "redis", - "cloudpickle >= 0.2.2", + "cloudpickle >= 0.4.1", # The six module is required by pyarrow. "six >= 1.0.0", "flatbuffers"],