Hi,<br><br>With the code given by Jan-Jaap, if you try to access to favicon.ico, you get:<br><b>TypeError: The result should be None, a string, or adaptable to IResult.<br></b><br>Simply add read() and it works fine. I can see the favicon in the url bar.<br>

return resource_stream(&#39;dolmenexample&#39;, &#39;favicon.ico&#39;).read()<br><br>Happy new year!<br><br clear="all">Vincent<br>
<br><br><div class="gmail_quote">On Mon, Dec 13, 2010 at 8:38 PM, Hector Blanco <span dir="ltr">&lt;<a href="mailto:white.lists@gmail.com">white.lists@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

It works... well I still don&#39;t know if it&#39;s really serving the icon or<br>
not, but at least it doesn&#39;t complain :)<br>
<br>
2010/12/11 Jan-Jaap Driessen &lt;<a href="mailto:jdriessen@thehealthagency.com">jdriessen@thehealthagency.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; On 10 December 2010 22:47, Hector Blanco &lt;<a href="mailto:white.lists@gmail.com">white.lists@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Hello everyone!<br>
&gt;&gt;<br>
&gt;&gt; I have a problem that is not too serious but that has been bothering<br>
&gt;&gt; me a little...<br>
&gt;&gt;<br>
&gt;&gt; When I request a page from my Grok server (in debug mode), I get an exception<br>
&gt;&gt; Debug at: <a href="http://127.0.0.1:8080/_debug/view/1292017221" target="_blank">http://127.0.0.1:8080/_debug/view/1292017221</a><br>
&gt;&gt;<br>
&gt;&gt; And it&#39;s because it doesn&#39;t find the favicon.ico:<br>
&gt;&gt;<br>
&gt;&gt; URL: <a href="http://127.0.0.1:8080/favicon.ico" target="_blank">http://127.0.0.1:8080/favicon.ico</a><br>
&gt;&gt; Module paste.evalexception.middleware:306 in respond<br>
&gt;&gt; [ . . . stuff, stuff, stuff . . .]<br>
&gt;&gt; NotFound: Object: &lt;zope.site.folder.Folder object at 0x976476c&gt;, name:<br>
&gt;&gt; u&#39;favicon.ico&#39;<br>
&gt;&gt;<br>
&gt;&gt; But sometimes, when I&#39;m developing something new, it scares the s**t<br>
&gt;&gt; out of me (I think I&#39;ve done a bad mistake). I wouldn&#39;t mind providing<br>
&gt;&gt; a sample (even empty) icon so it would find it and it won&#39;t complain<br>
&gt;&gt; anymore, but I don&#39;t know where to place it.<br>
&gt;&gt;<br>
&gt;&gt; Thank you in advance!<br>
&gt;<br>
&gt; Hi Hector,<br>
&gt;<br>
&gt; You can register a response for favicon.ico like this (pseudo-code, not tested):<br>
&gt;<br>
&gt; &#39;&#39;&#39;<br>
&gt; from pkg_resources import resource_stream<br>
&gt;<br>
&gt; from zope.interface import Interface<br>
&gt; import grok<br>
&gt;<br>
&gt; class Favicon(grok.View):<br>
&gt;    grok.context(Interface)<br>
&gt;    <a href="http://grok.name" target="_blank">grok.name</a>(&#39;favicon.ico&#39;)<br>
&gt;<br>
&gt;    def render(self):<br>
&gt;        self.request.response.setHeader(&#39;Content-Type&#39;,<br>
&gt; &#39;image/vnd.microsoft.icon&#39;)<br>
&gt;        return resource_stream(&#39;mypackage&#39;, &#39;path/to/favicon.ico&#39;)<br>
&gt; &#39;&#39;&#39;<br>
&gt;<br>
&gt; HTH,<br>
&gt;<br>
&gt; --<br>
&gt; Jan-Jaap Driessen<br>
&gt;<br>
_______________________________________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">https://mail.zope.org/mailman/listinfo/grok-dev</a><br>
</div></div></blockquote></div><br>