Add pyc/pyo to ignore list for inventory directories

Fixes #7308