Search code examples
python-3.xwsgibottlecheroot

bottlepy throws TypeError after changing server to cheroot


When I tried to switching from the bottlepy standard server to cheroot with SSL and pass options I got:

Traceback (most recent call last):
  File "C:/Users/kig0pkt12/PycharmProjects/dreadnought/main.py", line 9, in <module>
    run(app, host='localhost', port=8080, debug=True, server='cheroot', options=options)
  File "C:\WP36\python-3.6.2rc2.amd64\lib\site-packages\bottle-0.13.dev0-py3.6.egg\bottle.py", line 3713, in run
    server.run(app)
  File "C:\WP36\python-3.6.2rc2.amd64\lib\site-packages\bottle-0.13.dev0-py3.6.egg\bottle.py", line 3298, in run
    server = wsgi.Server(**self.options)
TypeError: __init__() got an unexpected keyword argument 'options'

Snippet main.py:

from bottle import Bottle, run
app = Bottle()

options = {
'certfile':'cacert.pem',
'keyfile':'privkey.pem',
}

run(app, host='localhost', port=8080, debug=True, server='cheroot', options=options)

Solution

  • Well, looks like options changed:

    run(app, host='localhost', port=8080, debug=True, server="cheroot", certfile="cacert.pem", keyfile="privkey.pem")