HelloWorld sanity check please - AttributeError: 'tuple' object has no attribute 'startswith'

[email protected] Wed, 24 Apr 2019 08:11:41 -0700 (PDT)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
------=_Part_879_330636767.1556118701967
Content-Type: multipart/alternative; 
	boundary="----=_Part_880_2089733584.1556118701967"

------=_Part_880_2089733584.1556118701967
Content-Type: text/plain; charset="UTF-8"

I have a VERY simple application that refuses to start.
This is the error trace:

pi@raspberrypi:~/Projects/HelloWorld $ python3.5m  main.py

[24/Apr/2019:16:50:28] ENGINE Listening for SIGUSR1.
[24/Apr/2019:16:50:28] ENGINE Listening for SIGHUP.
[24/Apr/2019:16:50:28] ENGINE Listening for SIGTERM.
[24/Apr/2019:16:50:28] ENGINE Bus STARTING
[24/Apr/2019:16:50:28] ENGINE Error in 'start' listener 
<cherrypy._cpchecker.Checker object at 0x76049470>
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/process/wspbus.py", 
line 230, in publish
    output.append(listener(*args, **kwargs))
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cpchecker.py", 
line 40, in __call__
    method()
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cpchecker.py", 
line 144, in check_static_paths
    if os.path.isabs(dir):
  File "/usr/lib/python3.5/posixpath.py", line 64, in isabs
    return s.startswith(sep)
*AttributeError: 'tuple' object has no attribute 'startswith'*

[24/Apr/2019:16:50:28] ENGINE Started monitor thread 'Autoreloader'.
[24/Apr/2019:16:50:28] ENGINE Serving on http://0.0.0.0:8080
[24/Apr/2019:16:50:28] ENGINE Shutting down due to error in start listener:

*main.py:*
import os, os.path
import cherrypy


class HelloWorld(object):
        @cherrypy.expose
        def index(self):
                return "Hello World !"


        @cherrypy.expose
        def greet(self, name='Unknown'):
                return "Hello " + name + " !"


if __name__ == '__main__':
        cherrypy.quickstart(HelloWorld(), '/', 'main.conf')

*main.conf:*



*[global]server.socket_host = '0.0.0.0'server.socket_port = 
8080log.access_file = ''log.error_file = ''[/]tools.trailing_slash.on = 
Falsetools.staticdir.root = 
os.path.abspath(os.getcwd())[/html]tools.staticdir.on = 
Truetools.staticdir.dir = './html',tools.staticdir.index = 
'index.html'[/css]tools.staticdir.on = Truetools.staticdir.dir = './css'*


If I leave only the [global] section in the conf file then the application 
starts.
So it seems something is wrong with the [/] and onwards part.

But what ? Any ideas ?

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.

------=_Part_880_2089733584.1556118701967
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I have a VERY simple application that refuses to start.<br=
>This is the error trace:<br><br><div class=3D"prettyprint" style=3D"backgr=
ound-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-st=
yle: solid; border-width: 1px; overflow-wrap: break-word;"><code class=3D"p=
rettyprint"><div class=3D"subprettyprint"><div class=3D"subprettyprint" sty=
le=3D"color: rgb(102, 0, 102);">pi@raspberrypi:~/Projects/HelloWorld $ pyth=
on3.5m=C2=A0 main.py<br><br></div><div class=3D"subprettyprint" style=3D"co=
lor: rgb(102, 0, 102);">[24/Apr/2019:16:50:28] ENGINE Listening for SIGUSR1=
.</div><div class=3D"subprettyprint" style=3D"color: rgb(102, 0, 102);">[24=
/Apr/2019:16:50:28] ENGINE Listening for SIGHUP.</div><div class=3D"subpret=
typrint" style=3D"color: rgb(102, 0, 102);">[24/Apr/2019:16:50:28] ENGINE L=
istening for SIGTERM.</div><div class=3D"subprettyprint" style=3D"color: rg=
b(102, 0, 102);">[24/Apr/2019:16:50:28] ENGINE Bus STARTING</div><div class=
=3D"subprettyprint" style=3D"color: rgb(102, 0, 102);">[24/Apr/2019:16:50:2=
8] ENGINE Error in &#39;start&#39; listener &lt;cherrypy._cpchecker.Checker=
 object at 0x76049470&gt;</div><div class=3D"subprettyprint" style=3D"color=
