unicodeerror and cStringIO

6 views
Skip to first unread message

kaesh...@gmail.com

unread,
Dec 18, 2013, 4:23:45 AM12/18/13
to nive...@googlegroups.com
Hi,

When using non ascii char on title it throws unicodeerror. I found that it's because of cStringIO wich doesn't handle unicode. If i replace with StringIO in cmsview/view.py and design/view.py it works.

Digging in the code where cStringIO is used, i found that in extensions/images.py StringIO and popen are imported but not used.

In view.py line 233, there is
        html = StringIO()
        html.write(u"""<ul id="level1" class="%s">""" % (ulclass))
        html = self._navigationLevel(root, level, page, path, html, ulclass)
        html.write(u"""</ul>""")

The third line shoud be html.write and not html = insn'it ?

Hope to help with my bad english !

Arndt Droullier

unread,
Dec 18, 2013, 9:19:34 AM12/18/13
to nive...@googlegroups.com
Yes, you're right with StringIO. I'll remove the cStringIO imports from the python files.

The call

     html = self._navigationLevel(root, level, page, path, html, ulclass)

is allright. 'html' is the StringIO instance is passed as parameter and returned by the function.
'_navigationLevel()' adds some html internally.

Arndt.



2013/12/18 <kaesh...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "nive-cms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nive-cms+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
----------------------------------------------------------------------------------------------
Arndt Droullier, Nive GmbH, Köln, Germany
Nive Web Application Publishing: < New Prototype > www.nive.co
Nive Open Source Cms: cms.nive.co
Reply all
Reply to author
Forward
0 new messages