Skip to content

Commit aa15e2f

Browse files
committed
Merge branch 'andrewkirillov-ibm-fix_to_string'
2 parents 12266c0 + 6a49d0b commit aa15e2f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

code/ibmmq/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ def to_string(v, encoding=EncodingDefault.bytes_encoding):
208208
"""
209209
if isinstance(v, bytes):
210210
try:
211+
null_index = v.find(0)
212+
if null_index != -1:
213+
v = v[:null_index]
211214
return v.decode(encoding).strip()
212215
except UnicodeError:
213216
pass

0 commit comments

Comments
 (0)