[Python-Dev] email package status in 3.X

Stephen J. Turnbull stephen at xemacs.org
Tue Jun 22 04:06:36 CEST 2010


Barry Warsaw writes:

 > I'm still not sure ebytes solves the problem,

I don't see how it can.  If you have an encoding to stuff into ebytes,
you could just convert to Unicode and guarantee that all internal
string operations will succeed.  If you use ebytes instead, every
string operation has to be wrapped in "try ... except EBytesError", to
no gain that I can see.

If you don't have an encoding, then you just have bytes, which
strictly speaking shouldn't be operated on (in the sense of slicing,
dicing, or stir-frying) at all if you're in an environment where they
are a carrier for formatted information such as non-ASCII characters
or PNG images.

 > but it avoids one I'm most concerned about seeing proposed.  I
 > really really do not want to add encoding=blah arguments to
 > boatloads of function signatures.

Agreed.  But ebytes isn't a solution to that; it's a regression to one
of the hardest problems in Python 2.

OTOH, it seems to me that there's only one boatload to worry about.
That's the boatload containing protocol-less APIs, ie, Unix OS data
(names in the filesystem, content of environment variables).
Other platforms (Windows, Mac) are standardizing on protocols for
these things and enforcing them in the OS, and free Unices are going
to the convention that everything is non-normalized UTF-8.

What other boats are you worried about?



More information about the Python-Dev mailing list