From 3f35377f42d25fad5ffb2b4c541035b24d3a88c8 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 8 Dec 2013 21:11:02 -0800 Subject: [PATCH] gallery.py: Python-3-compatible integer division MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Avoid: Traceback (most recent call last): … File "/.../gallery.py", line 610, in page self._page(path=file_path, stream=stream) File "/.../gallery.py", line 719, in _page gallery_page = '{}/?pp={:d}'.format(gallery, page + 1) ValueError: Unknown format code 'd' for object of type 'float' --- posts/gallery/gallery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/gallery/gallery.py b/posts/gallery/gallery.py index c938c8a..5799641 100755 --- a/posts/gallery/gallery.py +++ b/posts/gallery/gallery.py @@ -691,7 +691,7 @@ class CGIGalleryServer (object): images = list(self._images(gallery)) images_per_page = self._rows * self._columns i = images.index(path) - page = i / images_per_page + page = i // images_per_page gallery_page = '{}/?pp={:d}'.format(gallery, page + 1) prev_page = self._image_page(images[i - 1]) next_page = self._image_page(images[(i + 1) % len(images)]) -- 2.26.2