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

UnicodeEncodeError: 'latin-1' codec can't encode character #47

Open
sausagenoods opened this issue Dec 9, 2022 · 0 comments
Open

UnicodeEncodeError: 'latin-1' codec can't encode character #47

sausagenoods opened this issue Dec 9, 2022 · 0 comments

Comments

@sausagenoods
Copy link

This happens after running dump new and looks like it has to do with cookies or response body containing non unicode characters. So somehow setting UTF-8 encoding might solve the issue. I tried to append r.encoding = 'utf-8 after calls to requests in util.py but that didn't help. Here's the traceback:

Traceback (most recent call last):
  File "/usr/local/bin/graphqlmap", line 4, in <module>
    __import__('pkg_resources').run_script('graphqlmap==0.0.1', 'graphqlmap')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 656, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1460, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/local/lib/python3.10/dist-packages/graphqlmap-0.0.1-py3.10.egg/EGG-INFO/scripts/graphqlmap", line 81, in <module>
  File "/usr/local/lib/python3.10/dist-packages/graphqlmap-0.0.1-py3.10.egg/EGG-INFO/scripts/graphqlmap", line 74, in __init__
  File "/usr/local/lib/python3.10/dist-packages/graphqlmap-0.0.1-py3.10.egg/graphqlmap/attacks.py", line 146, in exec_advanced
  File "/usr/local/lib/python3.10/dist-packages/graphqlmap-0.0.1-py3.10.egg/graphqlmap/attacks.py", line 88, in exec_graphql
  File "/usr/local/lib/python3.10/dist-packages/graphqlmap-0.0.1-py3.10.egg/graphqlmap/utils.py", line 33, in requester
  File "/usr/lib/python3/dist-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1323, in _send_request
    self.putheader(hdr, value)
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 219, in putheader
    _HTTPConnection.putheader(self, header, *values)
  File "/usr/lib/python3.10/http/client.py", line 1255, in putheader
    values[i] = one_value.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2026' in position 512: ordinal not in range(256)
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

No branches or pull requests

1 participant