MCPcopy Create free account
hub / github.com/pytest-dev/pytest / get_extended_length_path_str

Function get_extended_length_path_str

src/_pytest/pathlib.py:135–144  ·  view source on GitHub ↗

Convert a path to a Windows extended length path.

(path: str)

Source from the content-addressed store, hash-verified

133
134
135def get_extended_length_path_str(path: str) -> str:
136 """Convert a path to a Windows extended length path."""
137 long_path_prefix = "\\\\?\\"
138 unc_long_path_prefix = "\\\\?\\UNC\\"
139 if path.startswith((long_path_prefix, unc_long_path_prefix)):
140 return path
141 # UNC
142 if path.startswith("\\\\"):
143 return unc_long_path_prefix + path[2:]
144 return long_path_prefix + path
145
146
147def rm_rf(path: Path) -> None:

Callers 2

Calls

no outgoing calls

Tested by 1