Commit cadfa06
committed
Open stdout and stderr as text streams
Nmap stdout and sterr is being used as str. This opens the streams
as text, so read()/readline() returns a str instead of a byte, avoiding
the need to manually decode from str to byte on each read().
This fixes savon-noir#63 which is an endless loop
caused by enumerate() waiting for a '' as sentinel but receiving a b''.
Also, NmapProcess.__process_event() expects stderr as str, using a byte
breaks it, which in turn breaks NmapProcess.run_background() and
NmapProcess.sudo_run_background()1 parent 00ccad5 commit cadfa06
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
| |||
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | | - | |
| 272 | + | |
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
276 | | - | |
| 277 | + | |
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
| |||
0 commit comments