Pedro Algarvio, aka, s0undt3ch wrote:
> Ok, I found out how. I need to completely override EmailNotify.send()
>
> Although this was no major thing to do, I detect a wierd problem.
>
> So, instead of just using MIMIText like trac does it, I'm using
> MIMEMultipart wich includes 2 MIMEText parts, the message and the
> attachment.
>
> At first I just set'ed the MIMEMultipart charset like trac does, it was
> no problem with python 2.4.2, but with python 2.4.3 I started getting
> this nice traceback:
> Traceback (most recent call last):
>   File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 356,
> in dispatch_request
>     dispatcher.dispatch(req)
>   File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 224,
> in dispatch
>     resp = chosen_handler.process_request(req)
>   File "/usr/lib/python2.4/site-packages/trac/wiki/web_ui.py", line
> 113, in process_request
>     self._do_save(req, db, page)
>   File "/usr/lib/python2.4/site-packages/trac/wiki/web_ui.py", line
> 240, in _do_save
>     req.remote_addr)
>   File "/usr/lib/python2.4/site-packages/trac/wiki/model.py", line 144,
> in save
>     author, remote_addr)
>   File
> "/usr/lib/python2.4/site-packages/TracWikiNotification-0.1.0rc2-py2.4.egg/WikiNotification/listener.py",
> line 43, in wiki_page_changed
>     wne.notify("modified", page, version, time, comment, author, ipnr)
>   File
> "/usr/lib/python2.4/site-packages/TracWikiNotification-0.1.0rc2-py2.4.egg/WikiNotification/notification.py",
> line 108, in notify
>     NotifyEmail.notify(self, page.name, subject)
>   File "/usr/lib/python2.4/site-packages/trac/notification.py", line
> 208, in notify
>     Notify.notify(self, resid)
>   File "/usr/lib/python2.4/site-packages/trac/notification.py", line
> 107, in notify
>     self.send(torcpts, ccrcpts)
>   File
> "/usr/lib/python2.4/site-packages/TracWikiNotification-0.1.0rc2-py2.4.egg/WikiNotification/notification.py",
> line 240, in send
>     mail.set_charset(self._charset)
>   File "/usr/lib/python2.4/email/Message.py", line 260, in set_charset
>     self._payload = charset.body_encode(self._payload)
>   File "/usr/lib/python2.4/email/Charset.py", line 366, in body_encode
>     return email.base64MIME.body_encode(s)
>   File "/usr/lib/python2.4/email/base64MIME.py", line 136, in encode
>     enc = b2a_base64(s[i:i + max_unencoded])
> TypeError: b2a_base64() argument 1 must be string or read-only buffer,
> not list
>
> The current workarround I found is to set the charset for both the
> MIMEText message and attachment and not on MIMEMultipart, but I dunno
> if this breaks any RFC
>
> Anyway, I'd like some more info/pointers from ppl who know python's
> email package.
>
> Thanks,
> Pedro Algarvio
>
>
> >
>   
Even more weird, now with python 2.4.2 if I do the encoding of the 
parts, all I see is the encoded stuff, ie, nothing readable.

-- 
Pedro Algarvio
   __ ___  ___ _______        ___ __
|   Y   .'  _|   _   .-----.'  _|  |_   .-----.----.-----.
|.  |   |   _|   1___|  _  |   _|   _|__|  _  |   _|  _  |
|.  |   |__| |____   |_____|__| |____|__|_____|__| |___  |
|:  1   |    |:  1   |                             |_____|
|::.. . |    |::.. . |  ufs [AT] ufsoft [DOT] org
`-------'    `-------'    ufs [AT] sapo [DOT] pt



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/trac-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to