Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

testsuite is broken (since datasette 0.54) #2

Closed
mfa opened this issue Apr 8, 2021 · 5 comments
Closed

testsuite is broken (since datasette 0.54) #2

mfa opened this issue Apr 8, 2021 · 5 comments

Comments

@mfa
Copy link
Owner

mfa commented Apr 8, 2021

Traceback (most recent call last):
  File "/home/mfa/.virtualenv/meinsack-datasette/lib/python3.9/site-packages/datasette/app.py", line 1125, in route_path
    response = await view(request, send)
  File "/home/mfa/.virtualenv/meinsack-datasette/lib/python3.9/site-packages/datasette/views/base.py", line 146, in view
    return await self.dispatch_request(                                                                                                                                                                             
  File "/home/mfa/.virtualenv/meinsack-datasette/lib/python3.9/site-packages/datasette/views/base.py", line 119, in dispatch_request
    await self.ds.refresh_schemas()                                                                       
  File "/home/mfa/.virtualenv/meinsack-datasette/lib/python3.9/site-packages/datasette/app.py", line 348, in refresh_schemas
    await internal_db.execute_write(
  File "/home/mfa/.virtualenv/meinsack-datasette/lib/python3.9/site-packages/datasette/database.py", line 102, in execute_write
    return await self.execute_write_fn(_inner, block=block)
  File "/home/mfa/.virtualenv/meinsack-datasette/lib/python3.9/site-packages/datasette/database.py", line 118, in execute_write_fn
    raise result
  File "/home/mfa/.virtualenv/meinsack-datasette/lib/python3.9/site-packages/datasette/database.py", line 139, in _execute_writes
    result = task.fn(conn)
  File "/home/mfa/.virtualenv/meinsack-datasette/lib/python3.9/site-packages/datasette/database.py", line 100, in _inner
    return conn.execute(sql, params or [])
sqlite3.InterfaceError: Error binding parameter 1 - probably unsupported type.

this is maybe related to the race condition @simonw mentions in simonw/datasette#1231

for testrun see: https://github.com/mfa/meinsack-datasette/runs/2301260026

@mfa
Copy link
Owner Author

mfa commented Apr 8, 2021

My testsuite runs fine with this change in https://github.com/simonw/datasette/

diff --git a/datasette/app.py b/datasette/app.py
index ee81642..d57d689 100644
--- a/datasette/app.py
+++ b/datasette/app.py
@@ -329,6 +329,9 @@ class Datasette:
         self.client = DatasetteClient(self)
 
     async def refresh_schemas(self):
+        if True:
+            return
+
         internal_db = self.databases["_internal"]
         if not self.internal_db_created:
             await init_internal_db(internal_db)

@mfa
Copy link
Owner Author

mfa commented Apr 8, 2021

The proposed change in simonw/datasette#1231 didn't help.

@mfa
Copy link
Owner Author

mfa commented Apr 8, 2021

tests run fine with datasette==0.53 and break with the introduction of _internal database (datasette 0.54)

@mfa mfa changed the title testsuite is broken (since datasette 0.54?) testsuite is broken (since datasette 0.54) Apr 8, 2021
@mfa
Copy link
Owner Author

mfa commented Apr 8, 2021

with pdb activated (and datasette 0.56):

Error binding parameter 1 - probably unsupported type.
> /home/mfa/.virtualenv/meinsack-datasette/lib/python3.9/site-packages/datasette/database.py(100)_inner()
-> return conn.execute(sql, params or [])
(Pdb) sql
'\n                INSERT OR REPLACE INTO databases (database_name, path, is_memory, schema_version)\n                VALUES (?, ?, ?, ?)\n            '
(Pdb) params
['meinsack', PosixPath('/home/mfa/git/meinsack-datasette/meinsack.db'), False, 35]

@mfa mfa closed this as completed in 6369c9e Apr 8, 2021
@mfa
Copy link
Owner Author

mfa commented Apr 8, 2021

fixed by casting PosixPath to str

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant