Skip to content

Commit 06d0134

Browse files
authored
Fix invalid escape sequence in regex (#365)
* Fix invalid escape sequence in regex Updated the regex in pandoc_download.py to correctly escape the period character. This change resolves the SyntaxWarning triggered by an invalid escape sequence and ensures compatibility with future Python versions. * Correct regex to ensure proper URL matching Adjusted the regex to fix URL matching issues identified during CI tests, ensuring effective Pandoc downloads.
1 parent 7b65192 commit 06d0134

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pypandoc/pandoc_download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _get_pandoc_urls(version="latest"):
5858
# regex for the binaries
5959
uname = platform.uname()[4]
6060
processor_architecture = "arm" if uname.startswith("arm") or uname.startswith("aarch") else "amd"
61-
regex = re.compile(r"/jgm/pandoc/releases/download/.*(?:"+processor_architecture+r"|x86|mac).*\.(?:msi|deb|pkg)")
61+
regex = re.compile(r"/jgm/pandoc/releases/download/.*(?:"+processor_architecture+"|x86|mac).*\\.(?:msi|deb|pkg)")
6262
# a list of urls to the binaries
6363
pandoc_urls_list = regex.findall(content.decode("utf-8"))
6464
# actual pandoc version

0 commit comments

Comments
 (0)