Skip to content

Commit

Permalink
2to3: use Request.get_data() instead of Request.data
Browse files Browse the repository at this point in the history
This is the right thing to do according to
pallets/flask#716.
— data is intentionally the undecoded bytes, and we need to either
decode it outselves, our use .get_data(as_text=True). This latter
seems to be a nicer option.

I used temporary 'data' variable to assign the decoded text.
.get_data() is caching by default, so this doesn't save much work,
but avoid the fairly verbose method invocation in asserts.

In some places 'data' was used for .post(), and this is renamed
to 'post_data' to avoid the name clash.

This makes all tests pass under python3.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
  • Loading branch information
keszybz committed Jul 7, 2018
1 parent 14d34ff commit b3d7490
Show file tree
Hide file tree
Showing 2 changed files with 754 additions and 583 deletions.

0 comments on commit b3d7490

Please sign in to comment.