Skip to content
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

Open stdout and stderr as text streams #68

Merged
merged 1 commit into from
Feb 28, 2016

Conversation

rcarrillo
Copy link
Contributor

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 #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(). #58
doesn't solve this issue.

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()
savon-noir added a commit that referenced this pull request Feb 28, 2016
Open stdout and stderr as text streams
@savon-noir savon-noir merged commit ba1a068 into savon-noir:master Feb 28, 2016
@savon-noir
Copy link
Owner

Thanks a lot for checking this out. Lots of ppl were asking for a fix for this issue but nobody wanted to issue a fix :)

Thanks again.

@rcarrillo
Copy link
Contributor Author

No problem. Such a neat library didn't deserve that issue :)

I'll be waiting for the next repackage on pypi

@savon-noir
Copy link
Owner

pypi updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NmapProcess.run() deadlock with nmap 6.47
2 participants