Skip to content

Commit 0cc1b76

Browse files
committed
ore explict error for buggy zarr module
1 parent 102d031 commit 0cc1b76

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

GSASII/imports/G2pwd_MIDAS.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,15 @@ def ContentsValidator(self, filename):
6262
if all([(i in fp) for i in self.midassections]): # are expected MIDAS sections present?
6363
self.mode = 'midas'
6464
return True # must be present for Midas output
65-
except:
65+
except FileNotFoundError as msg:
66+
self.errors = f'Exception from zarr module (version={zarr.__version__}):'
67+
self.errors += '\n\t' + str(msg)
68+
if os.path.exists(filename) and zarr.__version__.startswith('3.0'):
69+
self.errors +='\n\n*** this is likely due to a buggy version of the zarr module'
70+
self.errors +='\n*** please use "conda install zarr=2.18" to fix this'
71+
except Exception as msg:
72+
self.errors = f'Exception from zarr module (version={zarr.__version__}):'
73+
self.errors += '\n\t' + str(msg)
6674
return False
6775
finally:
6876
del fp

0 commit comments

Comments
 (0)