Unicode prefixes break tests in python-json-schema-validator with python-simplejson 3.16.0

Bug #1812061 reported by Dave Jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
json-schema-validator (Ubuntu)
Fix Committed
Undecided
Unassigned

Bug Description

The json-schema-validator tests break under Python 2, when used with simplejson 3.16.0. They will also break if/when attempted under Python 3.

The underlying simplejson library subtly changes behaviour from 3.15.0 to 3.16.0. Under Python 2, with simplejson 3.15.0, passing a byte-string to simplejson.loads containing a blank JSON-encoded string, e.g. simplejson.loads('""') returns a unicode string (u''). However, under 3.16.0 this changes to return a byte-string (''). Passing a unicode-string to simplejson.loads containing a blank JSON-encoded string, e.g. simplejson.loads(u'""') return a unicode string under both versions.

Patched version at: https://launchpad.net/~waveform/+archive/ubuntu/pkg - 2.3.1-3ubuntu2

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Sponsored as 2.3.1-3ubuntu1. Discussed with Dave the possibility of getting this fix upstream, but since the last upstream commit was 3 years ago this doesn't seem like a high priority.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Thanks for the fix!

Changed in json-schema-validator (Ubuntu):
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.