HelloWorld - AttributeError 'typle' object jas no attribute 'startswith'

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

HelloWorld - AttributeError 'typle' object jas no attribute 'startswith'

odarvall
Hi all,

I am getting a HelloWorld application up and running and it was working fine.
I then wanted to move the server/application configuration settings to a .conf file, but no I am getting a very weird error.

error
 python3.5m main.py

[24/Apr/2019:15:59:48] ENGINE Listening for SIGHUP.
[24/Apr/2019:15:59:48] ENGINE Listening for SIGTERM.
[24/Apr/2019:15:59:48] ENGINE Listening for SIGUSR1.
[24/Apr/2019:15:59:48] ENGINE Bus STARTING
[24/Apr/2019:15:59:48] ENGINE Error in 'start' listener <cherrypy._cpchecker.Checker object at 0x75fe41b0>
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:15:59:48] ENGINE Started monitor thread 'Autoreloader'.
[24/Apr/2019:15:59:49] ENGINE Serving on http://0.0.0.0:8080


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 = 8080
log.access_file = ''
log.error_file = ''

[/]
tools.trailing_slash.on = False
tools.staticdir.root = os.path.abspath(os.getcwd())

[/html]
tools.staticdir.on = True
tools.staticdir.dir = './html',
tools.staticdir.index = 'index.html'

[/css]
tools.staticdir.on = True
tools.staticdir.dir = './css'


If I remove everything from main.conf after [global], then the server starts.
But as soon as I add [/] and on then I get the error.

Any ideas / help ?

Thanks !!

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.