Re: [Zope3-dev] server error in apidoc (encoding pb)

2007-01-17 Thread Christophe Combelles

Dmitry Vasiliev a écrit :

Christophe Combelles wrote:
Did someone have a look on this error ? Is it a trivial thing, or a 
local configuration problem, or is it reproduceable?

(I write in utf-8, and I put # -*- coding: utf-8 -*- in my interfaces.py)


You must use unicode docstrings. The encoding declaration at the top of 
the module doesn't do any magic by itself but just tells Python from 
which encoding unicode strings can be decoded.


So your module should looks like this:

# -*- coding: utf-8 -*-
uSome docstring text in utf-8.



That's it, that was actually trivial, I forgot the 'u' :)

thanks
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] server error in apidoc (encoding pb)

2007-01-16 Thread Christophe Combelles
Did someone have a look on this error ? Is it a trivial thing, or a local 
configuration problem, or is it reproduceable?

(I write in utf-8, and I put # -*- coding: utf-8 -*- in my interfaces.py)

Christophe


Christophe Combelles a écrit :

Hello,

When I put some accentuated character in the docstring of an interface
and I want to see the interface doc in 
apidoc-interfaces-search-IMyInterface,


I then get a server error:


  File /usr/lib/python2.4/site-packages/zope/tales/tales.py, line 696, 
in evaluate

return expression(self)
   - /usr/lib/zope3/lib/python/zope/app/apidoc/ifacemodule/index.pt
   - Line 23, Column 4
   - Expression: PathExpr standard:u'view/getDoc'
   - Names:
  {'args': (),
   'context': InterfaceClass 
zblog.category.interfaces.ICategoryContainer,

   'default': object object at 0xb7db0548,
   'loop': {},
   'nothing': None,
   'options': {},
   'repeat': {},
   'request': zope.publisher.browser.BrowserRequest instance 
URL=http://localhost:9673/++apidoc++/Interface/zblog.category.interfaces.ICategoryContainer/index.html, 

   'template': 
zope.app.pagetemplate.viewpagetemplatefile.ViewPageTemplateFile object 
at 0xb6a319ac,
   'usage': zope.pagetemplate.pagetemplate.TemplateUsage object at 
0xb5c3ea4c,
   'view': zope.app.pagetemplate.simpleviewclass.SimpleViewClass 
from /usr/lib/zope3/lib/python/zope/app/apidoc/ifacemodule/index.pt 
object at 0xb5c3ef4c,
   'views': zope.app.pagetemplate.viewpagetemplatefile.ViewMapper 
object at 0xb5bf9d6c}

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/ccomb%40free.fr





___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] server error in apidoc (encoding pb)

2007-01-16 Thread Christophe Combelles

Christophe Combelles a écrit :

When I put some accentuated character in the docstring of an interface
and I want to see the interface doc in 
apidoc-interfaces-search-IMyInterface,


I then get a server error:



Here is the full backtrace:

--
2007-01-16T16:58:11 ERROR SiteError 
http://localhost:9673/++apidoc++/Interface/zblog.category.interfaces.ICategory/index.html

Traceback (most recent call last):
  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, line 133, 
in publish

result = publication.callObject(request, obj)
  File 
/usr/lib/python2.4/site-packages/zope/app/publication/zopepublication.py, line 
161, in callObject

return mapply(ob, request.getPositionalArguments(), request)
  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, line 108, 
in mapply

return debug_call(obj, args)
   - __traceback_info__: security proxied 
zope.app.pagetemplate.simpleviewclass.SimpleViewClass from 
/usr/lib/zope3/lib/python/zope/app/apidoc/ifacemodule/index.pt instance at 
0xb57112cc
  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, line 114, 
in debug_call

return obj(*args)
  File 
/usr/lib/python2.4/site-packages/zope/app/pagetemplate/simpleviewclass.py, 
line 44, in __call__

return self.index(*args, **kw)
  File 
