On Thu, Oct 10, 2013 at 12:50 AM, Martin Panter <vadmium+patch@gmail.com> wrote:
To me, having learnt Python 3 before Python 2, I found the name new_StringIO() misleading, since you are actually returning a BytesIO object. Anyway, the “io” module was added in Python 2.6, so maybe you can get rid of the whole workaround.
Yeah, in retrospect that wasn't the best choice of name. It was accurate for the commit that introduced the function, but then the later commit changed to BytesIO and it didn't occur to me to clean up the name.
Python 2 can also do str.encode("utf8"), why only do it for Python 3?
Only to avoid changing the behavior under Python 2. But I agree that it would be wiser to specify an encoding in all cases. Thanks, I'll incorporate that into a revised patch set (if there is a need for one). Jeremy