: rgb(102, 0, 102);">Traceback (most recent call last):</div><div class=3D"=
subprettyprint" style=3D"color: rgb(102, 0, 102);">=C2=A0 File &quot;/usr/l=
ocal/lib/python3.5/dist-packages/cherrypy/process/wspbus.py&quot;, line 230=
, in publish</div><div class=3D"subprettyprint" style=3D"color: rgb(102, 0,=
 102);">=C2=A0 =C2=A0 output.append(listener(*args, **kwargs))</div><div cl=
ass=3D"subprettyprint" style=3D"color: rgb(102, 0, 102);">=C2=A0 File &quot=
;/usr/local/lib/python3.5/dist-packages/cherrypy/_cpchecker.py&quot;, line =
40, in __call__</div><div class=3D"subprettyprint" style=3D"color: rgb(102,=
 0, 102);">=C2=A0 =C2=A0 method()</div><div class=3D"subprettyprint" style=
=3D"color: rgb(102, 0, 102);">=C2=A0 File &quot;/usr/local/lib/python3.5/di=
st-packages/cherrypy/_cpchecker.py&quot;, line 144, in check_static_paths</=
div><div class=3D"subprettyprint" style=3D"color: rgb(102, 0, 102);">=C2=A0=
 =C2=A0 if os.path.isabs(dir):</div><div class=3D"subprettyprint" style=3D"=
color: rgb(102, 0, 102);">=C2=A0 File &quot;/usr/lib/python3.5/posixpath.py=
&quot;, line 64, in isabs</div><div class=3D"subprettyprint" style=3D"color=
: rgb(102, 0, 102);">=C2=A0 =C2=A0 return s.startswith(sep)</div><div class=
=3D"subprettyprint" style=3D""><b style=3D""><font color=3D"#0000ff">Attrib=
uteError: &#39;tuple&#39; object has no attribute &#39;startswith&#39;</fon=
t></b></div><div class=3D"subprettyprint" style=3D"color: rgb(102, 0, 102);=
"><br></div><div class=3D"subprettyprint" style=3D"color: rgb(102, 0, 102);=
">[24/Apr/2019:16:50:28] ENGINE Started monitor thread &#39;Autoreloader&#3=
9;.</div><div class=3D"subprettyprint" style=3D"color: rgb(102, 0, 102);">[=
24/Apr/2019:16:50:28] ENGINE Serving on http://0.0.0.0:8080</div><div class=
=3D"subprettyprint" style=3D"color: rgb(102, 0, 102);">[24/Apr/2019:16:50:2=
8] ENGINE Shutting down due to error in start listener:</div></div></code><=
/div><br><b>main.py:</b><div><div class=3D"prettyprint" style=3D"background=
-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style:=
 solid; border-width: 1px; overflow-wrap: break-word;"><code class=3D"prett=
