Is this a bug in strip()

Everything I read suggests that the len() function can be used to find the length of a string.

This snippet fails and produces a length of 65535

str1 = " " # a single space
str1 = str1.strip()
print( len( str1 ) )

Any other string including an empty string “” gives the correct length. It looks like the strip() function is failing in strings consisting only of spaces.

Am I missing something here?

Regards

hi @IanH
Sorry for the late reply, This is quite strange as the result of len() method shouldn’t be equal to 65535.
Please let us have a look at this bug and we’ll let you know of the updates.
Thanks for letting us know.