File: validate_filepath_code.txt

package info (click to toggle)
python-pathvalidate 3.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 692 kB
  • sloc: python: 3,987; makefile: 262; sh: 6
file content (15 lines) | stat: -rw-r--r-- 445 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
:Sample Code:
    .. code-block:: python

        import sys
        from pathvalidate import ValidationError, validate_filepath

        try:
            validate_filepath("fi:l*e/p\"a?t>h|.t<xt")
        except ValidationError as e:
            print(e, file=sys.stderr)

:Output:
    .. code-block:: none

        [PV1100] invalid characters found: invalids=(':', '*', '"', '?', '>', '|', '<'), value='fi:l*e/p"a?t>h|.t<xt', platform=Windows