You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Version: 7.95
Traceback (most recent call last):
File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.11\site-packages\zenmapGUI\MainWindow.py", line 629, in _save_scan_results_cb
self._save(self.scan_interface, filename, selected, format)
File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.11\site-packages\zenmapGUI\MainWindow.py", line 711, in _save
scan_interface.inventory.save_to_file(
File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.11\site-packages\zenmapCore\NetworkInventory.py", line 291, in save_to_file
self.get_scans()[index].write_xml(f)
File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.11\site-packages\zenmapCore\NmapParser.py", line 1020, in write_xml
self._write_hosts(writer)
File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.11\site-packages\zenmapCore\NmapParser.py", line 1101, in _write_hosts
writer.startElement("address",
File "../lib/python3.11/xml/sax/saxutils.py", line 170, in startElement
File "../lib/python3.11/encodings/cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 37-38: character maps to
To Reproduce
Steps to reproduce the behavior, including window titles and command-line options.
Expected behavior
A clear and concise description of what you expected to happen.
Version info (please complete the following information):
OS: [e.g. Linux 4.15, Windows 10 1909]
Zenmap version from Help -> About
Output of nmap --version:
Additional context
Add any other context about the problem here, such as special network type.
The text was updated successfully, but these errors were encountered:
Thanks @Avi8962 . We've received similar-sounding reports for Nmap 7.94 as well, such as this one. Interestingly both your report and that one are using cp1252, Window's Latin code page. It is probably related to our Python3 upgrade as that introduced dramatic Unicode changes. We should be saving in UTF-8. We'll investigate further. Thanks again!
Update: @dmiller-nmap has done an initial investigation and found that xml.sax.saxutils.XMLGenerator defaults to 'iso-8859-1' encoding. He is changing that to 'utf-8', which we hope will fix the problem.
fyodor
changed the title
found error during saving the result
Zenmap UnicodeEncodeError crash while saving scans
Apr 25, 2024
Describe the bug
Version: 7.95
Traceback (most recent call last):
File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.11\site-packages\zenmapGUI\MainWindow.py", line 629, in _save_scan_results_cb
self._save(self.scan_interface, filename, selected, format)
File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.11\site-packages\zenmapGUI\MainWindow.py", line 711, in _save
scan_interface.inventory.save_to_file(
File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.11\site-packages\zenmapCore\NetworkInventory.py", line 291, in save_to_file
self.get_scans()[index].write_xml(f)
File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.11\site-packages\zenmapCore\NmapParser.py", line 1020, in write_xml
self._write_hosts(writer)
File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.11\site-packages\zenmapCore\NmapParser.py", line 1101, in _write_hosts
writer.startElement("address",
File "../lib/python3.11/xml/sax/saxutils.py", line 170, in startElement
File "../lib/python3.11/encodings/cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 37-38: character maps to
To Reproduce
Steps to reproduce the behavior, including window titles and command-line options.
Expected behavior
A clear and concise description of what you expected to happen.
Version info (please complete the following information):
Help
->About
nmap --version
:Additional context
Add any other context about the problem here, such as special network type.
The text was updated successfully, but these errors were encountered: