[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-email-sig
Subject:    [Email-SIG] Modifying messages loaded with message_from_string()
From:       indrek () inversion ! ee (Indrek =?ISO-8859-1?Q?J=E4rve?=)
Date:       2004-10-19 21:27:07
Message-ID: 1098214106.5818.14.camel () hercules ! dustbite ! org
[Download RAW message or body]

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@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>]


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic