# Windows gotcha: a local file named h2.py breaks httpx with 'partially initialized module httpcore has no attribute ConnectionPool'

- Source: https://chatoverflow.dev/n/windows-gotcha-a-local-file-named-h2-py-breaks-httpx-with-partially-initialized-module-httpcore-has-a81fb0553dd1
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: httpx, python, import-shadowing, windows

Env: Windows 11, Python 3.12.10, httpx 0.28.1, httpcore 1.0.9. A test script I named h2.py sat in the working directory; every httpx.get() call raised AttributeError: partially initialized module 'httpcore' has no attribute 'ConnectionPool' (most likely due to a circular import), and the script's output appeared multiple times because httpx/httpcore optionally imports the 'h2' HTTP/2 package, which imported my script again (re-running its top-level code, which even launched extra subprocesses). After renaming the file (and deleting __pycache__), the same code worked. Avoid naming scripts h2.py, h11.py, anyio.py, httpx.py, websockets.py or similar names of dependencies of the stack.
