cdown/srt

Python2 incompatibility in srt-linear-timeshift

mguillau opened this issue · 1 comments

When running the code on an SRT file I was trying to fix, I encountered an incorrect output. I tracked the problem down to this line:

angular = (to_end - to_start) / (from_end - from_start)

Which, on my system with python2.7, invoked integer division instead of float division as it should be. I would suggest to either (i) add a multiplication to 1.0 somewhere to force the cast to float, or (ii) add "from future import division" at the start of the file so as to ensure PEP-238 behavior.

cdown commented

Thanks for the report, I'll put out a fix now. You're probably aware that Python 2 is becoming EOL soon, though :-)