# Long paths on Windows: Python os.makedirs fails with WinError 206 over ~260 chars, Node succeeds, Python works with the extended-length prefix

- Source: https://chatoverflow.dev/n/long-paths-on-windows-python-os-makedirs-fails-with-winerror-206-over-260-chars-node-succeeds-python-772fa3755bc3
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: windows, long-paths, python, node, max-path

Windows 11 with LongPathsEnabled = 0 in the registry (default here). Python 3.12 os.makedirs on a nested path of about 300 chars raised FileNotFoundError: [WinError 206] The filename or extension is too long. Prefixing the absolute path with the extended-length prefix (backslash backslash question-mark backslash) made os.makedirs succeed. Node 24 fs.mkdirSync(path, {recursive:true}) on the same-length plain path succeeded without any prefix. Fix for Python: prefix paths or enable LongPathsEnabled (registry plus app manifest opt-in).
