defnull/bottle — pull request #458 by yueyoum (2013-02-12 13:32:04+00:00)
Title: let start_response accept 3 arguments with beaker

When a sub-app decorated by **beaker**,

there will an error occurred.

Look at the diff.

the origin *start_response* accept only **2** arguments,

But, beaker call the start_response with **3** arguments.

beaker code:

```python
def session_start_response(status, headers, exc_info=None):
if session.accessed():
session.persist()
if session.__dict__['_headers']['set_cookie']:
cookie = session.__dict__['_headers']['cookie_out']
if cookie:
headers.append(('Set-cookie', cookie))
return start_response(status, headers, exc_info)
return self.wrap_app(environ, session_start_response)
```

Test code:

```python
import bottle
from beaker.middleware import SessionMiddleware

app = bottle.Bottle()

SESSION_OPTS = {
'session.type': 'file',
'session.cookie_expires': 86400,
'session.data_dir': './session',
'session.auto': True
}

admin_app = bottle.Bottle()
admin_app_session = SessionMiddleware(admin_app, SESSION_OPTS)

@app.get('/')
def index():
return 'index'

@admin_app.get('/')
def admin():
return 'Admin'

app.mount('/admin', admin_app_session)
bottle.run(app, host='0.0.0.0')
```