Commit 642031a6 authored by Paul Carduner's avatar Paul Carduner

back port the change in trunk from r99988 to this branch.

parent d8b7f92a
......@@ -2,6 +2,14 @@
CHANGES
=======
3.7.0.1 (unreleased)
--------------------
- Fix a bug in OrderedContainer where trying to set the value for a
key that already exists (duplication error) would actually delete the
key from the order, leaving a dangling reference.
3.7.0 (2009-01-31)
------------------
......
[buildout]
extends = http://download.zope.org/zope3.4/3.4.0/versions.cfg
develop = .
/home/wosc/gocept/grok/sprint/zope.app.broken
/home/wosc/gocept/grok/sprint/zope.testing
/home/wosc/gocept/grok/compattest
parts = test graph compat
parts = test graph
versions = versions
[versions]
ZODB3 = 3.8
zope.app.apidoc = 3.5
zope.app.container = 3.7.0
[test]
recipe = zc.recipe.testrunner
......@@ -17,10 +16,4 @@ eggs = zope.container
[graph]
recipe = zc.recipe.egg
eggs = ${test:eggs}
tl.eggdeps
[compat]
recipe = z3c.recipe.compattest
use_svn = true
svn_directory = /home/wosc/gocept/grok/sprint
max_jobs = 5
tl.eggdeps
\ No newline at end of file
......@@ -22,7 +22,7 @@ def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup(name='zope.container',
version = '3.7.0',
version = '3.7.0.1dev',
author='Zope Corporation and Contributors',
author_email='zope-dev@zope.org',
description='Zope Container',
......
......@@ -179,6 +179,13 @@ class OrderedContainer(Persistent, Contained):
['foo', 'baz']
>>> int(len(oc._order) == len(oc._data))
1
>>> oc['foo'] = 'baz'
Traceback (most recent call last):
...
DuplicationError: foo
>>> oc._order
['foo', 'baz']
"""
existed = self._data.has_key(key)
......@@ -207,7 +214,8 @@ class OrderedContainer(Persistent, Contained):
try:
setitem(self, self._data.__setitem__, key, object)
except Exception, e:
self._order.remove(key)
if not existed:
self._order.remove(key)
raise e
return key
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment