Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29520 closed Bug (fixed)

test client crashes when posting bytes

Reported by: Mathias Ertl Owned by: nobody
Component: Testing framework Version: 2.1
Severity: Release blocker Keywords:
Cc: Herbert Fortes Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

b8a41a2872624a6d9e61308932dd81d001e31eb9 removes the force_bytes method for encoding data in post requests with data.encode(). This breaks the usecase of posting data=bytes to TestClient.post(), since that type does not have that function. The old implementation of course just returned the same value unchanged in case of a bytes value.

A simple fix would be to add an if not isinstance(bytes, data) check before invoking the _encode_data function.

Change History (6)

comment:1 by Herbert Fortes, 6 years ago

Cc: Herbert Fortes added

comment:2 by Claude Paroz, 6 years ago

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

Simply reverting the commit (and adding a test with a bytes-POST data) could also be considered.

comment:3 by Tim Graham, 6 years ago

Has patch: set
Summary: Posting bytes broken in 2.1 TestClienttest client crashes when posting bytes

comment:4 by Claude Paroz, 6 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: newclosed

In 9294110a:

Fixed #29520 -- Fixed test client crash when posting bytes.

Regression in b8a41a2872624a6d9e61308932dd81d001e31eb9.

comment:6 by Tim Graham <timograham@…>, 6 years ago

In 01b7fdfd:

[2.1.x] Fixed #29520 -- Fixed test client crash when posting bytes.

Regression in b8a41a2872624a6d9e61308932dd81d001e31eb9.

Backport of 9294110a57ce0a6d14506969c950090045c622c8 from master

Note: See TracTickets for help on using tickets.
Back to Top