1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Ensure UTF-8 encoding used throughout zenmap

This commit is contained in:
dmiller
2024-04-26 17:25:40 +00:00
parent 480803e24a
commit c840e236cb
12 changed files with 48 additions and 36 deletions

View File

@@ -286,7 +286,7 @@ class NetworkInventory(object):
"""Saves the scan with the given list index into a file with a given
path. With format = "xml", saves Nmap XML; otherwise saves plain text
output."""
f = open(path, 'w')
f = open(path, 'wb')
if format == "xml":
self.get_scans()[index].write_xml(f)
self.filenames[self.get_scans()[index]] = f
@@ -352,7 +352,7 @@ class NetworkInventory(object):
self._generate_filenames(path)
for scan, filename in self.filenames.items():
f = open(os.path.join(path, filename), "w")
f = open(os.path.join(path, filename), "wb")
scan.write_xml(f)
f.close()