yprint"><div class=3D"subprettyprint"><font color=3D"#660066"><div class=3D=
"subprettyprint">import os, os.path</div><div class=3D"subprettyprint"><spa=
n style=3D"font-family: Arial, Helvetica, sans-serif;">import cherrypy</spa=
n><br></div><div class=3D"subprettyprint"><br></div><div class=3D"subpretty=
print"><br></div><div class=3D"subprettyprint">class HelloWorld(object):</d=
iv><div class=3D"subprettyprint">=C2=A0 =C2=A0 =C2=A0 =C2=A0 @cherrypy.expo=
se</div><div class=3D"subprettyprint">=C2=A0 =C2=A0 =C2=A0 =C2=A0 def index=
(self):</div><div class=3D"subprettyprint">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 return &quot;Hello World !&quot;</div><div class=
=3D"subprettyprint"><br></div><div class=3D"subprettyprint"><br></div><div =
class=3D"subprettyprint">=C2=A0 =C2=A0 =C2=A0 =C2=A0 @cherrypy.expose</div>=
<div class=3D"subprettyprint">=C2=A0 =C2=A0 =C2=A0 =C2=A0 def greet(self, n=
ame=3D&#39;Unknown&#39;):</div><div class=3D"subprettyprint">=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return &quot;Hello &quot; + name =
+ &quot; !&quot;</div><div class=3D"subprettyprint"><br></div><div class=3D=
"subprettyprint"><br></div><div class=3D"subprettyprint">if __name__ =3D=3D=
 &#39;__main__&#39;:</div><div class=3D"subprettyprint">=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 cherrypy.quickstart(HelloWorld(), &#39;/&#39;, &#39;main.conf&#3=
9;)</div></font></div></code></div><br><b>main.conf:</b></div><div><div cla=
ss=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); border-co=
lor: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-w=
rap: break-word;"><code class=3D"prettyprint" style=3D""><div class=3D"subp=
rettyprint" style=3D""><font color=3D"#660066"><b><div class=3D"subprettypr=
int" style=3D"">[global]</div><div class=3D"subprettyprint" style=3D"">serv=
er.socket_host =3D &#39;0.0.0.0&#39;</div><div class=3D"subprettyprint" sty=
le=3D"">server.socket_port =3D 8080</div><div class=3D"subprettyprint" styl=
e=3D"">log.access_file =3D &#39;&#39;</div><div class=3D"subprettyprint" st=
yle=3D"">log.error_file =3D &#39;&#39;</div><div class=3D"subprettyprint" s=
tyle=3D""><br></div><div class=3D"subprettyprint" style=3D"">[/]</div><div =
class=3D"subprettyprint" style=3D"">tools.trailing_slash.on =3D False</div>=
<div class=3D"subprettyprint" style=3D"">tools.staticdir.root =3D os.path.a=
bspath(os.getcwd())</div><div class=3D"subprettyprint" style=3D""><br></div=
><div class=3D"subprettyprint" style=3D"">[/html]</div><div class=3D"subpre=
ttyprint" style=3D"">tools.staticdir.on =3D True</div><div class=3D"subpret=
typrint" style=3D"">tools.staticdir.dir =3D &#39;./html&#39;,</div><div cla=
ss=3D"subprettyprint" style=3D"">tools.staticdir.index =3D &#39;index.html&=
#39;</div><div class=3D"subprettyprint" style=3D""><br></div><div class=3D"=
subprettyprint" style=3D"">[/css]</div><div class=3D"subprettyprint" style=
=3D"">tools.staticdir.on =3D True</div><div class=3D"subprettyprint" style=
=3D"">tools.staticdir.dir =3D &#39;./css&#39;</div></b></font></div></code>=
</div><br><br></div><div>If I leave only the [global] section in the conf f=
ile then the application starts.</div><div>So it seems something is wrong w=
ith the [/] and onwards part.</div><div><br></div><div>But what ? Any ideas=
 ?</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;cherrypy-users&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:cherrypy-users+unsubscribe-/[email protected]">cher=
rypy-users+unsubscribe-/[email protected]</a>.<br />
To post to this group, send email to <a href=3D"mailto:cherrypy-users@googl=
egroups.com">cherrypy-users-/[email protected]</a>.<br />
Visit this group at <a href=3D"https://groups.google.com/group/cherrypy-use=
rs">https://groups.google.com/group/cherrypy-users</a>.<br />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />

------=_Part_880_2089733584.1556118701967--

------=_Part_879_330636767.1556118701967--