Skip to content

Commit

Permalink
byte string encoding fix for shapely and SerializationException
Browse files Browse the repository at this point in the history
  • Loading branch information
mjames-upc committed Oct 19, 2016
1 parent e980e8a commit 6b1cf47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion awips/dataaccess/ThriftClientRouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def getGeometryData(self, request, times):
# 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 = []
Expand Down
4 changes: 2 additions & 2 deletions dynamicserialize/ThriftSerializationContext.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ def deserializeMessage(self):
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
Expand Down

0 comments on commit 6b1cf47

Please sign in to comment.