tools/osbuild-depsolve-dnf(5): use url.path to drop scheme
str.removeprefix() is not available in Python 3.6, which we need to support EL8. Instead of removing the prefix from the original path string, take the path property of the parsed URL. Since we're dealing with file paths, there will be no params, query, or fragment strings so the path should be all we need.
This commit is contained in:
parent
7c04e1c596
commit
8b1e743120
2 changed files with 2 additions and 2 deletions
|
|
@ -326,7 +326,7 @@ def read_keys(paths, root_dir=None):
|
|||
for path in paths:
|
||||
url = urllib.parse.urlparse(path)
|
||||
if url.scheme == "file":
|
||||
path = path.removeprefix("file://")
|
||||
path = url.path
|
||||
path = modify_rootdir_path(path, root_dir)
|
||||
try:
|
||||
with open(path, mode="r", encoding="utf-8") as keyfile:
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@ def read_keys(paths, root_dir=None):
|
|||
for path in paths:
|
||||
url = urllib.parse.urlparse(path)
|
||||
if url.scheme == "file":
|
||||
path = path.removeprefix("file://")
|
||||
path = url.path
|
||||
path = modify_rootdir_path(path, root_dir)
|
||||
try:
|
||||
with open(path, mode="r", encoding="utf-8") as keyfile:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue