Build a platform-correct absolute query path without normalizing it. On Windows, leading-slash paths are drive-rooted but Python 3.13 no longer treats them as absolute. Prefix the current drive so explicit path queries stay absolute while preserving raw segments such as ``..
(path: str, trailing_sep: bool = False)
| 317 | |
| 318 | @staticmethod |
| 319 | def abs_query_path(path: str, trailing_sep: bool = False) -> str: |
| 320 | """Build a platform-correct absolute query path without normalizing it. |
| 321 | |
| 322 | On Windows, leading-slash paths are drive-rooted but Python 3.13 no |
| 323 | longer treats them as absolute. Prefix the current drive so explicit |
| 324 | path queries stay absolute while preserving raw segments such as ``..``. |
| 325 | """ |
| 326 | if os.path.__name__ == "ntpath" and path.startswith("/"): |
| 327 | drive, _ = os.path.splitdrive(os.fsdecode(util.normpath(os.sep))) |
| 328 | path = drive + path |
| 329 | |
| 330 | path = path.replace("/", os.sep) |
| 331 | if trailing_sep: |
| 332 | path = os.path.join(path, "") |
| 333 | return path.replace("\\", "\\\\") |
| 334 | |
| 335 | @pytest.fixture(scope="class") |
| 336 | def lib(self, helper): |
no test coverage detected