Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C Chutney
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 44
    • Issues 44
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • Chutney
  • Issues
  • #33825
Closed
Open
Created Apr 06, 2020 by teor@teor

Make Environ handle "in" and "get()" like a dict

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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking