-
Notifications
You must be signed in to change notification settings - Fork 178
Closed
Description
LogFileParser expects its inputfile to support last_line, but this is only exposed by the custom FileWrapper class which is not used for all input types.
For a concrete example, any files parsed with --multi (which is common for Turbomole etc) are not wrapped, and LogFileParser will crash if a parsing error occurs.
Attempting to read ./basis and water.log
[Turbomole ['./basis', 'water.log'] ERROR] Encountered error when parsing.
Traceback (most recent call last):
File "/home/oliver/dev/cclib/cclib Src/cclib/parser/logfileparser.py", line 337, in parse
self.extract(inputfile, line)
File "/home/oliver/dev/cclib/cclib Src/cclib/parser/turbomoleparser.py", line 795, in extract
self.iter_one_elec_energy.append(utils.float(info[2]))
File "/home/oliver/dev/cclib/cclib Src/cclib/parser/utils.py", line 77, in float
return _BUILTIN_FLOAT(number.replace("D", "E"))
ValueError: could not convert string to float: 's'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/oliver/.local/bin/ccget", line 8, in <module>
sys.exit(ccget())
File "/home/oliver/dev/cclib/cclib Src/cclib/scripts/ccget.py", line 178, in ccget
data = ccread(filename, **kwargs)
File "/home/oliver/dev/cclib/cclib Src/cclib/io/ccio.py", line 174, in ccread
return log.parse()
File "/home/oliver/dev/cclib/cclib Src/cclib/parser/logfileparser.py", line 343, in parse
self.logger.error(f"Last line read: {inputfile.last_line}")
AttributeError: 'FileInput' object has no attribute 'last_line'
Reactions are currently unavailable