[tor-bugs] #33191 [Applications/GetTor]: Move from twisted adbapi to sqlite3 for GetTor

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Feb 14 22:30:01 UTC 2020


#33191: Move from twisted adbapi to sqlite3 for GetTor
---------------------------------+--------------------------------
 Reporter:  cohosh               |          Owner:  cohosh
     Type:  task                 |         Status:  needs_revision
 Priority:  Medium               |      Milestone:
Component:  Applications/GetTor  |        Version:
 Severity:  Normal               |     Resolution:
 Keywords:                       |  Actual Points:
Parent ID:                       |         Points:  .5
 Reviewer:  hiro                 |        Sponsor:
---------------------------------+--------------------------------

Comment (by cohosh):

 @meejah

 Alright, this is the trouble I was running into before. Here's a very
 simple database test (doesn't assert any values, just calls one of the
 database functions):
 https://dip.torproject.org/cohosh/gettor/blob/ticket/33191v2/tests/test_db.py

 If I checkout out this branch and run it using

 {{{
 $ python3 scripts/create_db -n -c -o -f tests/gettor.db
 $ python3 scripts/add_links_to_db -f tests/gettor.db
 $ pytest-3 tests/
 }}}

 It hangs indefinitely. Any ideas on what's going wrong here? The test
 behaves very similarly to how this function is actually called in the code
 [https://dip.torproject.org/cohosh/gettor/blob/ticket/33191v2/gettor/parse/email.py#L170
 here]:

 {{{
     @defer.inlineCallbacks
     def get_locales(self):
         dbname = self.settings.get("dbname")
         conn = SQLite3(dbname)

         locales = yield conn.get_locales()
         for l in locales:
             self.locales.append(l[0])
 }}}

 And I get the same results if I try using the [https://pypi.org/project
 /pytest-twisted/ pytest-twisted] library as follows:

 {{{
 @pytest_twisted.inlineCallbacks
     def test_stored_locales(self):
         locales = yield self.conn.get_locales()
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/33191#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list