Hello, I'm (still) struggling with adbapi + sqlite3. In short: I'm able to create tables and successfully write entries, but I'm unable to retrieve said entries. If it's a concurrency issue, I don't see where it is... Could someone please have a look at my question on SO? Thanks! https://stackoverflow.com/q/44160375/1156707
__marco has quit
oberstet2 has quit
cdunklau
blz: what is the output from the trial test run?
blz: and what's TestCase? is that twisted.trial.unittest.TestCase?
b3h3m0th joined the channel
blz: i can't run that, dunno what mk_dummy_inode should be
oberstet2 joined the channel
blz: okay, i hacked together an implementation for it, and fixed the other nameerrors and stuff, and it passes for me
blz: what version of twisted, what python version?
blz: i did it on python 2.7.9 and the latest twisted
cdunklau: I'm going to try to reproduce with your gist because I've in my attempts to fix it, I've realized that commenting out certain tests causes others to function ... which is a bit odd...
cdunklau: pickle
cdunklau
aaaaah noooo
blz
cdunklau: man I did a bang-up job with my examples. Sorry about that!
cdunklau
heh
blz
cdunklau: pickle vs json shouldn't change much, though, should it?
cdunklau
blz: not for this test, but storing pickles is a terrifying thought
blz
cdunklau: gawd yeah, I know
cdunklau: It shouldn't matter too much insofar as this is just being locally stored. It's not travelling down the wire or anything, but it's still ugly as sin
cdunklau
blz: security isn't the only problem with pickle
blz
cdunklau: what did you have in mind? I'm in a position where I can definitely convince the bossman to change it, and it sounds like there's good reason to do so
cdunklau
store data, not code
blz: use a reasonable serialization format. json, xml, protobuf, capnproto, etc
blz
Right, but what's the immediate risk/problem for an application that's exclusively reading from the db in questino?
cdunklau
blz: you will load old code
blz
Yeah, if it had been me, I would have definitely gone with json (or something similar)
cdunklau: and? I'm not trying to be contrarian -- it's just that I need to express the problem in a clear an articulable manner if I'm going to convinve anyone in the office.
cdunklau
blz: pickle gets really hairy if you try to unpickle an object of which the implementation has changed since you pickled it
blz
Their initial reaction will be "it works right now"\
Ah okay, like changing python versions and discovering that the dict implementation changed?
cdunklau: I'm sorry to do this, but I could really use a fresh set of eyes. Do you see anything different/wrong in the actual (i.e.: non-example) test code? https://hastebin.com/ohunidutah.py
You should just be able to clone & checkout the dev branch, then `python setup.py develop`, then `trial pydio`.
cdunklau
blz: hmmm.... take out the `del self.d`
blz
cdunklau: done, no change.
cdunklau
blz: and when you comment out the rmtree(self.meta) and actually check the db manually after the test fails, the row is there, right?
blz
Yes. The way I checked previously was to set a breakpoint right before the runQuery statement and check if the row exists, but I'll check it your way as well.