From 06de76aede1197e6b1366b840ddbd19a8a759254 Mon Sep 17 00:00:00 2001 From: Maksim Novikov Date: Mon, 23 Dec 2019 14:54:57 +0100 Subject: [PATCH] Fixes NameError exception while guessing file type Reproducible by opening n5 directory without n5 extension and if quilted is not installed ERROR 2019-12-23 14:51:40,501 log_exception 19155 140465532311360 Traceback (most recent call last): File "ilastik-project/ilastik/ilastik/applets/dataSelection/dataSelectionGui.py", line 408, in addFileNames new_infos = self._createDatasetInfos(roleIndex, paths) File "ilastik-project/ilastik/ilastik/applets/dataSelection/dataSelectionGui.py", line 529, in _createDatasetInfos info = self._createDatasetInfo(roleIndex, filePath, roi) File "ilastik-project/ilastik/ilastik/applets/dataSelection/dataSelectionGui.py", line 578, in _createDatasetInfo subvolume_roi=roi, File "ilastik-project/ilastik/ilastik/applets/dataSelection/opDataSelection.py", line 538, in create_or_fallback_to_absolute return cls(*args, **kwargs) File "ilastik-project/ilastik/ilastik/applets/dataSelection/opDataSelection.py", line 531, in __init__ super().__init__(**fs_info_kwargs) File "ilastik-project/ilastik/ilastik/applets/dataSelection/opDataSelection.py", line 439, in __init__ graph=Graph(), WorkingDirectory=self.base_dir, FilePath=self.filePath, SequenceAxis=self.sequence_axis File "ilastik-project/lazyflow/lazyflow/operator.py", line 141, in __call__ instance._after_init() File "ilastik-project/lazyflow/lazyflow/operator.py", line 304, in _after_init self._setupOutputs() File "ilastik-project/lazyflow/lazyflow/operator.py", line 498, in _setupOutputs self.setupOutputs() File "ilastik-project/lazyflow/lazyflow/operators/ioOperators/opInputDataReader.py", line 214, in setupOutputs self.internalOperators, self.internalOutput = openFunc(filePath) File "ilastik-project/lazyflow/lazyflow/operators/ioOperators/opInputDataReader.py", line 478, in _attemptOpenAsH5BlockStore op = OpH5BlockStoreReader(parent=self) NameError: name 'OpH5BlockStoreReader' is not defined --- lazyflow/operators/ioOperators/opInputDataReader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lazyflow/operators/ioOperators/opInputDataReader.py b/lazyflow/operators/ioOperators/opInputDataReader.py index 39d12cdc3..8ea9b35a0 100644 --- a/lazyflow/operators/ioOperators/opInputDataReader.py +++ b/lazyflow/operators/ioOperators/opInputDataReader.py @@ -470,7 +470,7 @@ def _attemptOpenAsRawBinary(self, filePath): raise OpInputDataReader.DatasetReadError(*e.args) from e def _attemptOpenAsH5BlockStore(self, filePath): - if not os.path.splitext(filePath)[1] == ".json": + if not (_supports_h5blockreader and os.path.splitext(filePath)[1] == ".json"): return ([], None) op = OpH5BlockStoreReader(parent=self)