List Info

Thread: Problem with unicode...




Problem with unicode...
country flaguser name
United States
2007-10-14 02:06:55
I am runnning trac .10.4...

I have enabled the mod_python medthod rather than CGI to
speed things
up.  But I have found a problem:
 - If I save a page that has a unicode character such as →
I get the
following error:

Python Traceback

Traceback (most recent call last):
  File
"/usr/lib/python2.3/site-packages/trac/web/main.py"
;, line 406,
in dispatch_request
    dispatcher.dispatch(req)
  File
"/usr/lib/python2.3/site-packages/trac/web/main.py"
;, line 237,
in dispatch
    resp = chosen_handler.process_request(req)
  File
"/usr/lib/python2.3/site-packages/trac/wiki/web_ui.py&q
uot;, line
113, in process_request
    self._do_save(req, db, page)
  File
"/usr/lib/python2.3/site-packages/trac/wiki/web_ui.py&q
uot;, line
239, in _do_save
    req.remote_addr)
  File
"/usr/lib/python2.3/site-packages/trac/wiki/model.py&qu
ot;, line
144, in save
    author, remote_addr)
  File
"/usr/lib/python2.3/site-packages/TracWikiNotification-
0.1.0rc4-
py2.3.egg/WikiNotification/listener.py", line 43, in
wiki_page_changed
    wne.notify("modified", page, version, time,
comment, author, ipnr)
  File
"/usr/lib/python2.3/site-packages/TracWikiNotification-
0.1.0rc4-
py2.3.egg/WikiNotification/notification.py", line 106,
in notify
    NotifyEmail.notify(self, page.name, subject)
  File
"/usr/lib/python2.3/site-packages/trac/notification.py&
quot;, line
216, in notify
    Notify.notify(self, resid)
  File
"/usr/lib/python2.3/site-packages/trac/notification.py&
quot;, line
115, in notify
    self.send(torcpts, ccrcpts)
  File
"/usr/lib/python2.3/site-packages/TracWikiNotification-
0.1.0rc4-
py2.3.egg/WikiNotification/notification.py", line 254,
in send
    msgtext = mail.as_string()
  File "/usr/lib/python2.3/email/Message.py", line
130, in as_string
    g.flatten(self, unixfrom=unixfrom)
  File "/usr/lib/python2.3/email/Generator.py",
line 102, in flatten
    self._write(msg)
  File "/usr/lib/python2.3/email/Generator.py",
line 130, in _write
    self._dispatch(msg)
  File "/usr/lib/python2.3/email/Generator.py",
line 156, in _dispatch
    meth(msg)
  File "/usr/lib/python2.3/email/Generator.py",
line 230, in
_handle_multipart
    g.flatten(part, unixfrom=False)
  File "/usr/lib/python2.3/email/Generator.py",
line 102, in flatten
    self._write(msg)
  File "/usr/lib/python2.3/email/Generator.py",
line 130, in _write
    self._dispatch(msg)
  File "/usr/lib/python2.3/email/Generator.py",
line 156, in _dispatch
    meth(msg)
  File "/usr/lib/python2.3/email/Generator.py",
line 197, in
_handle_text
    payload = cset.body_encode(payload)
  File "/usr/lib/python2.3/email/Charset.py", line
389, in body_encode
    return email.base64MIME.body_encode(s)
  File "/usr/lib/python2.3/email/base64MIME.py",
line 148, in encode
    enc = b2a_base64(s[i:i + max_unencoded])
UnicodeEncodeError: 'ascii' codec can't encode character
u'u2192' in
position 26: ordinal not in range(128)

However, if I am using trac with CGI, I don't get this
error.

Any ideas as to how I can solved this?

Thanks,
Steve


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Trac Users" group.
To post to this group, send email to trac-usersgooglegroups.com
To unsubscribe from this group, send email to
trac-users-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problem with unicode...
user name
2007-10-14 05:08:36
It looks like an issue with the WikiNotification plugin.

Can you try to save the same character in a ticket comment,
and see
how Trac behaves when the ticket notification is sent?

Cheers,
Manu


-- 
Manu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Trac Users" group.
To post to this group, send email to trac-usersgooglegroups.com
To unsubscribe from this group, send email to
trac-users-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problem with unicode...
country flaguser name
United States
2007-10-14 09:22:32
No problem - I will try this this morning...

Emmanuel Blot wrote:
> It looks like an issue with the WikiNotification
plugin.
>
> Can you try to save the same character in a ticket
comment, and see
> how Trac behaves when the ticket notification is sent?
>
> Cheers,
> Manu
>
>
> --
> Manu


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Trac Users" group.
To post to this group, send email to trac-usersgooglegroups.com
To unsubscribe from this group, send email to
trac-users-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )