---
source: crates/ruff_linter/src/rules/flake8_use_pathlib/mod.rs
---
PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:14:5
   |
12 |     ## Errors
13 |     p.with_suffix(".")
14 |     p.with_suffix("py")
   |     ^^^^^^^^^^^^^^^^^^^
15 |     p.with_suffix(r"s")
16 |     p.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
13 |     p.with_suffix(".")
   -     p.with_suffix("py")
14 +     p.with_suffix(".py")
15 |     p.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:15:5
   |
13 |     p.with_suffix(".")
14 |     p.with_suffix("py")
15 |     p.with_suffix(r"s")
   |     ^^^^^^^^^^^^^^^^^^^
16 |     p.with_suffix(u'' "json")
17 |     p.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
14 |     p.with_suffix("py")
   -     p.with_suffix(r"s")
15 +     p.with_suffix(r".s")
16 |     p.with_suffix(u'' "json")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:16:5
   |
14 |     p.with_suffix("py")
15 |     p.with_suffix(r"s")
16 |     p.with_suffix(u'' "json")
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
17 |     p.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
15 |     p.with_suffix(r"s")
   -     p.with_suffix(u'' "json")
16 +     p.with_suffix(u'.' "json")
17 |     p.with_suffix(suffix="js")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:17:5
   |
15 |     p.with_suffix(r"s")
16 |     p.with_suffix(u'' "json")
17 |     p.with_suffix(suffix="js")
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
18 |
19 |     ## No errors
   |
help: Add a leading dot
   |
16 |     p.with_suffix(u'' "json")
   -     p.with_suffix(suffix="js")
17 +     p.with_suffix(suffix=".js")
18 |
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:32:5
   |
30 |     ## Errors
31 |     p.with_suffix(".")
32 |     p.with_suffix("py")
   |     ^^^^^^^^^^^^^^^^^^^
33 |     p.with_suffix(r"s")
34 |     p.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
31 |     p.with_suffix(".")
   -     p.with_suffix("py")
32 +     p.with_suffix(".py")
33 |     p.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

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

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

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

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:50:5
   |
48 |     ## Errors
49 |     p.with_suffix(".")
50 |     p.with_suffix("py")
   |     ^^^^^^^^^^^^^^^^^^^
51 |     p.with_suffix(r"s")
52 |     p.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
49 |     p.with_suffix(".")
   -     p.with_suffix("py")
50 +     p.with_suffix(".py")
51 |     p.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

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

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

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

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:68:5
   |
66 |     ## Errors
67 |     p.with_suffix(".")
68 |     p.with_suffix("py")
   |     ^^^^^^^^^^^^^^^^^^^
69 |     p.with_suffix(r"s")
70 |     p.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
67 |     p.with_suffix(".")
   -     p.with_suffix("py")
68 +     p.with_suffix(".py")
69 |     p.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:69:5
   |
67 |     p.with_suffix(".")
68 |     p.with_suffix("py")
69 |     p.with_suffix(r"s")
   |     ^^^^^^^^^^^^^^^^^^^
70 |     p.with_suffix(u'' "json")
71 |     p.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
68 |     p.with_suffix("py")
   -     p.with_suffix(r"s")
69 +     p.with_suffix(r".s")
70 |     p.with_suffix(u'' "json")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:70:5
   |
68 |     p.with_suffix("py")
69 |     p.with_suffix(r"s")
70 |     p.with_suffix(u'' "json")
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
71 |     p.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
69 |     p.with_suffix(r"s")
   -     p.with_suffix(u'' "json")
70 +     p.with_suffix(u'.' "json")
71 |     p.with_suffix(suffix="js")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:71:5
   |
69 |     p.with_suffix(r"s")
70 |     p.with_suffix(u'' "json")
71 |     p.with_suffix(suffix="js")
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
72 |
73 |     ## No errors
   |
help: Add a leading dot
   |
70 |     p.with_suffix(u'' "json")
   -     p.with_suffix(suffix="js")
