cedadev/cf-checker

strange error messages

Closed this issue · 2 comments

strange errors

Thanks for making the checker.
I have used it several times in the past, but a couple of attempts today gave me strange errors.
At face-value it looks like a system problem at your end - but I am very happy to be told my files are the trouble.

Two examples of what I see copied below.

Errors eg 1

File name:      test.nc

Output of CF-Checker follows...

CHECKING NetCDF FILE: /tmp/948.nc
=====================
Traceback (most recent call last):
  File "/home/ros/anaconda2/bin/cfchecks", line 10, in 
    sys.exit(main())
  File "/home/ros/anaconda2/lib/python2.7/site-packages/cfchecker/cfchecks.py", line 3021, in main
    inst.checker(file)
  File "/home/ros/anaconda2/lib/python2.7/site-packages/cfchecker/cfchecks.py", line 448, in checker
    cacheDir=self.cacheDir)
  File "/home/ros/anaconda2/lib/python2.7/site-packages/cfchecker/cfchecks.py", line 168, in __init__
    self.dict = shelve.open( self.shFile )
  File "/home/ros/anaconda2/lib/python2.7/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/home/ros/anaconda2/lib/python2.7/shelve.py", line 227, in __init__
    Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
  File "/home/ros/anaconda2/lib/python2.7/anydbm.py", line 85, in open
    return mod.open(file, flag, mode)
  File "/home/ros/anaconda2/lib/python2.7/dumbdbm.py", line 253, in open
    return _Database(file, mode, flag)
  File "/home/ros/anaconda2/lib/python2.7/dumbdbm.py", line 77, in __init__
    self._update()
  File "/home/ros/anaconda2/lib/python2.7/dumbdbm.py", line 91, in _update
    key, pos_and_siz_pair = _ast.literal_eval(line)
  File "/home/ros/anaconda2/lib/python2.7/ast.py", line 49, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/home/ros/anaconda2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "", line 1
    'integral_of_surface_downwelling_lon
                                       ^
SyntaxError: EOL while scanning string literal

Errors eg 2

Output of CF-Checker follows...

CHECKING NetCDF FILE: /tmp/948.nc
=====================
WARN: Cannot determine CF version from the Conventions attribute; checking against latest CF version: CF-1.7
Traceback (most recent call last):
  File "/home/ros/anaconda2/bin/cfchecks", line 10, in 
    sys.exit(main())
  File "/home/ros/anaconda2/lib/python2.7/site-packages/cfchecker/cfchecks.py", line 3021, in main
    inst.checker(file)
  File "/home/ros/anaconda2/lib/python2.7/site-packages/cfchecker/cfchecks.py", line 448, in checker
    cacheDir=self.cacheDir)
  File "/home/ros/anaconda2/lib/python2.7/site-packages/cfchecker/cfchecks.py", line 168, in __init__
    self.dict = shelve.open( self.shFile )
  File "/home/ros/anaconda2/lib/python2.7/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/home/ros/anaconda2/lib/python2.7/shelve.py", line 227, in __init__
    Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
  File "/home/ros/anaconda2/lib/python2.7/anydbm.py", line 85, in open
    return mod.open(file, flag, mode)
  File "/home/ros/anaconda2/lib/python2.7/dumbdbm.py", line 253, in open
    return _Database(file, mode, flag)
  File "/home/ros/anaconda2/lib/python2.7/dumbdbm.py", line 77, in __init__
    self._update()
  File "/home/ros/anaconda2/lib/python2.7/dumbdbm.py", line 91, in _update
    key, pos_and_siz_pair = _ast.literal_eval(line)
  File "/home/ros/anaconda2/lib/python2.7/ast.py", line 49, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/home/ros/anaconda2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "", line 1
    'integral_of_surface_downwelling_lon
                                       ^
SyntaxError: EOL while scanning string literal

@andreustaylor: Thanks for reporting this. I've removed the dodgey standard-name cache file. Not sure what happened. It's working again for me now.

Cheers,
Ros.

Fixed for me too.

Thanks