diff --git a/app.py b/app.py index c77279f..1578d8c 100644 --- a/app.py +++ b/app.py @@ -183,7 +183,7 @@ def ship(request,ship=None): author = f.readline().strip() yield f"=> /{urlencoded}/AUTHOR © {year} {author}\n" else: - username = (subprocess.run(["/usr/bin/stat","-c","%U",os.path.join("/var/gopher",ship_unquoted)],stdout=subprocess.PIPE).stdout or b"unknown").decode("utf-8").strip() + username = (Path("/var/gopher") / ship_unquoted).owner() yield f"© {year} {username}\n" license_file = os.path.join("/var/gopher",ship_unquoted,"LICENSE") if os.path.exists(license_file):