Skip to content

Commit

Permalink
[PY3.13] Handle pathlib._local
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Aug 10, 2024
1 parent bf33b6e commit 0e34954
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pylint/checkers/stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
ENV_GETTERS = ("os.getenv",)
SUBPROCESS_POPEN = "subprocess.Popen"
SUBPROCESS_RUN = "subprocess.run"
OPEN_MODULE = {"_io", "pathlib"}
OPEN_MODULE = {"_io", "pathlib", "pathlib._local"}
PATHLIB_MODULE = {"pathlib", "pathlib._local"}
DEBUG_BREAKPOINTS = ("builtins.breakpoint", "sys.breakpointhook", "pdb.set_trace")
LRU_CACHE = {
"functools.lru_cache", # Inferred for @lru_cache
Expand Down Expand Up @@ -784,7 +785,7 @@ def _check_open_call(
mode_arg = utils.get_argument_from_call(
node, position=1, keyword="mode"
)
elif open_module == "pathlib":
elif open_module in PATHLIB_MODULE:
mode_arg = utils.get_argument_from_call(
node, position=0, keyword="mode"
)
Expand Down Expand Up @@ -814,7 +815,7 @@ def _check_open_call(
):
confidence = HIGH
try:
if open_module == "pathlib":
if open_module in PATHLIB_MODULE:
if node.func.attrname == "read_text":
encoding_arg = utils.get_argument_from_call(
node, position=0, keyword="encoding"
Expand Down

0 comments on commit 0e34954

Please sign in to comment.