On Python 3, we need to use unicodes, rather than bytes. This lets
test-pull.t get a lot further along.
Details
- Reviewers
yuja indygreg - Group Reviewers
hg-reviewers - Commits
- rHG6db536bed7ec: httppeer: use native strings for headers
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
mercurial/httppeer.py | ||
---|---|---|
233 | I'm going to go ahead and not mess with this until I hit some test coverage for it. I think we should probably just leave encodevalueinheaders() as bytes-in but make it native-str-out, but we'll see when we get there. | |
241 | Turns out urlencode already copes with bytes input even on Python 3. A small victory. |
mercurial/httppeer.py | ||
---|---|---|
241 | Nice. So we have to concatenate bytes url and bytes qs, then covert the result to unicode. |
Good catch. I've now got things wired up so that (after another ~17 patches after this) some basic wireproto stuff is starting to work!
There's a templater bug I can't figure out, which I'll point out when the requisite patches to get that far land.
Appears that encodevalueinheaders() takes bytes.
I don't know which would be better to pass unicodes around or convert them
at one place.