Replace rstrip() with removesuffix() to safely remove suffix without unintended character stripping.
rstrip()
removesuffix()
· Sign up or log in to comment