Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
StringIO.set_encoding may change shared ByteList encoding #1699
When creating a StringIO instance with no arguments, ptr.string references the shared EMPTY_BYTELISTS instance for that encoding.
It is possible to then call set_encoding to change the encoding on the shared instance.
This fix is to duplicate the value before changing the encoding.