---
source: crates/ruff_linter/src/rules/flake8_use_pathlib/mod.rs
---
PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:22:1
   |
20 | ### Errors
21 | path.with_suffix(".")
22 | path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^
23 | path.with_suffix(r"s")
24 | path.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
21 | path.with_suffix(".")
   - path.with_suffix("py")
22 + path.with_suffix(".py")
23 | path.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:23:1
   |
21 | path.with_suffix(".")
22 | path.with_suffix("py")
23 | path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^
24 | path.with_suffix(u'' "json")
25 | path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
22 | path.with_suffix("py")
   - path.with_suffix(r"s")
23 + path.with_suffix(r".s")
24 | path.with_suffix(u'' "json")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:24:1
   |
22 | path.with_suffix("py")
23 | path.with_suffix(r"s")
24 | path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 | path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
23 | path.with_suffix(r"s")
   - path.with_suffix(u'' "json")
24 + path.with_suffix(u'.' "json")
25 | path.with_suffix(suffix="js")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:25:1
   |
23 | path.with_suffix(r"s")
24 | path.with_suffix(u'' "json")
25 | path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26 |
27 | posix_path.with_suffix(".")
   |
help: Add a leading dot
   |
24 | path.with_suffix(u'' "json")
   - path.with_suffix(suffix="js")
25 + path.with_suffix(suffix=".js")
26 |
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:28:1
   |
27 | posix_path.with_suffix(".")
28 | posix_path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 | posix_path.with_suffix(r"s")
30 | posix_path.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
27 | posix_path.with_suffix(".")
   - posix_path.with_suffix("py")
28 + posix_path.with_suffix(".py")
29 | posix_path.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:29:1
   |
27 | posix_path.with_suffix(".")
28 | posix_path.with_suffix("py")
29 | posix_path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30 | posix_path.with_suffix(u'' "json")
31 | posix_path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
28 | posix_path.with_suffix("py")
   - posix_path.with_suffix(r"s")
29 + posix_path.with_suffix(r".s")
30 | posix_path.with_suffix(u'' "json")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:30:1
   |
28 | posix_path.with_suffix("py")
29 | posix_path.with_suffix(r"s")
30 | posix_path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31 | posix_path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
29 | posix_path.with_suffix(r"s")
   - posix_path.with_suffix(u'' "json")
30 + posix_path.with_suffix(u'.' "json")
31 | posix_path.with_suffix(suffix="js")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:31:1
   |
29 | posix_path.with_suffix(r"s")
30 | posix_path.with_suffix(u'' "json")
31 | posix_path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32 |
33 | pure_path.with_suffix(".")
   |
help: Add a leading dot
   |
30 | posix_path.with_suffix(u'' "json")
   - posix_path.with_suffix(suffix="js")
31 + posix_path.with_suffix(suffix=".js")
32 |
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:34:1
   |
33 | pure_path.with_suffix(".")
34 | pure_path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
35 | pure_path.with_suffix(r"s")
36 | pure_path.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
33 | pure_path.with_suffix(".")
   - pure_path.with_suffix("py")
34 + pure_path.with_suffix(".py")
35 | pure_path.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:35:1
   |
33 | pure_path.with_suffix(".")
34 | pure_path.with_suffix("py")
35 | pure_path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
36 | pure_path.with_suffix(u'' "json")
37 | pure_path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
34 | pure_path.with_suffix("py")
   - pure_path.with_suffix(r"s")
35 + pure_path.with_suffix(r".s")
36 | pure_path.with_suffix(u'' "json")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:36:1
   |
34 | pure_path.with_suffix("py")
35 | pure_path.with_suffix(r"s")
36 | pure_path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37 | pure_path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
35 | pure_path.with_suffix(r"s")
   - pure_path.with_suffix(u'' "json")
36 + pure_path.with_suffix(u'.' "json")
37 | pure_path.with_suffix(suffix="js")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:37:1
   |
