process_file returns error message if any, and it's printed in main
new generic exception: SubstException. ParserException inherits now from it
instead of returns errors and other data, use exceptions
single catch for two exceptions types
outsource some part of process_file into _process_file__(handle|regular)

there is also fix - if replacement was shorter ther pattern, finally
file was corrupted.
added docstrings to _process_file__(handle|regular)
pylint: disable warning about catching all exceptions