---
source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs
---
import_from_as.py:13:5: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()`
   |
13 | p = "/foo"
14 | 
15 | a = xabspath(p)
   |     ^^^^^^^^ PTH100
16 | aa = xchmod(p)
17 | aaa = xmkdir(p)
   |

import_from_as.py:14:6: PTH101 `os.chmod()` should be replaced by `Path.chmod()`
   |
14 | a = xabspath(p)
15 | aa = xchmod(p)
   |      ^^^^^^ PTH101
16 | aaa = xmkdir(p)
17 | xmakedirs(p)
   |

import_from_as.py:15:7: PTH102 `os.mkdir()` should be replaced by `Path.mkdir()`
   |
15 | a = xabspath(p)
16 | aa = xchmod(p)
17 | aaa = xmkdir(p)
   |       ^^^^^^ PTH102
18 | xmakedirs(p)
19 | xrename(p)
   |

import_from_as.py:16:1: PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)`
   |
16 | aa = xchmod(p)
17 | aaa = xmkdir(p)
18 | xmakedirs(p)
   | ^^^^^^^^^ PTH103
19 | xrename(p)
20 | xreplace(p)
   |

import_from_as.py:17:1: PTH104 `os.rename()` should be replaced by `Path.rename()`
   |
17 | aaa = xmkdir(p)
18 | xmakedirs(p)
19 | xrename(p)
   | ^^^^^^^ PTH104
20 | xreplace(p)
21 | xrmdir(p)
   |

import_from_as.py:18:1: PTH105 `os.replace()` should be replaced by `Path.replace()`
   |
18 | xmakedirs(p)
19 | xrename(p)
20 | xreplace(p)
   | ^^^^^^^^ PTH105
21 | xrmdir(p)
22 | xremove(p)
   |

import_from_as.py:19:1: PTH106 `os.rmdir()` should be replaced by `Path.rmdir()`
   |
19 | xrename(p)
20 | xreplace(p)
21 | xrmdir(p)
   | ^^^^^^ PTH106
22 | xremove(p)
23 | xunlink(p)
   |

import_from_as.py:20:1: PTH107 `os.remove()` should be replaced by `Path.unlink()`
   |
20 | xreplace(p)
21 | xrmdir(p)
22 | xremove(p)
   | ^^^^^^^ PTH107
23 | xunlink(p)
24 | xgetcwd(p)
   |

import_from_as.py:21:1: PTH108 `os.unlink()` should be replaced by `Path.unlink()`
   |
21 | xrmdir(p)
22 | xremove(p)
23 | xunlink(p)
   | ^^^^^^^ PTH108
24 | xgetcwd(p)
25 | b = xexists(p)
   |

import_from_as.py:22:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()`
   |
22 | xremove(p)
23 | xunlink(p)
24 | xgetcwd(p)
   | ^^^^^^^ PTH109
25 | b = xexists(p)
26 | bb = xexpanduser(p)
   |

import_from_as.py:23:5: PTH110 `os.path.exists()` should be replaced by `Path.exists()`
   |
23 | xunlink(p)
24 | xgetcwd(p)
25 | b = xexists(p)
   |     ^^^^^^^ PTH110
26 | bb = xexpanduser(p)
27 | bbb = xisdir(p)
   |

import_from_as.py:24:6: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()`
   |
24 | xgetcwd(p)
25 | b = xexists(p)
26 | bb = xexpanduser(p)
   |      ^^^^^^^^^^^ PTH111
27 | bbb = xisdir(p)
28 | bbbb = xisfile(p)
   |

import_from_as.py:25:7: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()`
   |
25 | b = xexists(p)
26 | bb = xexpanduser(p)
27 | bbb = xisdir(p)
   |       ^^^^^^ PTH112
28 | bbbb = xisfile(p)
29 | bbbbb = xislink(p)
   |

import_from_as.py:26:8: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()`
   |
26 | bb = xexpanduser(p)
27 | bbb = xisdir(p)
28 | bbbb = xisfile(p)
   |        ^^^^^^^ PTH113
29 | bbbbb = xislink(p)
30 | xreadlink(p)
   |

import_from_as.py:27:9: PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()`
   |
27 | bbb = xisdir(p)
28 | bbbb = xisfile(p)
29 | bbbbb = xislink(p)
   |         ^^^^^^^ PTH114
30 | xreadlink(p)
31 | xstat(p)
   |

import_from_as.py:28:1: PTH115 `os.readlink()` should be replaced by `Path.readlink()`
   |
28 | bbbb = xisfile(p)
29 | bbbbb = xislink(p)
30 | xreadlink(p)
   | ^^^^^^^^^ PTH115
31 | xstat(p)
32 | xisabs(p)
   |

import_from_as.py:29:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`
   |
29 | bbbbb = xislink(p)
30 | xreadlink(p)
31 | xstat(p)
   | ^^^^^ PTH116
32 | xisabs(p)
33 | xjoin(p)
   |

import_from_as.py:30:1: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()`
   |
30 | xreadlink(p)
31 | xstat(p)
32 | xisabs(p)
   | ^^^^^^ PTH117
33 | xjoin(p)
34 | xbasename(p)
   |

import_from_as.py:31:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator
   |
31 | xstat(p)
32 | xisabs(p)
33 | xjoin(p)
   | ^^^^^ PTH118
34 | xbasename(p)
35 | xdirname(p)
   |

import_from_as.py:32:1: PTH119 `os.path.basename()` should be replaced by `Path.name`
   |
32 | xisabs(p)
33 | xjoin(p)
34 | xbasename(p)
   | ^^^^^^^^^ PTH119
35 | xdirname(p)
36 | xsamefile(p)
   |

import_from_as.py:33:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent`
   |
33 | xjoin(p)
34 | xbasename(p)
35 | xdirname(p)
   | ^^^^^^^^ PTH120
36 | xsamefile(p)
37 | xsplitext(p)
   |

import_from_as.py:34:1: PTH121 `os.path.samefile()` should be replaced by `Path.samefile()`
   |
34 | xbasename(p)
35 | xdirname(p)
36 | xsamefile(p)
   | ^^^^^^^^^ PTH121
37 | xsplitext(p)
   |

import_from_as.py:35:1: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
   |
35 | xdirname(p)
36 | xsamefile(p)
37 | xsplitext(p)
   | ^^^^^^^^^ PTH122
   |


