mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
byte string encoding fix for shapely and SerializationException
This commit is contained in:
parent
e980e8a170
commit
6b1cf47beb
2 changed files with 3 additions and 3 deletions
|
@ -116,7 +116,7 @@ class ThriftClientRouter(object):
|
|||
# convert the wkb to a bytearray with only positive values
|
||||
byteArrWKB = bytearray([x % 256 for x in wkb.tolist()])
|
||||
# convert the bytearray to a byte string and load it.
|
||||
geometries.append(shapely.wkb.loads(str(byteArrWKB)))
|
||||
geometries.append(shapely.wkb.loads(bytes(byteArrWKB)))
|
||||
|
||||
|
||||
retVal = []
|
||||
|
|
|
@ -162,8 +162,8 @@ class ThriftSerializationContext(object):
|
|||
elif name.find('$') > -1:
|
||||
# it's an inner class, we're going to hope it's an enum, treat it special
|
||||
fieldName, fieldType, fieldId = self.protocol.readFieldBegin()
|
||||
if fieldName != '__enumValue__':
|
||||
raise dynamiceserialize.SerializationException(b"Expected to find enum payload. Found: " + fieldName)
|
||||
if fieldName.decode('utf8') != '__enumValue__':
|
||||
raise dynamicserialize.SerializationException(b"Expected to find enum payload. Found: " + fieldName)
|
||||
obj = self.protocol.readString()
|
||||
self.protocol.readFieldEnd()
|
||||
return obj
|
||||
|
|
Loading…
Add table
Reference in a new issue