Moving binary to textual file openings

This commit is contained in:
Miroslav Stampar
2026-01-18 00:05:05 +01:00
parent e62e8c6cea
commit d9102e03c6
10 changed files with 28 additions and 27 deletions

View File

@@ -254,7 +254,7 @@ def storeResultsToFile(results):
infoMsg = "writing crawling results to a temporary file '%s' " % filename
logger.info(infoMsg)
with openFile(filename, "w+b") as f:
with openFile(filename, "w+") as f:
if conf.forms:
f.write("URL,POST\n")

View File

@@ -50,7 +50,7 @@ def purge(directory):
for filepath in filepaths:
try:
filesize = os.path.getsize(filepath)
with openFile(filepath, "w+b") as f:
with openFile(filepath, "w+") as f:
f.write("".join(_unichr(random.randint(0, 255)) for _ in xrange(filesize)))
except:
pass