/usr/lib/python2.4/site-packages/zope/app/pagetemplate/viewpagetemplatefile.py, 
line 83, in __call__

return self.im_func(im_self, *args, **kw)
  File 
/usr/lib/python2.4/site-packages/zope/app/pagetemplate/viewpagetemplatefile.py, 
line 51, in __call__

sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
  File /usr/lib/python2.4/site-packages/zope/pagetemplate/pagetemplate.py, 
line 117, in pt_render

strictinsert=0, sourceAnnotations=sourceAnnotations)()
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 271, 
in __call__

self.interpret(self.program)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 346, 
in interpret

handlers[opcode](self, args)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 891, 
in do_useMacro

self.interpret(macro)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 346, 
in interpret

handlers[opcode](self, args)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 536, 
in do_optTag_tal

self.do_optTag(stuff)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 521, 
in do_optTag

return self.no_tag(start, program)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 516, 
in no_tag

self.interpret(program)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 346, 
in interpret

handlers[opcode](self, args)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 949, 
in do_defineSlot

self.interpret(slot)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 346, 
in interpret

handlers[opcode](self, args)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 745, 
in do_insertStructure_tal

structure = self.engine.evaluateStructure(expr)
  File /usr/lib/python2.4/site-packages/zope/tales/tales.py, line 696, in 
evaluate

return expression(self)
   - /usr/lib/zope3/lib/python/zope/app/apidoc/ifacemodule/index.pt
   - Line 23, Column 4
   - Expression: PathExpr standard:u'view/getDoc'
   - Names:
  {'args': (),
   'context': InterfaceClass zblog.category.interfaces.ICategory,
   'default': object object at 0xb7dab548,
   'loop': {},
   'nothing': None,
   'options': {},
   'repeat': {},
   'request': zope.publisher.browser.BrowserRequest instance 
URL=http://localhost:9673/++apidoc++/Interface/zblog.category.interfaces.ICategory/index.html,
   'template': 
zope.app.pagetemplate.viewpagetemplatefile.ViewPageTemplateFile object at 
0xb6a2c9ac,
   'usage': zope.pagetemplate.pagetemplate.TemplateUsage object at 
0xb5711ccc,
   'view': zope.app.pagetemplate.simpleviewclass.SimpleViewClass from 
/usr/lib/zope3/lib/python/zope/app/apidoc/ifacemodule/index.pt object at 
0xb57112cc,
   'views': zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object 
at 0xb5711d4c}
  File /usr/lib/python2.4/site-packages/zope/tales/expressions.py, line 217, 
in __call__

return self._eval(econtext)
  File /usr/lib/python2.4/site-packages/zope/tales/expressions.py, line 211, 
in _eval

return ob()
  File 
/usr/lib/python2.4/site-packages/zope/app/apidoc/ifacemodule/browser.py, line 
85, in getDoc

return renderText(iface.__doc__, inspect.getmodule(iface))
  File /usr/lib/python2.4/site-packages/zope/app/apidoc/utilities.py, line 
327, in renderText

source = createObject(format, text)
  File /usr/lib/python2.4/site-packages/zope/component/_api.py, line 224, in 
createObject

return getUtility(IFactory, __factory_name, context)(*args, **kwargs)
  File 

Re: [Zope3-dev] server error in apidoc (encoding pb)

2007-01-16 Thread Dmitry Vasiliev

Christophe Combelles wrote:
Did someone have a look on this error ? Is it a trivial thing, or a 
local configuration problem, or is it reproduceable?

(I write in utf-8, and I put # -*- coding: utf-8 -*- in my interfaces.py)


You must use unicode docstrings. The encoding declaration at the top of the 
module doesn't do any magic by itself but just tells Python from which encoding 
unicode strings can be decoded.


So your module should looks like this:

# -*- coding: utf-8 -*-
uSome docstring text in utf-8.

--
Dmitry Vasiliev (dima at hlabs.spb.ru)
http://hlabs.spb.ru
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com