Use shutil to support tmp on a separate filesystem

This commit is contained in:
Jay Kamat 2018-05-17 14:08:10 -07:00
parent d3c3beff94
commit 433f1fa863
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5
2 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,7 @@
# * Imports
import os
import shutil
import subprocess
import sys
import multiprocessing
@ -130,7 +131,7 @@ def save_screenshot(css):
# Compress with pngcrush
_, tempfile_path = mkstemp(suffix=".png")
subprocess.check_output(["pngcrush", screenshot_path, tempfile_path], stderr=subprocess.DEVNULL)
os.replace(tempfile_path, screenshot_path)
shutil.move(tempfile_path, screenshot_path)
print(screenshot_path)

1
sites/mediawiki.org.url Normal file
View File

@ -0,0 +1 @@
https://en.wikipedia.org/wiki/Tar_(computing)