summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-10-10 10:23:06 -0400
committerGitHub <noreply@github.com>2021-10-10 07:23:06 -0700
commit14a483aa400dda8346ac474ce22e2ba8d8126dff (patch)
tree7aafc58039dae815ffd987ae53aee998a110b81e
parent459a4db5eae1f5ef063b34c61cc099820aa9ed0a (diff)
downloadcpython-git-14a483aa400dda8346ac474ce22e2ba8d8126dff.tar.gz
[3.10] bpo-45419: Fix interfaces on DegenerateFiles.Path (GH-28844)
-rw-r--r--Lib/importlib/_adapters.py3
-rw-r--r--Misc/NEWS.d/next/Library/2021-10-09-20-53-13.bpo-45419.CauCgt.rst1
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/importlib/_adapters.py b/Lib/importlib/_adapters.py
index eedde49dd0..e72edd1070 100644
--- a/Lib/importlib/_adapters.py
+++ b/Lib/importlib/_adapters.py
@@ -46,10 +46,11 @@ class DegenerateFiles:
def joinpath(self, other):
return DegenerateFiles.Path()
+ @property
def name(self):
return ''
- def open(self):
+ def open(self, mode='rb', *args, **kwargs):
raise ValueError()
def __init__(self, spec):
diff --git a/Misc/NEWS.d/next/Library/2021-10-09-20-53-13.bpo-45419.CauCgt.rst b/Misc/NEWS.d/next/Library/2021-10-09-20-53-13.bpo-45419.CauCgt.rst
new file mode 100644
index 0000000000..a901d74538
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-10-09-20-53-13.bpo-45419.CauCgt.rst
@@ -0,0 +1 @@
+Correct interfaces on DegenerateFiles.Path.