Hi,
Thank you for your answer
I hacked in the file:
\Python25\Lib\site-packages\routes-1.10.1-py2.5.egg\routes\util.py

delete the lines:
    if not isinstance(url, str) and url is not None:
        raise GenerationException("url_for can only return a string,
got "
                        "unicode instead: %s" % url)

every things is OK.

and after i pasted the lines back:
    if not isinstance(url, str) and url is not None:
        raise GenerationException("url_for can only return a string,
got "
                        "unicode instead: %s" % url)

every things is OK now.



On Jan 3, 9:41 pm, "Mark Ramm" <[email protected]> wrote:
> I assume this is a routes issue, though you don't quite give us enough
> traceback to know for sure.
>
> I think what's happening is that tg.redirect and tg.url changed to use
> routes url_for, and url_forcan't handleunicodestrings being passed
> to it.   In the short term youcanencode thestringas asci or utf9
> on the way into the redirect.
>
> a.encode('utf8')
>
> In trunk we have some code that does this automatically for you, and
> I'm talking to Ben to see why routes does not acceptunicodeand
> generate utf8 encoded urls.
>
> --Mark
>
> On Fri, Jan 2, 2009 at 9:18 PM, James <[email protected]> wrote:
> > Hi,
> > when I follow the Tutorials:
> >http://www.turbogears.org/2.0/docs/main/Wiki20/wiki20.html.
> > I get an error:
> >GenerationException:Canonlyreturnastring,gotunicodeinstead:
> > /FrontPage
> > why?
>
> > ________________________________
> > 《大话西游外传》贺岁新作,送豪宅、送你5000元压岁钱
>
> --
> Mark Ramm-Christensen
> email: mark at compoundthinking dot com
> blog:www.compoundthinking.com/blog

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to