mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Avoid UnicodeDecodeError when reading nmap output. See #3087
This commit is contained in:
parent
b05b0b04ec
commit
84cf8b5840
1 changed files with 2 additions and 1 deletions
|
|
@ -198,7 +198,8 @@ class NmapCommand(object):
|
|||
# We don't need a file name for stdout output, just a handle. A
|
||||
# TemporaryFile is deleted as soon as it is closed, and in Unix is
|
||||
# unlinked immediately after creation so it's not even visible.
|
||||
f = tempfile.TemporaryFile(mode="r", prefix=APP_NAME + "-stdout-", encoding="utf-8")
|
||||
f = tempfile.TemporaryFile(mode="r", prefix=APP_NAME + "-stdout-", encoding="utf-8",
|
||||
errors='backslashreplace')
|
||||
self.stdout_file = f
|
||||
if stderr is None:
|
||||
stderr = f
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue