fireantology / django-logtailer

Allows the viewing of any log file entries in real time directly from the Django admin interface. It allows you to filter on logs with regex and offer also a log clipboard for save desired log lines to the django db.
BSD 3-Clause "New" or "Revised" License
97 stars 30 forks source link

made compatible with python 3.6 #7

Closed cpankajr closed 4 years ago

cpankajr commented 5 years ago

-- " f.seek(block*buffer_size, 2)" was giving error "io.UnsupportedOperation: can't do nonzero end-relative seeks" in python 3.6 -- Error was most probably because of from documentation of python 3.6 (readthedocs) (official documention)

In text files (those opened without a "b" in the mode string), only seeks relative to the beginning of the file are allowed (the exception being seeking to the very file end with seek(0, 2)). In text files (those opened without a "b" in the mode string), only seeks relative to the beginning of the file [os.SEEK_SET] are allowed...

However, Adding the "b" flag when you are reading or writing text can have unintended consequences, therefore I avoided that. I made the appropriate changes in views.py file to make it work in pythn3.6

cpankajr commented 5 years ago

@fireantology ETA on this?