71 +     p.with_suffix(suffix=".js")
72 |
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:86:5
   |
84 |     ## Errors
85 |     p.with_suffix(".")
86 |     p.with_suffix("py")
   |     ^^^^^^^^^^^^^^^^^^^
87 |     p.with_suffix(r"s")
88 |     p.with_suffix(u'' "json")
   |
help: Add a leading dot
   |
85 |     p.with_suffix(".")
   -     p.with_suffix("py")
86 +     p.with_suffix(".py")
87 |     p.with_suffix(r"s")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:87:5
   |
85 |     p.with_suffix(".")
86 |     p.with_suffix("py")
87 |     p.with_suffix(r"s")
   |     ^^^^^^^^^^^^^^^^^^^
88 |     p.with_suffix(u'' "json")
89 |     p.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
86 |     p.with_suffix("py")
   -     p.with_suffix(r"s")
87 +     p.with_suffix(r".s")
88 |     p.with_suffix(u'' "json")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:88:5
   |
86 |     p.with_suffix("py")
87 |     p.with_suffix(r"s")
88 |     p.with_suffix(u'' "json")
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
89 |     p.with_suffix(suffix="js")
   |
help: Add a leading dot
   |
87 |     p.with_suffix(r"s")
   -     p.with_suffix(u'' "json")
88 +     p.with_suffix(u'.' "json")
89 |     p.with_suffix(suffix="js")
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
  --> PTH210_1.py:89:5
   |
87 |     p.with_suffix(r"s")
88 |     p.with_suffix(u'' "json")
89 |     p.with_suffix(suffix="js")
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
90 |
91 |     ## No errors
   |
help: Add a leading dot
   |
88 |     p.with_suffix(u'' "json")
   -     p.with_suffix(suffix="js")
89 +     p.with_suffix(suffix=".js")
90 |
   |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
   --> PTH210_1.py:104:5
    |
102 |     ## Errors
103 |     p.with_suffix(".")
104 |     p.with_suffix("py")
    |     ^^^^^^^^^^^^^^^^^^^
105 |     p.with_suffix(r"s")
106 |     p.with_suffix(u'' "json")
    |
help: Add a leading dot
    |
103 |     p.with_suffix(".")
    -     p.with_suffix("py")
104 +     p.with_suffix(".py")
105 |     p.with_suffix(r"s")
    |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
   --> PTH210_1.py:105:5
    |
103 |     p.with_suffix(".")
104 |     p.with_suffix("py")
105 |     p.with_suffix(r"s")
    |     ^^^^^^^^^^^^^^^^^^^
106 |     p.with_suffix(u'' "json")
107 |     p.with_suffix(suffix="js")
    |
help: Add a leading dot
    |
104 |     p.with_suffix("py")
    -     p.with_suffix(r"s")
105 +     p.with_suffix(r".s")
106 |     p.with_suffix(u'' "json")
    |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
   --> PTH210_1.py:106:5
    |
104 |     p.with_suffix("py")
105 |     p.with_suffix(r"s")
106 |     p.with_suffix(u'' "json")
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
107 |     p.with_suffix(suffix="js")
    |
help: Add a leading dot
    |
105 |     p.with_suffix(r"s")
    -     p.with_suffix(u'' "json")
106 +     p.with_suffix(u'.' "json")
107 |     p.with_suffix(suffix="js")
    |
note: This is an unsafe fix and may change runtime behavior

PTH210 [*] Dotless suffix passed to `.with_suffix()`
   --> PTH210_1.py:107:5
    |
105 |     p.with_suffix(r"s")
106 |     p.with_suffix(u'' "json")
107 |     p.with_suffix(suffix="js")
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
108 |
109 |     ## No errors
    |
help: Add a leading dot
    |
106 |     p.with_suffix(u'' "json")
    -     p.with_suffix(suffix="js")
107 +     p.with_suffix(suffix=".js")
108 |
    |
note: This is an unsafe fix and may change runtime behavior
