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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user