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

Parameter to specify encoding error response #178

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ege-del
Copy link

@ege-del ege-del commented Mar 7, 2021

added parameter to utilize 'encode' method's 'errors' parameter e.g.;
string.encode(encoding='utf-8', errors='ignore')

usage
python photon.py --encoding-error "ignore" -u ...

Tested on

os: Ubuntu 20.04.2 LTS
python: 3.7

@@ -36,4 +36,4 @@ def mirror(url, response):
if len(url.split('?')) > 1:
trail += '?' + url.split('?')[1]
with open(path + name + trail, 'w+') as out_file:
out_file.write(response.encode('utf-8'))
out_file.write(response.encode('utf-8',errors=encoding_error_response))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ege-del, can we use errors = ignore here.

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.

None yet

2 participants