Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operate on unique data for each instance #2

Merged
merged 1 commit into from
Oct 6, 2014
Merged

Conversation

danielgtaylor
Copy link
Member

This fixes the following bug:

>>> s3 = boto3.resource('s3')
>>> obj1 = s3.Object('my-bucket', 'my-key')
>>> obj2 = s3.Object('my-bucket', 'my-key')
>>> obj1.load()
>>> print(obj2.meta['data'])
{ ... }

The data from obj1 was shared with obj2 which prevented making
multiple unique instances of resources. This fixes the issue by
making each resource operate on a copy of the data, created at
instantiation time. Adds a test to ensure this works as expected.

cc @jamesls, @kyleknap

This fixes the following bug:

    >>> s3 = boto3.resource('s3')
    >>> obj1 = s3.Object('my-bucket', 'my-key')
    >>> obj2 = s3.Object('my-bucket', 'my-key')
    >>> obj1.load()
    >>> print(obj2.meta['data'])
    { ... }

The data from `obj1` was shared with `obj2` which prevented making
multiple unique instances of resources. This fixes the issue by
making each resource operate on a copy of the data, created at
instantiation time. Adds a test to ensure this works as expected.
@danielgtaylor danielgtaylor added the bug This issue is a confirmed bug. label Oct 6, 2014
@danielgtaylor danielgtaylor self-assigned this Oct 6, 2014
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling 060654c on unique-meta into e07c203 on develop.

@jamesls
Copy link
Member

jamesls commented Oct 6, 2014

:shipit:

@kyleknap
Copy link
Contributor

kyleknap commented Oct 6, 2014

LGTM 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants