Merge pull request #226 from OpenKMIP/bug/fix-textstring-write-value

Removing TextString check to encode characters when writing bytes
This commit is contained in:
Peter Hamilton 2016-12-06 20:23:39 -05:00 committed by GitHub
commit 264ef64e0b
1 changed files with 1 additions and 5 deletions

View File

@ -810,11 +810,7 @@ class TextString(Base):
def write_value(self, ostream):
# Write string to stream
for char in self.value:
if sys.version < '3':
c = char
else:
c = char.encode()
ostream.write(pack(self.BYTE_FORMAT, c))
ostream.write(pack(self.BYTE_FORMAT, char.encode()))
# Write padding to stream
for _ in range(self.padding_length):