35 | pure_path.with_suffix(r"s")
36 | pure_path.with_suffix(u'' "json")
37 | pure_path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 |
39 | pure_posix_path.with_suffix(".")
   |
help: Add a leading dot
   |
36 | pure_path.with_suffix(u'' "json")
   - pure_path.with_suffix(suffix="js")
37 + pure_path.with_suffix(suffix=".js")
38 |
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:40:1
   |
39 | pure_posix_path.with_suffix(".")
40 | pure_posix_path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41 | pure_posix_path.with_suffix(r"s")
42 | pure_posix_path.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
39 | pure_posix_path.with_suffix(".")
   - pure_posix_path.with_suffix("py")
40 + pure_posix_path.with_suffix(".py")
41 | pure_posix_path.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:41:1
   |
39 | pure_posix_path.with_suffix(".")
40 | pure_posix_path.with_suffix("py")
41 | pure_posix_path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42 | pure_posix_path.with_suffix(u'' "json")
43 | pure_posix_path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
40 | pure_posix_path.with_suffix("py")
   - pure_posix_path.with_suffix(r"s")
41 + pure_posix_path.with_suffix(r".s")
42 | pure_posix_path.with_suffix(u'' "json")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:42:1
   |
40 | pure_posix_path.with_suffix("py")
41 | pure_posix_path.with_suffix(r"s")
42 | pure_posix_path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43 | pure_posix_path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
41 | pure_posix_path.with_suffix(r"s")
   - pure_posix_path.with_suffix(u'' "json")
42 + pure_posix_path.with_suffix(u'.' "json")
43 | pure_posix_path.with_suffix(suffix="js")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:43:1
   |
41 | pure_posix_path.with_suffix(r"s")
42 | pure_posix_path.with_suffix(u'' "json")
43 | pure_posix_path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44 |
45 | pure_windows_path.with_suffix(".")
   |
help: Add a leading dot
   |
42 | pure_posix_path.with_suffix(u'' "json")
   - pure_posix_path.with_suffix(suffix="js")
43 + pure_posix_path.with_suffix(suffix=".js")
44 |
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:46:1
   |
45 | pure_windows_path.with_suffix(".")
46 | pure_windows_path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47 | pure_windows_path.with_suffix(r"s")
48 | pure_windows_path.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
45 | pure_windows_path.with_suffix(".")
   - pure_windows_path.with_suffix("py")
46 + pure_windows_path.with_suffix(".py")
47 | pure_windows_path.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:47:1
   |
45 | pure_windows_path.with_suffix(".")
46 | pure_windows_path.with_suffix("py")
47 | pure_windows_path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 | pure_windows_path.with_suffix(u'' "json")
49 | pure_windows_path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
46 | pure_windows_path.with_suffix("py")
   - pure_windows_path.with_suffix(r"s")
47 + pure_windows_path.with_suffix(r".s")
48 | pure_windows_path.with_suffix(u'' "json")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:48:1
   |
46 | pure_windows_path.with_suffix("py")
47 | pure_windows_path.with_suffix(r"s")
48 | pure_windows_path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49 | pure_windows_path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
47 | pure_windows_path.with_suffix(r"s")
   - pure_windows_path.with_suffix(u'' "json")
48 + pure_windows_path.with_suffix(u'.' "json")
49 | pure_windows_path.with_suffix(suffix="js")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:49:1
   |
47 | pure_windows_path.with_suffix(r"s")
48 | pure_windows_path.with_suffix(u'' "json")
49 | pure_windows_path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50 |
51 | windows_path.with_suffix(".")
   |
help: Add a leading dot
   |
48 | pure_windows_path.with_suffix(u'' "json")
   - pure_windows_path.with_suffix(suffix="js")
49 + pure_windows_path.with_suffix(suffix=".js")
50 |
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:52:1
   |
51 | windows_path.with_suffix(".")
52 | windows_path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53 | windows_path.with_suffix(r"s")
54 | windows_path.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
51 | windows_path.with_suffix(".")
   - windows_path.with_suffix("py")
