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

Python 3 & non-ascii arguments => UnicodeEncodeError #31

Closed
jkbrzt opened this issue Mar 15, 2012 · 0 comments
Closed

Python 3 & non-ascii arguments => UnicodeEncodeError #31

jkbrzt opened this issue Mar 15, 2012 · 0 comments
Labels
bug Something isn't working

Comments

@jkbrzt
Copy link
Member

jkbrzt commented Mar 15, 2012

$ python --version
Python 3.2.2

$ http GET httpie.org hello:č
Traceback (most recent call last):
  File "/Users/jakub/.virtualenv/test-p3/lib/python3.2/site-packages/httpie-0.1.7_dev-py3.2.egg/httpie/__main__.py", line 146, in main
    allow_redirects=args.allow_redirects,
  File "/Users/jakub/.virtualenv/test-p3/lib/python3.2/site-packages/requests-0.10.6-py3.2.egg/requests/api.py", line 39, in request
    return s.request(method=method, url=url, **kwargs)
  File "/Users/jakub/.virtualenv/test-p3/lib/python3.2/site-packages/requests-0.10.6-py3.2.egg/requests/sessions.py", line 200, in request
    r.send(prefetch=prefetch)
  File "/Users/jakub/.virtualenv/test-p3/lib/python3.2/site-packages/requests-0.10.6-py3.2.egg/requests/models.py", line 535, in send
    timeout=self.timeout,
  File "/Users/jakub/.virtualenv/test-p3/lib/python3.2/site-packages/requests-0.10.6-py3.2.egg/requests/packages/urllib3/connectionpool.py", line 384, in urlopen
    body=body, headers=headers)
  File "/Users/jakub/.virtualenv/test-p3/lib/python3.2/site-packages/requests-0.10.6-py3.2.egg/requests/packages/urllib3/connectionpool.py", line 260, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/http/client.py", line 964, in request
    self._send_request(method, url, body, headers)
  File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/http/client.py", line 997, in _send_request
    self.putheader(hdr, value)
  File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/http/client.py", line 940, in putheader
    values[i] = one_value.encode('latin1')
UnicodeEncodeError: 'latin-1' codec can't encode character '\u010d' in position 0: ordinal not in range(256)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jakub/.virtualenv/test-p3/bin/http", line 9, in <module>
    load_entry_point('httpie==0.1.7-dev', 'console_scripts', 'http')()
  File "/Users/jakub/.virtualenv/test-p3/lib/python3.2/site-packages/httpie-0.1.7_dev-py3.2.egg/httpie/__main__.py", line 154, in main
    sys.stderr.write(str(e.message) + NEW_LINE)
AttributeError: 'UnicodeEncodeError' object has no attribute 'message'
@jkbrzt jkbrzt closed this as completed in 67d6426 Apr 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant