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

New flag --save-all-html to record all html content. #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevemac007
Copy link
Contributor

@stevemac007 stevemac007 commented Apr 13, 2020

Add logic to trap all GET and POST calls for debug purposes.

@max-rocket-internet
Copy link

Great idea 👍

@vide
Copy link

vide commented Apr 15, 2020

When trying this branch to debug my own problem related I guess to #179 I get

ERROR:root:write() argument must be str, not bytes
Traceback (most recent call last):
  File "/home/vide/tmp/aws-google-auth/aws_google_auth/__init__.py", line 79, in cli
    process_auth(args, config)
  File "/home/vide/tmp/aws-google-auth/aws_google_auth/__init__.py", line 243, in process_auth
    google_client.do_login()
  File "/home/vide/tmp/aws-google-auth/aws_google_auth/google.py", line 188, in do_login
    sess = self.get(self.login_url)
  File "/home/vide/tmp/aws-google-auth/aws_google_auth/google.py", line 123, in get
    out.write(response.text.encode('utf-8'))
TypeError: write() argument must be str, not bytes

but if I print before on stdout response.text I do see the HTML

@jack1902
Copy link

@vide if you drop .encode('utf-8') from these lines:

out.write(response.text.encode('utf-8'))

and

out.write(response.text.encode('utf-8'))

Does the error persist?

@vide
Copy link

vide commented Apr 23, 2020

@jack1902 yeah removing the encode('utf-8') works, I tried it before reporting but only on L122 and then I didn't see it was complaining about L100. Removing it in both places works as expected, I get the files saved to disk

@jack1902
Copy link

wondering if using the -l/--log level would be better to reduce the number of flags the tool has?

I tend to use --log debug --save-failure-html together when debugging. Wondering what others think?

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.

4 participants