Skip to content

References to global objects are broken #275

Description

@cicdw

In cloudpickle v.0.8.0 and above, it seems that references to global objects are lost in the serialization -> deserialization process.

For example, the following asserts pass in cloudpickle 0.7.0:

importcloudpickleFOO= {}
deffoo_add(x):
FOO["x"] =xfunc=cloudpickle.loads(cloudpickle.dumps(foo_add))
assertFOO== {}, FOOfunc(66)
assertFOO== {"x": 66}, FOOfoo_add(67)
assertFOO== {"x": 67}, FOO

However, in 0.8.0 and above, the following assert fails:

func(66)
assertFOO== {"x": 66}, FOO

with:

AssertionError: {}

i.e., the function runs without error but doesn't actually affect the global dictionary anymore.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions