New submission from Yury Selivanov <yseliva...@gmail.com>: WeakSet has a bug in its '__len__' method, where it performs iteration though 'self.data' without ensuring _IterationGuard.
This leads to some hard to catch errors with the following traceback: builtins.RuntimeError: Set changed size during iteration File /usr/lib64/python3.2/_weakrefset.py, line 66, in __len__ return sum(x() is not None for x in self.data) File /usr/lib64/python3.2/_weakrefset.py, line 66, in <genexpr> return sum(x() is not None for x in self.data) ---------- components: Library (Lib) files: weakset_len.patch keywords: patch messages: 154636 nosy: Yury.Selivanov, pitrou, rhettinger priority: normal severity: normal status: open title: __len__ method of weakset type: crash versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24681/weakset_len.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14159> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com