adding in Refefer's changes from https://github.com/kasun/python-tail/pull/2