acarrillo: @sloretz yup looks good thanks for the quick fix! :+1: Performed an editable `rosdep` install from source and was able to `rosdep update`
```
acarrillo $ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit file:///etc/ros/rosdep/farmwise.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Add distro "crystal"
Add distro "dashing"
Add distro "eloquent"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Add distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
updated cache in /home/acarrillo/.ros/rosdep/sources.cache

```
codecov-io: # [Codecov](https://codecov.io/gh/ros-infrastructure/rosdep/pull/721?src=pr&el=h1) Report
> Merging [#721](https://codecov.io/gh/ros-infrastructure/rosdep/pull/721?src=pr&el=desc) into [master](https://codecov.io/gh/ros-infrastructure/rosdep/commit/d812436fd7c0716280818f5ca8ae7d2a7166ae3f?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `66.66%`.

[![Impacted file tree graph](https://codecov.io/gh/ros-infrastructure/rosdep/pull/721/graphs/tree.svg?width=650&token=YdnUPit6vO&height=150&src=pr)](https://codecov.io/gh/ros-infrastructure/rosdep/pull/721?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #721      +/-   ##
==========================================
+ Coverage   76.03%   76.04%   +<.01%     
==========================================
  Files          40       40              
  Lines        3126     3127       +1     
==========================================
+ Hits         2377     2378       +1     
  Misses        749      749
```


| [Impacted Files](https://codecov.io/gh/ros-infrastructure/rosdep/pull/721?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/rosdep2/main.py](https://codecov.io/gh/ros-infrastructure/rosdep/pull/721/diff?src=pr&el=tree#diff-c3JjL3Jvc2RlcDIvbWFpbi5weQ==) | `49.36% <0%> (ø)` | :arrow_up: |
| [src/rosdep2/meta.py](https://codecov.io/gh/ros-infrastructure/rosdep/pull/721/diff?src=pr&el=tree#diff-c3JjL3Jvc2RlcDIvbWV0YS5weQ==) | `100% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/ros-infrastructure/rosdep/pull/721?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/ros-infrastructure/rosdep/pull/721?src=pr&el=footer). Last update [d812436...e91b931](https://codecov.io/gh/ros-infrastructure/rosdep/pull/721?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

diff --git a/src/rosdep2/main.py b/src/rosdep2/main.py
index 1b6b816..764ddad 100644
--- a/src/rosdep2/main.py
+++ b/src/rosdep2/main.py
@@ -402,7 +402,7 @@ def _rosdep_main(args):
 
     if 'ROS_PYTHON_VERSION' not in os.environ and 'ROS_DISTRO' in os.environ:
         # Set python version to version used by ROS distro
-        python_versions = MetaDatabase().get('ROS_PYTHON_VERSION')
+        python_versions = MetaDatabase().get('ROS_PYTHON_VERSION', default=[])
         if os.environ['ROS_DISTRO'] in python_versions:
             os.environ['ROS_PYTHON_VERSION'] = str(python_versions[os.environ['ROS_DISTRO']])
 
diff --git a/src/rosdep2/meta.py b/src/rosdep2/meta.py
index 29bd317..b8cd900 100644
--- a/src/rosdep2/meta.py
+++ b/src/rosdep2/meta.py
@@ -102,7 +102,7 @@ class MetaDatabase:
         write_cache_file(self._cache_dir, category, wrapper)
         self._loaded[category] = wrapper
 
-    def get(self, category):
+    def get(self, category, default=None):
         """Return metadata in the cache, or None if there is no cache entry."""
         if category not in self._loaded:
             self._load_from_cache(category, self._cache_dir)
@@ -110,6 +110,8 @@ class MetaDatabase:
         if category in self._loaded:
             return self._loaded[category].data
 
+        return default
+
     def _load_from_cache(self, category, cache_dir):
         filename = compute_filename_hash(category) + PICKLE_CACHE_EXT
         try:

`rosdep resolve` on version 0.16.2 yields `TypeError`
I installed `rosdep` from PyPI. `rosdep resolve` yields the failing the stack trace below:
```
acarrillo ~ $ rosdep resolve

ERROR: Rosdep experienced an error: argument of type 'NoneType' is not iterable
Please go to the rosdep page [1] and file a bug report with the stack trace below.
[1] : http://www.ros.org/wiki/rosdep

rosdep version: 0.16.2

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/rosdep2/main.py", line 144, in rosdep_main
    exit_code = _rosdep_main(args)
  File "/usr/local/lib/python2.7/dist-packages/rosdep2/main.py", line 406, in _rosdep_main
    if os.environ['ROS_DISTRO'] in python_versions:
TypeError: argument of type 'NoneType' is not iterable
```
diff --git a/test/test_metadata.py b/test/test_metadata.py
index 0caf844..424a5ac 100644
--- a/test/test_metadata.py
+++ b/test/test_metadata.py
@@ -65,6 +65,14 @@ def test_metadatabase_get_none():
         assert db.get('fruit') is None
 
 
+def test_metadatabase_get_default():
+    with TemporaryDirectory() as tmpdir:
+        db = MetaDatabase(cache_dir=tmpdir)
+        assert db.get('fruit', default='foo') == 'foo'
+        db.set('fruit', 'tomato')
+        assert db.get('fruit', default='foo') != 'foo'
+
+
 def test_metadatabase_get_mutate_get():
     with TemporaryDirectory() as tmpdir:
         db = MetaDatabase(cache_dir=tmpdir)

pip install -e .[dev]
parse_log_pytest
requirements.txt
nose coverage flake8 mock codecov pytest
apt-get update apt-get install -y gcc
3.6
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
catkin-pkg==1.0.0
certifi==2021.5.30
charset-normalizer==2.0.12
codecov==2.1.13
coverage==6.2
docutils==0.18.1
flake8==5.0.4
idna==3.10
importlib-metadata==4.2.0
iniconfig==1.1.1
mccabe==0.7.0
mock==5.2.0
nose==1.3.7
packaging==21.3
pluggy==1.0.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
pyparsing==3.1.4
pytest==7.0.1
python-dateutil==2.9.0.post0
PyYAML==6.0.1
requests==2.27.1
-e git+https://github.com/ros-infrastructure/rosdep.git@d812436fd7c0716280818f5ca8ae7d2a7166ae3f#egg=rosdep
rosdistro==1.0.1
rospkg==1.6.0
six==1.17.0
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: rosdep
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - catkin-pkg==1.0.0
      - charset-normalizer==2.0.12
      - codecov==2.1.13
      - coverage==6.2
      - docutils==0.18.1
      - flake8==5.0.4
      - idna==3.10
      - importlib-metadata==4.2.0
      - iniconfig==1.1.1
      - mccabe==0.7.0
      - mock==5.2.0
      - nose==1.3.7
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - pyyaml==6.0.1
      - requests==2.27.1
      - rosdistro==1.0.1
      - rospkg==1.6.0
      - six==1.17.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/rosdep

test/test_metadata.py::test_metadatabase_get_default
test/test_metadata.py::test_metadatabase_set_get test/test_metadata.py::test_metadatabase_get_none test/test_metadata.py::test_metadatabase_get_mutate_get test/test_metadata.py::test_metadatabase_set_set_get test/test_metadata.py::test_metadatabase_set_load_from_disk_get
src/rosdep2/meta.py src/rosdep2/main.py
src/rosdep2/meta.py src/rosdep2/main.py