[issue10783] struct.pack() and Unicode strings
report at bugs.python.org
Tue Dec 28 01:03:38 CET 2010
Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:
Many of these kind of "decisions" were made quickly, haphazardly, and with almost no discussion and were made by contributors who were new to Python core development (no familiar with the API norms).
Given the rats nest of bytes/text problems in Py3.0 and Py3.1, I think it is fair game to fix it now. The APIs have not been shaken-out and battle-tested through wide-spread adoption, so it was fair to expect that the first experienced user to come along would find these rough patches.
ISTM, this should get fixed. The most innocuous way to do it is to add a warning for the implicit conversion. That way, any existing 3.x code (probably precious little) would continue to run. Another option is to just finish the job by adding an encoding parameter that defaults to utf-8.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list