Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696998
D7889.id28466.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D7889.id28466.diff
View Options
diff --git a/swh/indexer/metadata_dictionary/cff.py b/swh/indexer/metadata_dictionary/cff.py
--- a/swh/indexer/metadata_dictionary/cff.py
+++ b/swh/indexer/metadata_dictionary/cff.py
@@ -6,10 +6,12 @@
from .base import DictMapping, SingleFileMapping
-yaml.SafeLoader.yaml_implicit_resolvers = {
- k: [r for r in v if r[0] != "tag:yaml.org,2002:timestamp"]
- for k, v in yaml.SafeLoader.yaml_implicit_resolvers.items()
-}
+
+class SafeLoader(yaml.SafeLoader):
+ yaml_implicit_resolvers = {
+ k: [r for r in v if r[0] != "tag:yaml.org,2002:timestamp"]
+ for k, v in yaml.SafeLoader.yaml_implicit_resolvers.items()
+ }
class CffMapping(DictMapping, SingleFileMapping):
@@ -22,7 +24,7 @@
def translate(self, raw_content: bytes) -> Dict[str, str]:
raw_content_string: str = raw_content.decode()
- content_dict = yaml.load(raw_content_string, Loader=yaml.SafeLoader)
+ content_dict = yaml.load(raw_content_string, Loader=SafeLoader)
metadata = self._translate_dict(content_dict)
metadata["@context"] = CODEMETA_CONTEXT_URL
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 17, 10:24 PM (22 h, 33 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3217252
Attached To
D7889: cff: Do not change yaml.SafeLoader globally
Event Timeline
Log In to Comment