Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22315 closed Bug (fixed)

str/bytes mismatch in ManifestFilesMixin causes failure on Python 3

Reported by: David Evans Owned by: nobody
Component: contrib.staticfiles Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The issue is that load_manifest returns bytes rather than a string which then gets fed into json.loads inside read_manifest resulting in:

TypeError: can't use a string pattern on a bytes-like object

read_manifest doesn't get exercised in the test suite, hence the issue not being spotted.

I'll try to submit a patch soon, but just registering the issue first.

Change History (4)

comment:1 by David Evans, 11 years ago

Has patch: set

comment:2 by Simon Charette, 11 years ago

Triage Stage: UnreviewedAccepted

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

Resolution: fixed
Status: newclosed

In 86dcac463437dce06ddcade10fa3f308436ba608:

Fixed #22315 -- str/bytes mismatch in staticfiles

Previously, ManifestFilesMixin.read_manifest failed in Python 3
because json.loads accepts str not bytes.

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

In ddcbde41eec12f7a84b00635cdbf1c93d4e4d297:

[1.7.x] Fixed #22315 -- str/bytes mismatch in staticfiles

Previously, ManifestFilesMixin.read_manifest failed in Python 3
because json.loads accepts str not bytes.

Backport of 86dcac4634 from master

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