Skip to content

Commit 18b379d

Browse files
committed
Fix: remove falsely deprecated importlib.resources functions (#10595)
1 parent c3d7a7c commit 18b379d

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Removed falsely deprecated functions from `importlib.resources` in the stdlib checker
2+
(read_text, read_binary, open_binary, open_text, path, is_resource).
3+
4+
Closes #10595

pylint/checkers/stdlib.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,6 @@
244244
"binascii.rlecode_hqx",
245245
"binascii.rledecode_hqx",
246246
"importlib.resources.contents",
247-
"importlib.resources.is_resource",
248-
"importlib.resources.open_binary",
249-
"importlib.resources.open_text",
250-
"importlib.resources.path",
251-
"importlib.resources.read_binary",
252-
# "importlib.resources.read_text", #un-deprecated in Python 3.13
253247
},
254248
(3, 10, 0): {
255249
"_sqlite3.enable_shared_cache",

tests/checkers/unittest_stdlib.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,6 @@ def infer_func(
6969
with self.assertNoMessages():
7070
self.checker.visit_call(node)
7171

72-
def test_importlib_read_text_not_deprecated(self) -> None:
73-
"""Ensure importlib.resources.read_text is NOT flagged as deprecated."""
74-
assign_node = astroid.extract_node("""
75-
from importlib.resources import read_text
76-
data = read_text("mypkg", "file.txt")
77-
""")
78-
call_node = assign_node.value # The value of the Assign node is the Call node
79-
with self.assertNoMessages():
80-
self.checker.visit_call(call_node)
8172

8273

8374

0 commit comments

Comments
 (0)