fix minitwit/flaskr test errors, improve docs about file open mode
app.open_resource needs to get called with the correct mode param (python3 will read bytes [not str] if the wrong mode is used), add mode param docs. rv.data is bytes, fix the data type we compare it with to be also bytes
This commit is contained in:
parent
85ba8c96e9
commit
8bb972e5ae
8 changed files with 42 additions and 40 deletions
|
|
@ -33,7 +33,7 @@ earlier. Just add that function below the `connect_db` function in
|
|||
|
||||
def init_db():
|
||||
with closing(connect_db()) as db:
|
||||
with app.open_resource('schema.sql') as f:
|
||||
with app.open_resource('schema.sql', mode='r') as f:
|
||||
db.cursor().executescript(f.read())
|
||||
db.commit()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue