Return the absolute version of a path as a fallback function in case `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for more.
(path)
| 544 | |
| 545 | |
| 546 | def _abspath_fallback(path): |
| 547 | """Return the absolute version of a path as a fallback function in case |
| 548 | `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for |
| 549 | more. |
| 550 | |
| 551 | """ |
| 552 | |
| 553 | path = os.fspath(path) |
| 554 | if not isabs(path): |
| 555 | if isinstance(path, bytes): |
| 556 | cwd = os.getcwdb() |
| 557 | else: |
| 558 | cwd = os.getcwd() |
| 559 | path = join(cwd, path) |
| 560 | return normpath(path) |
| 561 | |
| 562 | # Return an absolute path. |
| 563 | try: |