From 4708e507ab1ebdb1476680ce75ea77f2cc9f822c Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Fri, 31 Jan 2025 12:37:17 +0000 Subject: [PATCH] MNT: Accept pathlib.Path, normalise to string for image cache keys. All other eval routines should already be compatible --- pyfeeds/imagecache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfeeds/imagecache.py b/pyfeeds/imagecache.py index aefca31..c101fc0 100644 --- a/pyfeeds/imagecache.py +++ b/pyfeeds/imagecache.py @@ -77,7 +77,7 @@ class ImageCache: returned value will be ``None``. """ - imagefile = op.realpath(op.abspath(imagefile)) + imagefile = str(op.realpath(op.abspath(imagefile))) image = self.__images.get(imagefile, None) if image is not None: @@ -108,7 +108,7 @@ class ImageCache: # it in this way because all keys # passed to __getitem__ get # transformed in the same way. - imagefile = op.realpath(op.abspath(imagefile)) + imagefile = str(op.realpath(op.abspath(imagefile))) imagesize = size(image) self.__images[ imagefile] = image, data self.__imagesizes[imagefile] = imagesize -- GitLab