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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

import_from_as.py:32:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator
   |
30 | xstat(p)
31 | xisabs(p)
32 | xjoin(p, q)
   | ^^^^^ PTH118
33 | s.join((p, q))
34 | s.join([p, q])
   |

import_from_as.py:33:1: PTH118 `os.sep.join()` should be replaced by `Path` with `/` operator
   |
31 | xisabs(p)
32 | xjoin(p, q)
33 | s.join((p, q))
   | ^^^^^^ PTH118
34 | s.join([p, q])
35 | xbasename(p)
   |

import_from_as.py:34:1: PTH118 `os.sep.join()` should be replaced by `Path` with `/` operator
   |
32 | xjoin(p, q)
33 | s.join((p, q))
34 | s.join([p, q])
   | ^^^^^^ PTH118
35 | xbasename(p)
36 | xdirname(p)
   |

import_from_as.py:35:1: PTH119 `os.path.basename()` should be replaced by `Path.name`
   |
33 | s.join((p, q))
34 | s.join([p, q])
35 | xbasename(p)
   | ^^^^^^^^^ PTH119
36 | xdirname(p)
37 | xsamefile(p)
   |

import_from_as.py:36:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent`
   |
34 | s.join([p, q])
35 | xbasename(p)
36 | xdirname(p)
   | ^^^^^^^^ PTH120
37 | xsamefile(p)
38 | xsplitext(p)
   |

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

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


