Repository: spdx/tools-python

Issue:
TagValue builder writes attribution text into comment
See https://github.com/spdx/tools-python/blob/main/spdx/parsers/tagvaluebuilders.py#L1088-L1095

Discussion:

Patch:
diff --git a/spdx/parsers/tagvaluebuilders.py b/spdx/parsers/tagvaluebuilders.py
index 27b4180..4bf2320 100644
--- a/spdx/parsers/tagvaluebuilders.py
+++ b/spdx/parsers/tagvaluebuilders.py
@@ -1092,7 +1092,7 @@ class FileBuilder(object):
         """
         if self.has_package(doc) and self.has_file(doc):
             if validations.validate_file_attribution_text(text):
-                self.file(doc).comment = str_from_text(text)
+                self.file(doc).attribution_text = str_from_text(text)
                 return True
             else:
                 raise SPDXValueError("File::AttributionText")


Test patch:
diff --git a/tests/test_tag_value_parser.py b/tests/test_tag_value_parser.py
index 54dde11..64ddb17 100644
--- a/tests/test_tag_value_parser.py
+++ b/tests/test_tag_value_parser.py
@@ -243,7 +243,8 @@ class TestParser(TestCase):
         'ArtifactOfProjectName: AcmeTest',
         'ArtifactOfProjectHomePage: http://www.acme.org/',
         'ArtifactOfProjectURI: http://www.acme.org/',
-        'FileComment: <text>Very long file</text>'
+        'FileComment: <text>Very long file</text>',
+        'FileAttributionText: <text>Acknowledgements that might be required to be communicated in some contexts.</text>'
         ])
 
     unknown_tag_str = 'SomeUnknownTag: SomeUnknownValue'
@@ -318,6 +319,9 @@ class TestParser(TestCase):
         assert len(spdx_file.artifact_of_project_name) == 1
         assert len(spdx_file.artifact_of_project_home) == 1
         assert len(spdx_file.artifact_of_project_uri) == 1
+        assert spdx_file.comment == 'Very long file'
+        assert spdx_file.attribution_text == 'Acknowledgements that might be required to be communicated in ' \
+                                             'some contexts.'
 
     def test_unknown_tag(self):