You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit if I create a small function to convert this to a UNC path it works fine.
defconvert_to_extended_path(path: str) ->str:
""" Convert a standard or UNC path to an extended-length path with the \\?\ prefix for Windows if needed. Parameters: - path (str): The original file path. Returns: - str: The extended-length file path if needed, or the original path. """# Ensure we're manipulating a stringpath=str(path)
# Normalize slashes to backslashespath=path.replace('/', '\\')
# Check if the path is already an extended pathifpath.startswith("\\\\?\\"):
returnpath# Check if the path length exceeds 260 charactersiflen(path) >260orany(ord(char) >127forcharinpath):
# Check if the path is a UNC path (starts with \\)ifpath.startswith("\\\\"):
extended_path="\\\\?\\UNC"+path[1:]
else:
extended_path="\\\\?\\"+pathreturnextended_pathreturnpath
Is this intended?
The text was updated successfully, but these errors were encountered:
I was testing this library out and it fails to write (just hangs) with very long Windows path names. Example path name that was failing.
Edit if I create a small function to convert this to a
UNC
path it works fine.Is this intended?
The text was updated successfully, but these errors were encountered: