Skip to content

Commit cf9a7a3

Browse files
Encode urls (#3)
1 parent 0cf7e77 commit cf9a7a3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/scripts/generate_index.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import os
22
import sys
33
import re
4-
from pathlib import Path
5-
from github import Github
6-
from typing import List, Dict
74
import itertools
85
import requests
96
import hashlib
107

8+
from urllib.parse import quote
9+
from pathlib import Path
10+
from github import Github
11+
from typing import List, Dict
12+
1113
HTML_TEMPLATE = """<!DOCTYPE html>
1214
<html>
1315
<head>
@@ -94,7 +96,7 @@ def generate_index_html(self):
9496
f.write(chunk)
9597

9698
sha256_hash = calculate_sha256(package_dir / filename)
97-
file_links.append(f'<a href="{filename}#sha256={sha256_hash}">{filename}</a><br/>')
99+
file_links.append(f'<a href="{quote(filename)}#sha256={sha256_hash}">{filename}</a><br/>')
98100

99101
package_index = HTML_TEMPLATE.format(
100102
package_name=f"Links for {package}",

0 commit comments

Comments
 (0)