Merge pull request #222557 from alyssais/nixos-test-driver-screenshot-charset

nixos/test-driver: accept non-\w* filenames
This commit is contained in:
Jacek Galowicz 2023-03-23 07:45:01 +01:00 committed by GitHub
commit 09ad6a7235
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -737,9 +737,10 @@ class Machine:
self.connected = True
def screenshot(self, filename: str) -> None:
word_pattern = re.compile(r"^\w+$")
if word_pattern.match(filename):
filename = os.path.join(self.out_dir, f"{filename}.png")
if "." not in filename:
filename += ".png"
if "/" not in filename:
filename = os.path.join(self.out_dir, filename)
tmp = f"{filename}.ppm"
with self.nested(