---
source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs
---
full_name.py:6:5: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()`
   |
 6 | p = "/foo"
 7 | 
 8 | a = os.path.abspath(p)
   |     ^^^^^^^^^^^^^^^ PTH100
 9 | aa = os.chmod(p)
10 | aaa = os.mkdir(p)
   |

full_name.py:7:6: PTH101 `os.chmod()` should be replaced by `Path.chmod()`
   |
 7 | a = os.path.abspath(p)
 8 | aa = os.chmod(p)
   |      ^^^^^^^^ PTH101
 9 | aaa = os.mkdir(p)
10 | os.makedirs(p)
   |

full_name.py:8:7: PTH102 `os.mkdir()` should be replaced by `Path.mkdir()`
   |
 8 | a = os.path.abspath(p)
 9 | aa = os.chmod(p)
10 | aaa = os.mkdir(p)
   |       ^^^^^^^^ PTH102
11 | os.makedirs(p)
12 | os.rename(p)
   |

full_name.py:9:1: PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)`
   |
 9 | aa = os.chmod(p)
10 | aaa = os.mkdir(p)
11 | os.makedirs(p)
   | ^^^^^^^^^^^ PTH103
12 | os.rename(p)
13 | os.replace(p)
   |

full_name.py:10:1: PTH104 `os.rename()` should be replaced by `Path.rename()`
   |
10 | aaa = os.mkdir(p)
11 | os.makedirs(p)
12 | os.rename(p)
   | ^^^^^^^^^ PTH104
13 | os.replace(p)
14 | os.rmdir(p)
   |

full_name.py:11:1: PTH105 `os.replace()` should be replaced by `Path.replace()`
   |
11 | os.makedirs(p)
12 | os.rename(p)
13 | os.replace(p)
   | ^^^^^^^^^^ PTH105
14 | os.rmdir(p)
15 | os.remove(p)
   |

full_name.py:12:1: PTH106 `os.rmdir()` should be replaced by `Path.rmdir()`
   |
12 | os.rename(p)
13 | os.replace(p)
14 | os.rmdir(p)
   | ^^^^^^^^ PTH106
15 | os.remove(p)
16 | os.unlink(p)
   |

full_name.py:13:1: PTH107 `os.remove()` should be replaced by `Path.unlink()`
   |
13 | os.replace(p)
14 | os.rmdir(p)
15 | os.remove(p)
   | ^^^^^^^^^ PTH107
16 | os.unlink(p)
17 | os.getcwd(p)
   |

full_name.py:14:1: PTH108 `os.unlink()` should be replaced by `Path.unlink()`
   |
14 | os.rmdir(p)
15 | os.remove(p)
16 | os.unlink(p)
   | ^^^^^^^^^ PTH108
17 | os.getcwd(p)
18 | b = os.path.exists(p)
   |

full_name.py:15:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()`
   |
15 | os.remove(p)
16 | os.unlink(p)
17 | os.getcwd(p)
   | ^^^^^^^^^ PTH109
18 | b = os.path.exists(p)
19 | bb = os.path.expanduser(p)
   |

full_name.py:16:5: PTH110 `os.path.exists()` should be replaced by `Path.exists()`
   |
16 | os.unlink(p)
17 | os.getcwd(p)
18 | b = os.path.exists(p)
   |     ^^^^^^^^^^^^^^ PTH110
19 | bb = os.path.expanduser(p)
20 | bbb = os.path.isdir(p)
   |

full_name.py:17:6: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()`
   |
17 | os.getcwd(p)
18 | b = os.path.exists(p)
19 | bb = os.path.expanduser(p)
   |      ^^^^^^^^^^^^^^^^^^ PTH111
20 | bbb = os.path.isdir(p)
21 | bbbb = os.path.isfile(p)
   |

