From 7111c16ae6a81b7d152cb79dafec647f6c259bdd Mon Sep 17 00:00:00 2001 From: Jessica Tegner Date: Wed, 21 Aug 2024 09:11:52 +0200 Subject: [PATCH] Use a raw F string for regex in pandoc downloader (#371) * Updated regex to hopefully not provide a regex syntax error on python 3.12 * We are now using a raw F string for the regex --- pypandoc/pandoc_download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypandoc/pandoc_download.py b/pypandoc/pandoc_download.py index 9fbd026..3a7da71 100644 --- a/pypandoc/pandoc_download.py +++ b/pypandoc/pandoc_download.py @@ -58,7 +58,7 @@ def _get_pandoc_urls(version="latest"): # regex for the binaries uname = platform.uname()[4] processor_architecture = "arm" if uname.startswith("arm") or uname.startswith("aarch") else "amd" - regex = re.compile(r"/jgm/pandoc/releases/download/.*(?:"+processor_architecture+"|x86|mac).*\\.(?:msi|deb|pkg)") + regex = re.compile(fr"/jgm/pandoc/releases/download/.*(?:{processor_architecture}|x86|mac).*\.(?:msi|deb|pkg)") # a list of urls to the binaries pandoc_urls_list = regex.findall(content.decode("utf-8")) # actual pandoc version