[Python-3000] current status

Barry Warsaw barry at python.org
Thu Aug 30 19:49:16 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Aug 30, 2007, at 3:00 AM, Neal Norwitz wrote:

> Some of the failures in test_mailbox and test_old_mailbox are the
> same, but I think test_mailbox might have more problems.

It does, and I won't be spending any more time before a1 looking at  
it.  The problem is that MH.__setitem__() opens its file in binary  
mode, then passes a string to the base class's _dump_message()  
method.  It then tries to write a string to a binary file and you get  
a TypeError.  You can't just encode strings to bytes in _dump_message 
() though because sometimes the file you're passed is a text file and  
so you trade one failure for another.

I don't think it's quite right to do the conversion in MH.__setitem__ 
() either though because _dump_message() isn't prepared to handle  
bytes.  Maybe it should be, but the basic problem is that you can get  
passed either a text or binary file object and you need to be able to  
write either strings or bytes to either.

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQCVAwUBRtcDHXEjvBPtnXfVAQJPvgP+L2cGjpioinZE/PQ/zLdQu0CebCIygpBj
RYOvSF/Mw1xiK4sOfHEdfG8LaYAgfL2mAP9smn+s5osodbPXP4kYPHTbMgzSN7oT
BhMvvMeqeosz6/sLb0hdEKdk+54zo3yqh62DeLBuYSLMhaLVoVShFdlTvOEs8YPQ
qZGQsiu57Wo=
=+sdc
-----END PGP SIGNATURE-----


More information about the Python-3000 mailing list