Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name of only whitespace erroneously fails validation on linux #15

Closed
Traktormaster opened this issue Nov 12, 2020 · 1 comment
Closed
Assignees
Labels

Comments

@Traktormaster
Copy link

File names that consist of whitespace characters only are valid on my system. I'm on Linux 5.9.6, I don't know if such file names are also valid for MacOS or not.

>>> validate_filename("  ", platform="linux")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/joe/.venv/lib/python3.8/site-packages/pathvalidate/_filename.py", line 249, in validate_filename
    FileNameValidator(
  File "/home/joe/.venv/lib/python3.8/site-packages/pathvalidate/_filename.py", line 134, in validate
    validate_pathtype(value)
  File "/home/joe/.venv/lib/python3.8/site-packages/pathvalidate/_common.py", line 41, in validate_pathtype
    raise ValidationError(
pathvalidate.error.ValidationError: reason=NULL_NAME, description=the value must be a not empty
@thombashi
Copy link
Owner

Thank you for your report.

file name/path that consists only whitespaces are now accepted with pathvalidate 2.3.1.

>>> from pathvalidate import validate_filename
>>> validate_filename("  ", platform="linux")
>>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants