2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 13:37:55 +00:00

correct len() of item to convert from utf-8 first

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@303 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
Michael Graff
2009-11-20 10:37:05 +00:00
parent 02b62f9e5a
commit ff55be8a87

View File

@@ -44,7 +44,7 @@ def _encode_tag(tag):
"""Encode a single UTF-8 tag.
... wire_partial = Message._encode_tag('this')
"""
return(struct.pack(">B", len(tag)) + bytearray(tag, 'utf-8'))
return(struct.pack(">B", len(bytearray(tag, 'utf-8'))) + bytearray(tag, 'utf-8'))
def _encode_length_and_type(data, datatype):
"""Helper method to handle the length encoding in one place."""