can you use ``os.path.dirname`` instead?