diff --git a/nmrglue/fileio/bruker.py b/nmrglue/fileio/bruker.py index 737d5435..d6df6c69 100644 --- a/nmrglue/fileio/bruker.py +++ b/nmrglue/fileio/bruker.py @@ -2161,7 +2161,12 @@ def read_jcamp(filename, encoding=locale.getpreferredencoding()): with io.open(filename, 'r', encoding=encoding) as f: while True: # loop until end of file is found - line = f.readline().rstrip() # read a line + try: + line = f.readline().rstrip() # read a line + except Exception as e: + warn("Unable read line, leave it as a comment") + line = "$$" + if line == '': # end of file found break