52 + windows_path.with_suffix(".py")
53 | windows_path.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:53:1
   |
51 | windows_path.with_suffix(".")
52 | windows_path.with_suffix("py")
53 | windows_path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54 | windows_path.with_suffix(u'' "json")
55 | windows_path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
52 | windows_path.with_suffix("py")
   - windows_path.with_suffix(r"s")
53 + windows_path.with_suffix(r".s")
54 | windows_path.with_suffix(u'' "json")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:54:1
   |
52 | windows_path.with_suffix("py")
53 | windows_path.with_suffix(r"s")
54 | windows_path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55 | windows_path.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
53 | windows_path.with_suffix(r"s")
   - windows_path.with_suffix(u'' "json")
54 + windows_path.with_suffix(u'.' "json")
55 | windows_path.with_suffix(suffix="js")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:55:1
   |
53 | windows_path.with_suffix(r"s")
54 | windows_path.with_suffix(u'' "json")
55 | windows_path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56 |
57 | Path().with_suffix(".")
   |
help: Add a leading dot
   |
54 | windows_path.with_suffix(u'' "json")
   - windows_path.with_suffix(suffix="js")
55 + windows_path.with_suffix(suffix=".js")
56 |
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:58:1
   |
57 | Path().with_suffix(".")
58 | Path().with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^
59 | PosixPath().with_suffix("py")
60 | PurePath().with_suffix("py")
   |
help: Add a leading dot
   |
57 | Path().with_suffix(".")
   - Path().with_suffix("py")
58 + Path().with_suffix(".py")
59 | PosixPath().with_suffix("py")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:59:1
   |
57 | Path().with_suffix(".")
58 | Path().with_suffix("py")
59 | PosixPath().with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60 | PurePath().with_suffix("py")
61 | PurePosixPath().with_suffix("py")
   |
help: Add a leading dot
   |
58 | Path().with_suffix("py")
   - PosixPath().with_suffix("py")
59 + PosixPath().with_suffix(".py")
60 | PurePath().with_suffix("py")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:60:1
   |
58 | Path().with_suffix("py")
59 | PosixPath().with_suffix("py")
60 | PurePath().with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 | PurePosixPath().with_suffix("py")
62 | PureWindowsPath().with_suffix("py")
   |
help: Add a leading dot
   |
59 | PosixPath().with_suffix("py")
   - PurePath().with_suffix("py")
60 + PurePath().with_suffix(".py")
61 | PurePosixPath().with_suffix("py")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:61:1
   |
59 | PosixPath().with_suffix("py")
60 | PurePath().with_suffix("py")
61 | PurePosixPath().with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62 | PureWindowsPath().with_suffix("py")
63 | WindowsPath().with_suffix("py")
   |
help: Add a leading dot
   |
60 | PurePath().with_suffix("py")
   - PurePosixPath().with_suffix("py")
61 + PurePosixPath().with_suffix(".py")
62 | PureWindowsPath().with_suffix("py")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:62:1
   |
60 | PurePath().with_suffix("py")
61 | PurePosixPath().with_suffix("py")
62 | PureWindowsPath().with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63 | WindowsPath().with_suffix("py")
   |
help: Add a leading dot
   |
61 | PurePosixPath().with_suffix("py")
   - PureWindowsPath().with_suffix("py")
62 + PureWindowsPath().with_suffix(".py")
63 | WindowsPath().with_suffix("py")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210.py:63:1
   |
61 | PurePosixPath().with_suffix("py")
62 | PureWindowsPath().with_suffix("py")
63 | WindowsPath().with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64 |
65 | ### No errors
   |
help: Add a leading dot
   |
62 | PureWindowsPath().with_suffix("py")
   - WindowsPath().with_suffix("py")
63 + WindowsPath().with_suffix(".py")
64 |
   |
note: This is an unsafe fix and may change runtime behavior
