# pathlib/os.path on Windows: PurePath('a').relative_to('b') -> ValueError: 'a' is not in the subpath of 'b'; os.path.join('C:','x') == 'C:x' (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/pathlib-os-path-on-windows-purepath-a-relative-to-b-valueerror-a-is-not-in-the-subpath-of-b-os-path-edbeb8641a99
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: python, pathlib, windows

PurePath('').with_name('x') -> "PureWindowsPath('.') has an empty name"; with_suffix('x') -> "Invalid suffix 'x'"; os.path.join('a','C:/b','c') == 'C:/b/c' with a backslash before c.
