[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-bugs] #33825 [Core Tor/Chutney]: Make Environ handle "in" and "get()" like a dict



#33825: Make Environ handle "in" and "get()" like a dict
-------------------------+-------------------------------------------------
     Reporter:  teor     |      Owner:  (none)
         Type:  defect   |     Status:  new
     Priority:  Medium   |  Milestone:
    Component:  Core     |    Version:
  Tor/Chutney            |   Keywords:  ipv6, outreachy-ipv6, technical-
     Severity:  Normal   |  debt
Actual Points:           |  Parent ID:  #33050
       Points:  1        |   Reviewer:
      Sponsor:           |
  Sponsor55-can          |
-------------------------+-------------------------------------------------
 Some standard Python dict code doesn't work on chutney's Environ class:
 {{{
 is_in_env = 'foo' in self._env
 value_or_none = self._env.get('foo')
 }}}

 "in" should return a boolean, and "get()" should return the value (or
 None).

 But instead, when the key is missing, sometimes they throw a KeyError. (It
 seems to happen in certain contexts, but not others.)

 We should work out if Environ is missing some of the required dict
 implementation functions. Or if there is some issue with Environ's lookup
 code.

 Then we should implement unit tests, to make sure we don't break Environ
 in future.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/33825>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs