[Email-SIG] Modifying messages loaded with message_from_string() with 3.0

Indrek Järve indrek at inversion.ee
Tue Oct 19 21:28:26 CEST 2004


Hi,

While testing our webmail client code with email 3.0, I found that
modifying message objects loaded with message_from_string() (attach()ing
new files) break boundaries - the added file will become unaccessable
after the next reload with message_from_string(). I've attached a
testcase and the output I got on Suse 9.1, Python 2.3.3, email 3.0 from
the python 2.4b1 package. The second run in testcase1.output is with the
default Python 2.3.3 email library.

Is this something that shouldn't be done this way or something just
gone a bit broken?

Best regards,
Indrek

-- 
Indrek Järve <indrek at inversion.ee>
Inversion Software OÜ
Cell: +372 58058966
Fax: +372 623 8818
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testcase1.py
Type: application/x-python
Size: 1066 bytes
Desc: not available
Url : http://mail.python.org/pipermail/email-sig/attachments/20041019/9b4abb10/testcase1.bin
-------------- next part --------------
hercules:/home/incx/lightdev/jykala # python testcase1.py
X after attach [<email.MIMEImage.MIMEImage instance at 0x4037fd4c>, <email.MIMEImage.MIMEImage instance at 0x4038114c>]
Y after attach [<email.Message.Message instance at 0x40420f6c>, <email.MIMEImage.MIMEImage instance at 0x4038114c>]
X after rload [<email.Message.Message instance at 0x4042028c>, <email.Message.Message instance at 0x404208ac>]
Y after rload [<email.Message.Message instance at 0x4042334c>]

hercules:/home/incx/lightdev/jykala # mv email/ email.2

hercules:/home/incx/lightdev/jykala # python testcase1.py
X after attach [<email.MIMEImage.MIMEImage instance at 0x4037922c>, <email.MIMEImage.MIMEImage instance at 0x4037fc4c>]
Y after attach [<email.Message.Message instance at 0x40379d0c>, <email.MIMEImage.MIMEImage instance at 0x4037fc4c>]
X after rload [<email.Message.Message instance at 0x4056196c>, <email.Message.Message instance at 0x405619cc>]
Y after rload [<email.Message.Message instance at 0x4056734c>, <email.Message.Message instance at 0x4056728c>]



More information about the Email-SIG mailing list