Skip to content

Switch to floor division in pager.py - #1466

Merged
rcrdnalor merged 1 commit into
MythTV:masterfrom
SteveErl:erlMerge43
Sep 21, 2026
Merged

rcrdnalor merged 1 commit into
MythTV:masterfrom
SteveErl:erlMerge43

Conversation

@SteveErl

Copy link
Copy Markdown
Contributor

Implementing Tom Peterson's suggested fix for a crash caused by the default division behavior of Python 3. With a single slash '/', Python 3 gives a floating point result. Python 2 used to provide an integer result. In pager.py, division is used to calculate a page offset, which needs to be an integer value. To enforce this under Python 3, the code has been updated to use "floor division" by using two slashes '//'. This provides an integer result which will prevent a crash.

Resolves #1426

Checklist

Implementing Tom Peterson's suggested fix for
a crash caused by the default division behavior of
Python 3. With a single slash '/', Python 3 gives
a floating point result. Python 2 used to provide
an integer result. In pager.py, division is used
to calculate a page offset, which needs to be
an integer value. To enforce this under Python 3,
the code has been updated to use "floor division"
by using two slashes '//'. This provides an
integer result which will prevent a crash.

Resolves MythTV#1426
@rcrdnalor
rcrdnalor merged commit 8c7031b into MythTV:master Sep 21, 2026
11 checks passed
@SteveErl
SteveErl deleted the erlMerge43 branch September 21, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tmdb3.py -M crashes with TypeError: list indices must be integers or slices, not float for searches with paginated results

2 participants