Skip to content

Commit c37e677

Browse files
committed
Ensure correct mode and groupe.
1 parent dc35d4f commit c37e677

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

build_docs.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def build_robots_txt(www_root: Path, group, skip_cache_invalidation):
513513
requests.request("PURGE", "https://docs.python.org/robots.txt")
514514

515515

516-
def build_sitemap(www_root: Path):
516+
def build_sitemap(www_root: Path, group):
517517
"""Build a sitemap with all live versions and translations."""
518518
if not www_root.exists():
519519
logging.info("Skipping sitemap generation (www root does not even exists).")
@@ -524,14 +524,19 @@ def build_sitemap(www_root: Path):
524524
sitemap_file.write(
525525
template.render(languages=LANGUAGES, versions=VERSIONS) + "\n"
526526
)
527+
sitemap_file.chmod(0o775)
528+
run(["chgrp", group, sitemap_file])
527529

528530

529-
def build_404(www_root: Path):
531+
def build_404(www_root: Path, group):
530532
"""Build a nice 404 error page to display in case PDFs are not built yet."""
531533
if not www_root.exists():
532534
logging.info("Skipping 404 page generation (www root does not even exists).")
533535
return
534-
shutil.copyfile(HERE / "templates" / "404.html", www_root / "404.html")
536+
not_found_file = www_root / "404.html"
537+
shutil.copyfile(HERE / "templates" / "404.html", not_found_file)
538+
not_found_file.chmod(0o775)
539+
run(["chgrp", group, not_found_file])
535540

536541

537542
def head(text, lines=10):

0 commit comments

Comments
 (0)