Skip to content

Commit

Permalink
Fix invalid escape sequence in regex (#365)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
syusuke9999 authored Jun 4, 2024
1 parent 7b65192 commit 06d0134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pypandoc/pandoc_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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+r"|x86|mac).*\.(?:msi|deb|pkg)")
regex = re.compile(r"/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
Expand Down

0 comments on commit 06d0134

Please sign in to comment.