diff --git a/pyglance/glance/io.py b/pyglance/glance/io.py index 40d7c139d616bc7ba3800bb2f5d2e001f22c623b..b2aa372d28a6305664e963d2ca0b80d54b335dbe 100644 --- a/pyglance/glance/io.py +++ b/pyglance/glance/io.py @@ -1355,6 +1355,13 @@ class jpss_adl(object): def open(pathname, allowWrite=False): suffix = os.path.splitext(pathname)[1][1:].lower() + + # Just test we can open the file so we automatically raise a suitable + # error if we can't access it. + from __builtin__ import open + with open(pathname): + pass + if (not suffix) or (suffix not in globals()): # this ican be used to specify a format on the command line by setting the # environment variable FORMAT, for example: