Fix up posting some changes including unicode with Python 2.x
Review Request #9748 — Created March 5, 2018 and submitted
The changes I had made to make things encode correctly with Python 3
regressed posting diffs with unicode characters under Python 2. After
some investigation, what's needed is to use the native string type
(str) for headers and URLs passed into urllib2, rather than either
unicode or bytes.
- Posted a change including an emoji under both Python 2.7 and 3.6.
- Ran unit tests under Python 2.7 and 3.6.
| Description | From | Last Updated |
|---|---|---|
|
Can we do the same with method, and maybe even normalize headers? I can see this coming up a lot … |
|
|
|
testtesttest |
TE testaaaaaa | |
|
Since we're Python 2.7 now, this can be: self.headers = { str(key): str(value) for key, value in six.iteritems(headers) } |
|
|
|
Same as above. |
|
|
|
Is this still needed now that HttpRequest normalizes? |
|
- Commit:
-
f870f33a0118046b05f0420e9c211b359ad4ace9fe5e0141a06d7938703a234a6a27a8083f0431e0
- Diff:
-
Revision 2 (+28 -19)
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.
- Commit:
-
fe5e0141a06d7938703a234a6a27a8083f0431e078102230f4fc9e0aa1e8c2fef786b65ea10cc511
- Diff:
-
Revision 3 (+34 -17)
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.