-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add STDERR argument, and write docs for args module #760
Conversation
995ca5c
to
d08ea6b
Compare
@@ -663,8 +663,6 @@ def install_default_handler(): | |||
the ``pwnlib`` root logger. This function is automatically called from when | |||
importing :mod:`pwn`. | |||
''' | |||
console.stream = sys.stdout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that this is superfluous, since we instantiate console
with sys.stdout
as its stream
just a few lines above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not actually superfluous, it causes tests to fail. Wat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this was accidentally keeping our unit-tests from breaking by re-invoking install_default_handler()
for each module's doctests. The root-cause is pwnlib.commandline.common
was setting it to stderr
, which should only happen when main()
is invoked, not when the module is imported.
The tests are breaking because the command-line programs are generating doctests, which change the log to stderr. |
8862468
to
d119e34
Compare
cbc2161
to
4059879
Compare
CI passes, I'm choosing to ignore the Codacy issue since I'm not sure how to resolve it (you can't have properties on classmethod). |
This should make it so that anybody can choose where the logs go without needing to set it every time.
Fixes #759