Comments (5)
In #3 I reported that everything was working fine for me. Now I'm getting a setfault every time I try to run register().
What has changed? What's different between then and now? I would expect any such problem to be deterministic. In other words, I would expect something important must have changed between when you had it working and now.
from sqlite-vtfunc.
From the stack-trace it looks like sqlite3_create_module()
is getting passed a null pointer, but I'm not clear what might be causing that.
from sqlite-vtfunc.
This is the thing that baffles me: I'm reasonably sure I'm running the exact same sequence of commands that I described in #2 and #3 but I'm now getting a different result. I don't think I've upgraded my system Python or anything like that. It's really weird.
I notice that in #2 (comment) I installed the module and checked that it could be imported but did not attempt to use it. But I'm certain I saw the scraper example work with 0.3.3
yesterday (though I don't think I recorded a full Python shell transcript). And now I can't get it to work at all.
At least this time I've been able to get a stacktrace out of it. I wish I could answer your question about "what has changed" - because obviously something has, but I'm at a loss for what it is.
from sqlite-vtfunc.
Here's my current full steps-to-reproduce:
$ python3 -mvenv vtfunc-0-3-3
$ source vtfunc-0-3-3/bin/activate
$ pip install vtfunc
$ pip install requests
$ python
import re, sqlite3
from vtfunc import TableFunction
class Scraper(TableFunction):
params = ['url'] # Function argument names.
columns = ['href', 'description'] # Result rows have these columns.
name = 'scraper' # Name we use to invoke the function from SQL.
def initialize(self, url):
# Note that this is bytes:
self.html = requests.get(url).content
self._iter = re.finditer(
'<a[^\>]+?href="([^\"]+?)"[^\>]*?>([^\<]+?)</a>',
self.html)
def iterate(self, idx):
return next(self._iter).groups()
conn = sqlite3.connect(':memory:')
Scraper.register(conn)
This dies with Segmentation fault: 11
from sqlite-vtfunc.
Huh... I appear to have fixed it! I used the above steps but I swapped out pip install vtfunc
for this:
pip install --no-cache-dir vtfunc
The above example no longer segfaults.
from sqlite-vtfunc.
Related Issues (12)
- Pre-generated C file fails to build, missing _pysqlite/connection.h HOT 16
- Looking for sqlite.h HOT 2
- expecting bytes, NoneType found HOT 1
- Consider merging this functionality into pysqlite HOT 1
- Install on Mac 12.5.1 / Py 3.10.6 Fails HOT 3
- vtfunc.c is missing so setup.py install fails HOT 4
- Python segfault crashes if a initialize() method throws an exception HOT 4
- Returning anything other than a tuple from iterate() throws unhelpful "OperationalError: SQL logic error" HOT 3
- Here's what I've been building HOT 11
- Document the minimum required version of SQLite HOT 2
- Feature request: if possible, support variable column definitions? HOT 1
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 sqlite-vtfunc.