full_name.py:18:7: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()`
   |
18 | b = os.path.exists(p)
19 | bb = os.path.expanduser(p)
20 | bbb = os.path.isdir(p)
   |       ^^^^^^^^^^^^^ PTH112
21 | bbbb = os.path.isfile(p)
22 | bbbbb = os.path.islink(p)
   |

full_name.py:19:8: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()`
   |
19 | bb = os.path.expanduser(p)
20 | bbb = os.path.isdir(p)
21 | bbbb = os.path.isfile(p)
   |        ^^^^^^^^^^^^^^ PTH113
22 | bbbbb = os.path.islink(p)
23 | os.readlink(p)
   |

full_name.py:20:9: PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()`
   |
20 | bbb = os.path.isdir(p)
21 | bbbb = os.path.isfile(p)
22 | bbbbb = os.path.islink(p)
   |         ^^^^^^^^^^^^^^ PTH114
23 | os.readlink(p)
24 | os.stat(p)
   |

full_name.py:21:1: PTH115 `os.readlink()` should be replaced by `Path.readlink()`
   |
21 | bbbb = os.path.isfile(p)
22 | bbbbb = os.path.islink(p)
23 | os.readlink(p)
   | ^^^^^^^^^^^ PTH115
24 | os.stat(p)
25 | os.path.isabs(p)
   |

full_name.py:22:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`
   |
22 | bbbbb = os.path.islink(p)
23 | os.readlink(p)
24 | os.stat(p)
   | ^^^^^^^ PTH116
25 | os.path.isabs(p)
26 | os.path.join(p)
   |

full_name.py:23:1: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()`
   |
23 | os.readlink(p)
24 | os.stat(p)
25 | os.path.isabs(p)
   | ^^^^^^^^^^^^^ PTH117
26 | os.path.join(p)
27 | os.path.basename(p)
   |

full_name.py:24:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator
   |
24 | os.stat(p)
25 | os.path.isabs(p)
26 | os.path.join(p)
   | ^^^^^^^^^^^^ PTH118
27 | os.path.basename(p)
28 | os.path.dirname(p)
   |

full_name.py:25:1: PTH119 `os.path.basename()` should be replaced by `Path.name`
   |
25 | os.path.isabs(p)
26 | os.path.join(p)
27 | os.path.basename(p)
   | ^^^^^^^^^^^^^^^^ PTH119
28 | os.path.dirname(p)
29 | os.path.samefile(p)
   |

full_name.py:26:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent`
   |
26 | os.path.join(p)
27 | os.path.basename(p)
28 | os.path.dirname(p)
   | ^^^^^^^^^^^^^^^ PTH120
29 | os.path.samefile(p)
30 | os.path.splitext(p)
   |

full_name.py:27:1: PTH121 `os.path.samefile()` should be replaced by `Path.samefile()`
   |
27 | os.path.basename(p)
28 | os.path.dirname(p)
29 | os.path.samefile(p)
   | ^^^^^^^^^^^^^^^^ PTH121
30 | os.path.splitext(p)
31 | with open(p) as fp:
   |

full_name.py:28:1: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
   |
28 | os.path.dirname(p)
29 | os.path.samefile(p)
30 | os.path.splitext(p)
   | ^^^^^^^^^^^^^^^^ PTH122
31 | with open(p) as fp:
32 |     fp.read()
   |

full_name.py:29:6: PTH123 `open()` should be replaced by `Path.open()`
   |
29 | os.path.samefile(p)
30 | os.path.splitext(p)
31 | with open(p) as fp:
   |      ^^^^ PTH123
32 |     fp.read()
33 | open(p).close()
   |

full_name.py:31:1: PTH123 `open()` should be replaced by `Path.open()`
   |
31 | with open(p) as fp:
32 |     fp.read()
33 | open(p).close()
   | ^^^^ PTH123
34 | os.getcwdb(p)
   |

full_name.py:32:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()`
   |
32 |     fp.read()
33 | open(p).close()
34 | os.getcwdb(p)
   | ^^^^^^^^^^ PTH109
   |


