Merge lp:~leonardr/lazr.restful/bug-619180 into lp:lazr.restful
Proposed by
Leonard Richardson
Status: | Merged |
---|---|
Approved by: | Данило Шеган |
Approved revision: | 173 |
Merged at revision: | 171 |
Proposed branch: | lp:~leonardr/lazr.restful/bug-619180 |
Merge into: | lp:lazr.restful |
Diff against target: |
96 lines (+29/-8) 5 files modified
src/lazr/restful/NEWS.txt (+3/-0) src/lazr/restful/_operation.py (+3/-3) src/lazr/restful/example/base/tests/collection.txt (+10/-0) src/lazr/restful/example/base/tests/field.txt (+1/-5) src/lazr/restful/testing/helpers.py (+12/-0) |
To merge this branch: | bzr merge lp:~leonardr/lazr.restful/bug-619180 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Данило Шеган (community) | Approve | ||
Review via email: mp+48355@code.launchpad.net |
Description of the change
This branch fixes bug 619180. Field-specific validation errors that contained Unicode characters were treated properly if the validation was done as part of a PUT or PATCH request, but not if it was done as part of a named operation call. I fixed the place where the problem was and two other places as well (though I don't think the problem can really happen in those other two places).
I refactored a test helper method to avoid duplicating code.
To post a comment you must log in.
> leonardr, hi, is .encode(utf-8) safe to do for URLs?
<lifeless> if it is a url, then it must be a subset of ascii
by definition
<leonardr> danilos: what specific case are you thinking of?
<danilos> ok, let me rephrase that... leonardr, is .encode('utf-8') safe to do before passing to webservice.get() [i.e. does it do escaping as appropriate, and is it documented that our webservice works with UTF-8]
leonardr, line 48
<leonardr> danilos: well, the test works... that's a good question, though
<danilos> leonardr, heh, ok, fair enough
leonardr, how do we answer that question?
<leonardr> danilos: i'll take a look at the incoming request
<jam> jtv: are you still around? I got stuck shoveling snow for a couple of hours this morning, but I'm around now
<danilos> leonardr, cool, thanks... even if it might be a problem already, it doesn't have much to do with this branch I suppose, so r=me
leonardr, please do file a bug if you find it is, though
<leonardr> danilos: actually, i know it works in reality, because ursula's test request went through properly (and once this fix is applied, it works everywhere)
<leonardr> so i think httplib2 percent-encodes the utf-8, and that's how it works
<danilos> leonardr, right, makes sense, thanks