New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zenmap UnicodeEncodeError crash while saving scans #2820
Comments
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. |
We should make sure our fix also addresses the similar #2842 . |
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: