Hello community, here is the log from the commit of package python-transaction for openSUSE:Factory checked in at Tue Nov 2 14:04:43 CET 2010. -------- --- python-transaction/python-transaction.changes 2010-09-14 13:39:06.000000000 +0200 +++ /mounts/work_src_done/STABLE/python-transaction/python-transaction.changes 2010-10-11 12:05:33.000000000 +0200 @@ -1,0 +2,10 @@ +Mon Oct 11 10:00:37 UTC 2010 - coolo@novell.com + +- update to 1.1.1 + * Code in ``_transaction.py`` held on to local references to traceback + objects after calling ``sys.exc_info()`` to get one, causing + potential reference leakages. + * Fixed ``hexlify`` NameError in ``transaction._transaction.oid_repr`` + and add test. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- transaction-1.1.0.tar.bz2 New: ---- transaction-1.1.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-transaction.spec ++++++ --- /var/tmp/diff_new_pack.Wv8f6Z/_old 2010-11-02 14:04:18.000000000 +0100 +++ /var/tmp/diff_new_pack.Wv8f6Z/_new 2010-11-02 14:04:18.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package python-transaction (Version 1.1.0) +# spec file for package python-transaction (Version 1.1.1) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -20,7 +20,7 @@ %define modname transaction Name: python-%{modname} -Version: 1.1.0 +Version: 1.1.1 Release: 1 License: PSF or ZPL Source: %{modname}-%{version}.tar.bz2 ++++++ transaction-1.1.0.tar.bz2 -> transaction-1.1.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/transaction-1.1.0/CHANGES.txt new/transaction-1.1.1/CHANGES.txt --- old/transaction-1.1.0/CHANGES.txt 2010-05-13 00:23:29.000000000 +0200 +++ new/transaction-1.1.1/CHANGES.txt 2010-09-17 03:47:59.000000000 +0200 @@ -1,6 +1,18 @@ Changes ======= +1.1.1 (2010-09-16) +------------------ + +Bug Fixes: + +- Code in ``_transaction.py`` held on to local references to traceback + objects after calling ``sys.exc_info()`` to get one, causing + potential reference leakages. + +- Fixed ``hexlify`` NameError in ``transaction._transaction.oid_repr`` + and add test. + 1.1.0 (1010-05-12) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/transaction-1.1.0/PKG-INFO new/transaction-1.1.1/PKG-INFO --- old/transaction-1.1.0/PKG-INFO 2010-05-13 00:25:02.000000000 +0200 +++ new/transaction-1.1.1/PKG-INFO 2010-09-17 03:52:40.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: transaction -Version: 1.1.0 +Version: 1.1.1 Summary: Transaction management for Python Home-page: http://www.zope.org/Products/ZODB Author: Zope Corporation @@ -23,48 +23,60 @@ Changes ======= + 1.1.1 (2010-09-16) + ------------------ + + Bug Fixes: + + - Code in ``_transaction.py`` held on to local references to traceback + objects after calling ``sys.exc_info()`` to get one, causing + potential reference leakages. + + - Fixed ``hexlify`` NameError in ``transaction._transaction.oid_repr`` + and add test. + 1.1.0 (1010-05-12) ------------------ New Features: - Transaction managers and the transaction module can be used with the - with statement to define transaction boundaries, as in:: + with statement to define transaction boundaries, as in:: - with transaction: - ... do some things ... + with transaction: + ... do some things ... - See transaction/tests/convenience.txt for more details. + See transaction/tests/convenience.txt for more details. - There is a new iterator function that automates dealing with - transient errors (such as ZODB confict errors). For example, in:: + transient errors (such as ZODB confict errors). For example, in:: - for attempt in transaction.attempts(5): - with attempt: - ... do some things .. + for attempt in transaction.attempts(5): + with attempt: + ... do some things .. - If the work being done raises transient errors, the transaction will - be retried up to 5 times. + If the work being done raises transient errors, the transaction will + be retried up to 5 times. - See transaction/tests/convenience.txt for more details. + See transaction/tests/convenience.txt for more details. Bugs fixed: - Fixed a bug that caused extra commit calls to be made on data - managers under certain special circumstances. + managers under certain special circumstances. - https://mail.zope.org/pipermail/zodb-dev/2010-May/013329.html + https://mail.zope.org/pipermail/zodb-dev/2010-May/013329.html - When threads were reused, transaction data could leak accross them, - causing subtle application bugs. + causing subtle application bugs. - https://bugs.launchpad.net/zodb/+bug/239086 + https://bugs.launchpad.net/zodb/+bug/239086 1.0.1 (2010-05-07) ------------------ - LP #142464: remove double newline between log entries: it makes doing - smarter formatting harder. + smarter formatting harder. - Updated tests to remove use of deprecated ``zope.testing.doctest``. @@ -72,7 +84,7 @@ ------------------ - Fix test that incorrectly relied on the order of a list that was generated - from a dict. + from a dict. - Remove crufty DEPENDENCIES.cfg left over from zpkg. @@ -80,15 +92,15 @@ ------------------ = Initial release, branched from ZODB trunk on 2007-11-08 (aka - "3.9.0dev"). + "3.9.0dev"). - Remove (deprecated) support for beforeCommitHook alias to - addBeforeCommitHook. + addBeforeCommitHook. - Add weakset tests. - Remove unit tests that depend on ZODB.tests.utils from - test_transaction (these are actually integration tests). + test_transaction (these are actually integration tests). Platform: any Classifier: Development Status :: 6 - Mature diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/transaction-1.1.0/setup.py new/transaction-1.1.1/setup.py --- old/transaction-1.1.0/setup.py 2010-05-13 00:24:20.000000000 +0200 +++ new/transaction-1.1.1/setup.py 2010-09-17 03:47:24.000000000 +0200 @@ -12,7 +12,7 @@ # ############################################################################## -__version__ = '1.1.0' +__version__ = '1.1.1' import os diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/transaction-1.1.0/transaction/tests/test_transaction.py new/transaction-1.1.1/transaction/tests/test_transaction.py --- old/transaction-1.1.0/transaction/tests/test_transaction.py 2010-05-13 00:23:29.000000000 +0200 +++ new/transaction-1.1.1/transaction/tests/test_transaction.py 2010-09-15 16:48:41.000000000 +0200 @@ -41,10 +41,7 @@ import struct import sys import unittest -import warnings - import transaction -from transaction.tests.warnhook import WarningsHook _ADDRESS_MASK = 256 ** struct.calcsize('P') def positive_id(obj): @@ -245,6 +242,25 @@ ## self.fail("Hosed Application didn't stop commits") +class Test_oid_repr(unittest.TestCase): + def _callFUT(self, oid): + from transaction._transaction import oid_repr + return oid_repr(oid) + + def test_as_nonstring(self): + self.assertEqual(self._callFUT(123), '123') + + def test_as_string_not_8_chars(self): + self.assertEqual(self._callFUT('a'), "'a'") + + def test_as_string_z64(self): + s = '\0'*8 + self.assertEqual(self._callFUT(s), '0x00') + + def test_as_string_all_Fs(self): + s = '\1'*8 + self.assertEqual(self._callFUT(s), '0x0101010101010101') + class DataObject: def __init__(self, transaction_manager, nost=0): @@ -748,6 +764,7 @@ DocFileSuite('doom.txt'), DocTestSuite(), unittest.makeSuite(TransactionTests), + unittest.makeSuite(Test_oid_repr), )) if sys.version_info >= (2, 6): suite.addTest(DocFileSuite('convenience.txt')) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/transaction-1.1.0/transaction/_transaction.py new/transaction-1.1.1/transaction/_transaction.py --- old/transaction-1.1.0/transaction/_transaction.py 2010-05-13 00:23:29.000000000 +0200 +++ new/transaction-1.1.1/transaction/_transaction.py 2010-09-15 16:39:06.000000000 +0200 @@ -97,10 +97,10 @@ as their only argument. """ +import binascii import logging import sys import thread -import warnings import weakref import traceback from cStringIO import StringIO @@ -329,9 +329,15 @@ self._commitResources() self.status = Status.COMMITTED except: - t, v, tb = self._saveAndGetCommitishError() - self._callAfterCommitHooks(status=False) - raise t, v, tb + t = None + v = None + tb = None + try: + t, v, tb = self._saveAndGetCommitishError() + self._callAfterCommitHooks(status=False) + raise t, v, tb + finally: + del t, v, tb else: if self._manager: self._manager.free(self) @@ -343,18 +349,32 @@ self.status = Status.COMMITFAILED # Save the traceback for TransactionFailedError. ft = self._failure_traceback = StringIO() - t, v, tb = sys.exc_info() - # Record how we got into commit(). - traceback.print_stack(sys._getframe(1), None, ft) - # Append the stack entries from here down to the exception. - traceback.print_tb(tb, None, ft) - # Append the exception type and value. - ft.writelines(traceback.format_exception_only(t, v)) - return t, v, tb + t = None + v = None + tb = None + try: + t, v, tb = sys.exc_info() + # Record how we got into commit(). + traceback.print_stack(sys._getframe(1), None, ft) + # Append the stack entries from here down to the exception. + traceback.print_tb(tb, None, ft) + # Append the exception type and value. + ft.writelines(traceback.format_exception_only(t, v)) + return t, v, tb + finally: + del t, v, tb + def _saveAndRaiseCommitishError(self): - t, v, tb = self._saveAndGetCommitishError() - raise t, v, tb + t = None + v = None + tb = None + try: + t, v, tb = self._saveAndGetCommitishError() + raise t, v, tb + finally: + del t, v, tb + def getBeforeCommitHooks(self): return iter(self._before_commit) @@ -442,10 +462,13 @@ # to revert the changes in each of the resource managers. t, v, tb = sys.exc_info() try: - self._cleanup(L) + try: + self._cleanup(L) + finally: + self._synchronizers.map(lambda s: s.afterCompletion(self)) + raise t, v, tb finally: - self._synchronizers.map(lambda s: s.afterCompletion(self)) - raise t, v, tb + del t, v, tb def _cleanup(self, L): # Called when an exception occurs during tpc_vote or tpc_finish. @@ -469,25 +492,32 @@ self._synchronizers.map(lambda s: s.beforeCompletion(self)) - tb = None - for rm in self._resources: - try: - rm.abort(self) - except: - if tb is None: - t, v, tb = sys.exc_info() - self.log.error("Failed to abort resource manager: %s", - rm, exc_info=sys.exc_info()) + try: - if self._manager: - self._manager.free(self) + t = None + v = None + tb = None + + for rm in self._resources: + try: + rm.abort(self) + except: + if tb is None: + t, v, tb = sys.exc_info() + self.log.error("Failed to abort resource manager: %s", + rm, exc_info=sys.exc_info()) - self._synchronizers.map(lambda s: s.afterCompletion(self)) + if self._manager: + self._manager.free(self) - self.log.debug("abort") + self._synchronizers.map(lambda s: s.afterCompletion(self)) - if tb is not None: - raise t, v, tb + self.log.debug("abort") + + if tb is not None: + raise t, v, tb + finally: + del t, v, tb def note(self, text): text = text.strip() @@ -542,19 +572,25 @@ self.manager.tpc_vote(txn) def abort(self, txn): + t = None + v = None tb = None - for o in self.objects: - try: - self.manager.abort(o, txn) - except: - # Capture the first exception and re-raise it after - # aborting all the other objects. - if tb is None: - t, v, tb = sys.exc_info() - txn.log.error("Failed to abort object: %s", - object_hint(o), exc_info=sys.exc_info()) - if tb is not None: - raise t, v, tb + try: + for o in self.objects: + try: + self.manager.abort(o, txn) + except: + # Capture the first exception and re-raise it after + # aborting all the other objects. + if tb is None: + t, v, tb = sys.exc_info() + txn.log.error("Failed to abort object: %s", + object_hint(o), exc_info=sys.exc_info()) + + if tb is not None: + raise t, v, tb + finally: + del t, v, tb def rm_cmp(rm1, rm2): return cmp(rm1.sortKey(), rm2.sortKey()) @@ -576,7 +612,7 @@ def oid_repr(oid): if isinstance(oid, str) and len(oid) == 8: # Convert to hex and strip leading zeroes. - as_hex = hexlify(oid).lstrip('0') + as_hex = binascii.hexlify(oid).lstrip('0') # Ensure two characters per input byte. if len(as_hex) & 1: as_hex = '0' + as_hex diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/transaction-1.1.0/transaction.egg-info/PKG-INFO new/transaction-1.1.1/transaction.egg-info/PKG-INFO --- old/transaction-1.1.0/transaction.egg-info/PKG-INFO 2010-05-13 00:25:02.000000000 +0200 +++ new/transaction-1.1.1/transaction.egg-info/PKG-INFO 2010-09-17 03:52:40.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: transaction -Version: 1.1.0 +Version: 1.1.1 Summary: Transaction management for Python Home-page: http://www.zope.org/Products/ZODB Author: Zope Corporation @@ -23,48 +23,60 @@ Changes ======= + 1.1.1 (2010-09-16) + ------------------ + + Bug Fixes: + + - Code in ``_transaction.py`` held on to local references to traceback + objects after calling ``sys.exc_info()`` to get one, causing + potential reference leakages. + + - Fixed ``hexlify`` NameError in ``transaction._transaction.oid_repr`` + and add test. + 1.1.0 (1010-05-12) ------------------ New Features: - Transaction managers and the transaction module can be used with the - with statement to define transaction boundaries, as in:: + with statement to define transaction boundaries, as in:: - with transaction: - ... do some things ... + with transaction: + ... do some things ... - See transaction/tests/convenience.txt for more details. + See transaction/tests/convenience.txt for more details. - There is a new iterator function that automates dealing with - transient errors (such as ZODB confict errors). For example, in:: + transient errors (such as ZODB confict errors). For example, in:: - for attempt in transaction.attempts(5): - with attempt: - ... do some things .. + for attempt in transaction.attempts(5): + with attempt: + ... do some things .. - If the work being done raises transient errors, the transaction will - be retried up to 5 times. + If the work being done raises transient errors, the transaction will + be retried up to 5 times. - See transaction/tests/convenience.txt for more details. + See transaction/tests/convenience.txt for more details. Bugs fixed: - Fixed a bug that caused extra commit calls to be made on data - managers under certain special circumstances. + managers under certain special circumstances. - https://mail.zope.org/pipermail/zodb-dev/2010-May/013329.html + https://mail.zope.org/pipermail/zodb-dev/2010-May/013329.html - When threads were reused, transaction data could leak accross them, - causing subtle application bugs. + causing subtle application bugs. - https://bugs.launchpad.net/zodb/+bug/239086 + https://bugs.launchpad.net/zodb/+bug/239086 1.0.1 (2010-05-07) ------------------ - LP #142464: remove double newline between log entries: it makes doing - smarter formatting harder. + smarter formatting harder. - Updated tests to remove use of deprecated ``zope.testing.doctest``. @@ -72,7 +84,7 @@ ------------------ - Fix test that incorrectly relied on the order of a list that was generated - from a dict. + from a dict. - Remove crufty DEPENDENCIES.cfg left over from zpkg. @@ -80,15 +92,15 @@ ------------------ = Initial release, branched from ZODB trunk on 2007-11-08 (aka - "3.9.0dev"). + "3.9.0dev"). - Remove (deprecated) support for beforeCommitHook alias to - addBeforeCommitHook. + addBeforeCommitHook. - Add weakset tests. - Remove unit tests that depend on ZODB.tests.utils from - test_transaction (these are actually integration tests). + test_transaction (these are actually integration tests). Platform: any Classifier: Development Status :: 6 - Mature ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org