Mutable List has wrong copy-behaviour in python2.7
Bug #1492317 reported by
Bulat Gaifullin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Fix Committed
|
Medium
|
Bulat Gaifullin |
Bug Description
The copy.copy or copy.deepcopy returns the new object that contains doubled content of original.
It causes because the class contains methods __setstate__ and __getstate__, that is used by functions copy and deepcopy.
the high-level algorithm, that is used in copy next:
save state of original object
create a new object of same type
> set saved state for new object
copy and append each element from original to second
it is root cause why the elements are duplicated.
In python2.6 the implementation of copy was different:
save state of original object
create a new object of same type
copy and append each element from original to second
> set saved state for new object
Changed in fuel: | |
assignee: | nobody → Bulat Gaifullin (bgaifullin) |
tags: | added: tech-debt |
Changed in fuel: | |
milestone: | none → 8.0 |
Changed in fuel: | |
status: | New → Confirmed |
summary: |
- Mutable List has wrong copy-behaviour + Mutable List has wrong copy-behaviour in python2.7 |
Changed in fuel: | |
importance: | Undecided → Medium |
tags: | added: area-python |
tags: | added: on-verification |
To post a comment you must log in.
Fix proposed to branch: master /review. openstack. org/220556
Review: https:/