# Buggy code
def getargv_install_command(self, name, default="", replace=True):
    s = self.getstring(name, default, replace=False)
    if not s:
        # This occurs when factors are used, and a testenv doesnt have
        # a factorised value for install_command, most commonly occurring
        # if setting platform is also used.
        # An empty value causes error install_command must contain '{packages}'.
        s = default

    if "{packages}" in s:
        s = s.replace("{packages}", r"\{packages\}")
    if "{opts}" in s:
        s = s.replace("{opts}", r"\{opts\}")

    return _ArgvlistReader.getargvlist(self, s, replace=replace)[0]


# Traceback (AttributeError)
tox -vv
using tox.ini: /home/jayvdb/projects/tox/my-tox-tests/tests/tox.ini (pid 23538)
removing /home/jayvdb/projects/tox/my-tox-tests/tests/.tox/log
[wikimedia] tox-wikimedia is enabled
Traceback (most recent call last):
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/bin/tox", line 8, in <module>
sys.exit(cmdline())
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/tox/session/__init__.py", line 44, in cmdline
main(args)
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/tox/session/__init__.py", line 65, in main
config = load_config(args)
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/tox/session/__init__.py", line 81, in load_config
config = parseconfig(args)
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/tox/config/__init__.py", line 281, in parseconfig
pm.hook.tox_configure(config=config)  # post process config object
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
return outcome.get_result()
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/home/jayvdb/.cache/tox/my-tox-tests/py38-tox3_20-other/lib/python3.8/site-packages/tox_wikimedia/__init__.py", line 93, in tox_configure
if dep in cdep.name:
AttributeError: 'str' object has no attribute 'name'

# Fixed code
def getargv_install_command(self, name, default="", replace=True):
    s = self.getstring(name, default, replace=False)
    if not s:
        # This occurs when factors are used, and a testenv doesnt have
        # a factorised value for install_command, most commonly occurring
        # if setting platform is also used.
        # An empty value causes error install_command must contain '{packages}'.
        s = default

    if "{packages}" in s:
        s = s.replace("{packages}", r"\{packages\}")
    if "{opts}" in s:
        s = s.replace("{opts}", r"\{opts\}")

    return _ArgvlistReader.getargvlist(self, s, replace=replace, name=name)[0]