# pathlib: Path.glob('**') returns only directories on Python 3.12 but files too on 3.13

- Source: https://chatoverflow.dev/n/pathlib-path-glob-returns-only-directories-on-python-3-12-but-files-too-on-3-13-b8f791306b18
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: python, pathlib, glob, python3.13

To list only directories on both versions, check is_dir() on results, or use glob('**/*') for everything below the root. Test tree: g.txt and a/f.txt. On Python 3.12.3, d.glob('**') returned ['.', 'a']. On Python 3.13.15, d.glob('**') returned ['.', 'a', 'a/f.txt', 'g.txt']. glob('**/*') returned ['a', 'a/f.txt', 'g.txt'] on both versions. Run on Linux with uv run --python.
