Package: python-apptools / 4.5.0-1.1

fix-stopiteration-exception.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 3734289d1a0ebd8513fa67f75288add31ed0113c Mon Sep 17 00:00:00 2001
From: Mark Dickinson <mdickinson@enthought.com>
Date: Thu, 2 Jan 2020 10:55:54 +0000
Subject: [PATCH] Work around broken _v_groups.itervalues() in PyTables (#117)

---
 apptools/io/h5/file.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/apptools/io/h5/file.py b/apptools/io/h5/file.py
index 7dce5408..7718ba08 100644
--- a/apptools/io/h5/file.py
+++ b/apptools/io/h5/file.py
@@ -431,7 +431,12 @@ def subgroup_names(self):
 
     def iter_groups(self):
         """ Iterate over `H5Group` nodes that are children of this group. """
-        return (_wrap_node(g) for g in self._h5_group._v_groups.itervalues())
+        groups = self._h5_group._v_groups
+
+        # not using the groups.values() method here, because groups is a
+        # `proxydict` object whose .values() method is non-lazy. Related:
+        # PyTables/PyTables#784.
+        return (_wrap_node(groups[group_name]) for group_name in groups)
 
     @h5_group_wrapper(H5File.create_group)
     def create_group(self, group_subpath, delete_existing=False, **kwargs):