From f15f5fd81a394846e1b5b5d38ccb64fbd780eaec Mon Sep 17 00:00:00 2001 From: flymarq Date: Wed, 17 Jun 2026 14:45:30 +0200 Subject: [PATCH] Use os specific directory separator This script works only on windows OS, because it uses hard coded backslahes as directory separator. The fix replaces the backshalsh with the python variable `os.sep`. Now it should run on all OS without exceptions. --- code/mbtiles2compactcache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/mbtiles2compactcache.py b/code/mbtiles2compactcache.py index e2698ca..ef60448 100644 --- a/code/mbtiles2compactcache.py +++ b/code/mbtiles2compactcache.py @@ -74,7 +74,7 @@ def __init__(self, file_name): self.fd = None regex = r"L(..)" self.level = re.findall(regex, self.file_name)[0] - fname = self.file_name.split('.bundle')[0].split('\\')[-1] + fname = self.file_name.split('.bundle')[0].split(os.sep)[-1] s_val = fname[1:].split('C') self.row_offset = int(s_val[0], 16) self.col_offset = int(s_val[1], 16)