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
The root of the problem seems to be that even on a non-windows platform the backslash is treated as a path separator character, leading to false absolute path detections. The following script demonstrates the problem with a few examples:
>>> from pathvalidate import validate_filename, ValidationError
>>> for name in ["\\", "\\\\", "\\", "C:\\", "c:\\", "\\xyz", "\\xyz "]:
... try:
... validate_filename(name, platform="linux")
... except ValidationError as e:
... print(e.reason, "for", repr(name))
... else:
... raiseException("did not raise for %r"% (name,))
...
ErrorReason.FOUND_ABS_PATH for '\\'
ErrorReason.FOUND_ABS_PATH for '\\\\'
ErrorReason.FOUND_ABS_PATH for '\\ '
ErrorReason.FOUND_ABS_PATH for 'C:\\'
ErrorReason.FOUND_ABS_PATH for 'c:\\'
ErrorReason.FOUND_ABS_PATH for '\\xyz'
ErrorReason.FOUND_ABS_PATH for '\\xyz '
I'm on Linux 5.11.10, I don't know if such file names are also valid for MacOS or not.
The text was updated successfully, but these errors were encountered:
The root of the problem seems to be that even on a non-windows platform the backslash is treated as a path separator character, leading to false absolute path detections. The following script demonstrates the problem with a few examples:
I'm on Linux
5.11.10
, I don't know if such file names are also valid for MacOS or not.The text was updated successfully, but these errors were encountered: