Skip to content

Commit 264ef64

Browse files
Merge pull request OpenKMIP#226 from OpenKMIP/bug/fix-textstring-write-value
Removing TextString check to encode characters when writing bytes
2 parents 7ee336a + 843df7d commit 264ef64

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

kmip/core/primitives.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -810,11 +810,7 @@ def read(self, istream):
810810
def write_value(self, ostream):
811811
# Write string to stream
812812
for char in self.value:
813-
if sys.version < '3':
814-
c = char
815-
else:
816-
c = char.encode()
817-
ostream.write(pack(self.BYTE_FORMAT, c))
813+
ostream.write(pack(self.BYTE_FORMAT, char.encode()))
818814

819815
# Write padding to stream
820816
for _ in range(self.padding_length):

0 commit comments

Comments
 (0)