[py3] bug.addAttachment() causes UnicodeEncodeError with binary data
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lazr.restfulclient (Ubuntu) |
Invalid
|
Undecided
|
Dimitri John Ledkov | ||
python-wadllib (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
While porting Apport to python3-
$ python3 /tmp/test.py
Traceback (most recent call last):
File "/tmp/test.py", line 15, in <module>
is_patch=False)
File "/usr/lib/
extra_
File "/usr/lib/
str(url), method=method, body=data, headers=headers)
File "/usr/lib/
url, method=method, body=body, headers=headers)
File "/usr/lib/
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/lib/
LaunchpadOA
File "/usr/lib/
redirections, cachekey)
File "/usr/lib/
(response, content) = self._conn_
File "/usr/lib/
conn.
File "/usr/lib/
self.
File "/usr/lib/
body = body.encode(
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 1217-1218: ordinal not in range(256)
When I call the same with python 2, it works fine. Note that this is a write operation, so this needs to use login_with() and credentials. So you might want to change the credentials_file= argument in the reproducer or drop it completely (then you'll have to log in every time you run the reproducer).
summary: |
- bug.addAttachment() causes UnicodeEncodeError with binary data + [py3] bug.addAttachment() causes UnicodeEncodeError with binary data |
Changed in lazr.restfulclient (Ubuntu): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in lazr.restfulclient (Ubuntu): | |
status: | New → In Progress |
Changed in lazr.restfulclient (Ubuntu): | |
status: | Triaged → Invalid |
some attachment