---
source: crates/ruff_linter/src/rules/flake8_use_pathlib/mod.rs
---
PTH206 Replace `.split(os.sep)` with `Path.parts`
  --> PTH206.py:8:12
   |
 7 | # PTH206
 8 | "foo/bar/".split(os.sep)
   |            ^^^^^
 9 | "foo/bar/".split(sep=os.sep)
10 | "foo/bar/".split(os.sep)[-1]
   |

PTH206 Replace `.split(os.sep)` with `Path.parts`
  --> PTH206.py:9:12
   |
 7 | # PTH206
 8 | "foo/bar/".split(os.sep)
 9 | "foo/bar/".split(sep=os.sep)
   |            ^^^^^
10 | "foo/bar/".split(os.sep)[-1]
11 | "foo/bar/".split(os.sep)[-2]
   |

PTH206 Replace `.split(os.sep)` with `Path.parts`
  --> PTH206.py:10:12
   |
 8 | "foo/bar/".split(os.sep)
 9 | "foo/bar/".split(sep=os.sep)
10 | "foo/bar/".split(os.sep)[-1]
   |            ^^^^^
11 | "foo/bar/".split(os.sep)[-2]
12 | "foo/bar/".split(os.sep)[-2:]
   |

PTH206 Replace `.split(os.sep)` with `Path.parts`
  --> PTH206.py:11:12
   |
 9 | "foo/bar/".split(sep=os.sep)
10 | "foo/bar/".split(os.sep)[-1]
11 | "foo/bar/".split(os.sep)[-2]
   |            ^^^^^
12 | "foo/bar/".split(os.sep)[-2:]
13 | "fizz/buzz".split(sep)
   |

PTH206 Replace `.split(os.sep)` with `Path.parts`
  --> PTH206.py:12:12
   |
10 | "foo/bar/".split(os.sep)[-1]
11 | "foo/bar/".split(os.sep)[-2]
12 | "foo/bar/".split(os.sep)[-2:]
   |            ^^^^^
13 | "fizz/buzz".split(sep)
14 | "fizz/buzz".split(sep)[-1]
   |

PTH206 Replace `.split(os.sep)` with `Path.parts`
  --> PTH206.py:13:13
   |
11 | "foo/bar/".split(os.sep)[-2]
12 | "foo/bar/".split(os.sep)[-2:]
13 | "fizz/buzz".split(sep)
   |             ^^^^^
14 | "fizz/buzz".split(sep)[-1]
15 | os.path.splitext("path/to/hello_world.py")[0].split(os.sep)[-1]
   |

PTH206 Replace `.split(os.sep)` with `Path.parts`
  --> PTH206.py:14:13
   |
12 | "foo/bar/".split(os.sep)[-2:]
13 | "fizz/buzz".split(sep)
14 | "fizz/buzz".split(sep)[-1]
   |             ^^^^^
15 | os.path.splitext("path/to/hello_world.py")[0].split(os.sep)[-1]
16 | file_name.split(os.sep)
   |

PTH206 Replace `.split(os.sep)` with `Path.parts`
  --> PTH206.py:15:47
   |
13 | "fizz/buzz".split(sep)
14 | "fizz/buzz".split(sep)[-1]
15 | os.path.splitext("path/to/hello_world.py")[0].split(os.sep)[-1]
   |                                               ^^^^^
16 | file_name.split(os.sep)
17 | (os.path.abspath(file_name)).split(os.sep)
   |

PTH206 Replace `.split(os.sep)` with `Path.parts`
  --> PTH206.py:16:11
   |
14 | "fizz/buzz".split(sep)[-1]
15 | os.path.splitext("path/to/hello_world.py")[0].split(os.sep)[-1]
16 | file_name.split(os.sep)
   |           ^^^^^
17 | (os.path.abspath(file_name)).split(os.sep)
   |

PTH206 Replace `.split(os.sep)` with `Path.parts`
  --> PTH206.py:17:30
   |
15 | os.path.splitext("path/to/hello_world.py")[0].split(os.sep)[-1]
16 | file_name.split(os.sep)
17 | (os.path.abspath(file_name)).split(os.sep)
   |                              ^^^^^
18 |
19 | # OK
   |
