Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scraperwiki.sqlite.save_var / .get_var wierdness (poorly defined) #11

Closed
scraperdragon opened this issue Nov 13, 2012 · 1 comment
Closed

Comments

@scraperdragon
Copy link
Contributor

import scraperwiki
print scraperwiki.sqlite.get_var('jam')
scraperwiki.sqlite.save_var('bacon',12)
print scraperwiki.sqlite.get_var('bacon')

If run once, correctly gives:

None
12

If run twice, fails with:

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    print scraperwiki.sqlite.get_var('jam')
  File "/usr/local/lib/python2.7/dist-packages/scraperwiki/sqlite.py", line 73, in get_var
    dt.execute(u"CREATE TABLE %s (`value` blob, `type` text, `key` text PRIMARY KEY)" % dt._DumpTruck__vars_table, commit = False)
  File "/usr/local/lib/python2.7/dist-packages/dumptruck/dumptruck.py", line 115, in execute
    self.cursor.execute(sql, *args)
sqlite3.OperationalError: table _dumptruckvars already exists
@scraperdragon
Copy link
Contributor Author

fixed? in 24944dd

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

No branches or pull requests

1 participant