Comments (3)
The issue is still present, and the fix above still works in datasette version 1.0a3
from datasette.
Looking into coming up with a fix instead of a patch, (see above.)
When I run with the released code, but add a print statement to see what the value of [extension]
is I get back:
['/usr/lib/x86_64-linux-gnu/mod_spatialite.so']
Which matches the input argurment to the datasette command:
c
but I'm on a Windows box, so let's go wtih:
python3 -m datasette rm_toucans.db --metadata qso_loc.yml --load-extension=C:\Windows\System32\mod_spatialite.dll --plugins-dir=plugins --template-dir plugins/templates --root
That resulted in no output whatsoever. I'm going to try wrapping the path in double quotes since I'm on Windows.
Nope, still no output. Let's try a Linux style path with double quotes.
With a Linux style path, I get the same error.
I get the same error without the double quotes.
Here's part of the issue:
`# The --load-extension parameter can optionally include a specific entrypoint.
This is done by appending ":entrypoint_name" after supplying the path to the extension
class LoadExtension(click.ParamType):
name = "path:entrypoint?"
def convert(self, value, param, ctx):
print("loadex " + value)
if ":" not in value:
return value
path, entrypoint = value.split(":", 1)
return path, entrypoint
`
Notice the dependency on ':' in that block of code from /utils/Init.py.
Since Windows paths have 'C:' routinely, that's an issue.
No fix yet.
from datasette.
And here's the proposed fix. I still need to for and do a pull request and all that good stuff, but the fix in /utils/init.py should be:
The following in the LoadExtension class:
#:\ indicates we're on a Windows machine study the argument a bit more
if ":\\" in r"%r" % value:
path_entry = value.split(":", 2)
if len(path_entry) < 3:
return value
#argument contains a Windows/DOS path and an entry point
path = path_entry[0] + ":" + path_entry[1]
entrypoint = path_entry[-1]
return path, entrypoint
if ":" not in value:
return value
path, entrypoint = value.split(":", 1)
return path, entrypoint
To make things even spiffier, add the (somewhat standard?) landing path for the spatialite dll on Windows:
ala
SPATIALITE_PATHS = (
"/usr/lib/x86_64-linux-gnu/mod_spatialite.so",
"/usr/local/lib/mod_spatialite.dylib",
"/usr/local/lib/mod_spatialite.so",
"/opt/homebrew/lib/mod_spatialite.dylib",
"C:\Windows\System32\mod_spatialite.dll",
)
from datasette.
Related Issues (20)
- `json1` SQLite extension is not correctly detected in `versions.json`
- `Stable` documentation refers to `latest` demo instance
- get_metadata() plugin hook should support async await_me_maybe pattern HOT 2
- Datasette 1.0 rc tracking issue
- Usablity issue with need for root user
- Consider releasing a 0.65 with some forwards compatibility for 1.0 HOT 2
- Bug (in docs?): the "_internal" table on latest.datasette.io doesn't load HOT 1
- Consider adding a new plugin hook: "pre_query" or similar HOT 3
- Proposal - store metadata inside `internal.db` tables HOT 2
- Broken link in documention: fivethirtyeight.datasettes.com
- Fix font size on filter inputs
- base_url getting appended twice in redirects when applying filters? HOT 3
- Accessibility: add a `lang` attribute to `html` HOT 1
- What minimal SQLite version should Datasette support? HOT 9
- Remove upserts in `set_XXX_metadata()` methods
- PyOdide test failure HOT 7
- Canned queries with named parameters fail with error against SQLite 3.46.0 HOT 11
- derive_named_parameters() method that works with latest SQLite HOT 5
- Flaky test_max_csv_mb test HOT 3
- Very weird flaky test_create_table_ignore_replace and test_upsert tests HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datasette.