Skip to content

Problem with shift and to_time() #99

@axel584

Description

@axel584

When I use the shift method, the result can become a float and I've got an error when i use to_time() after :

st_gr = pysrt.open(file) st_gr.shift(1.0) for st in st_gr: print(type(st.start.seconds),type(st.start.milliseconds)) print(st.start.to_time())

File "/home/axel/Documents/code/LWM/v2_lwm.py", line 93, in detecte_bug print(st.start.to_time()) ^^^^^^^^^^^^^^^^^^ File "/home/axel/Documents/code/LWM/lwm-env/lib/python3.12/site-packages/pysrt/srttime.py", line 176, in to_time return time(self.hours, self.minutes, self.seconds, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'float' object cannot be interpreted as an integer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions