Skip to content

Commit 9ccfc73

Browse files
committed
docs
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 99e8608 commit 9ccfc73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cyclonedx_py/_internal/utils/pep639.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ def dist2licenses_from_files(
107107

108108
def _make_license_from_content(file_name: str, content: Union[str, bytes],
109109
lack: 'LicenseAcknowledgement') -> DisjunctiveLicense:
110+
# Per PEP 639 spec, license files are human-readable texts.
111+
# But in reality, we found non-printable bytes in some files!
110112
# In the past, we did best-effort decoding to string,
111113
# see https://github.com/CycloneDX/cyclonedx-python/blob/b7a8f64ae212c5a5fd6b7cf8c83851ba692df256/cyclonedx_py/_internal/utils/pep639.py#L67-L71 # noqa:E501
112114
# But this was dropped, in favour of base64 encoding; CycloneDX is for machines, not humans!
@@ -117,8 +119,6 @@ def _make_license_from_content(file_name: str, content: Union[str, bytes],
117119
text=AttachedText(
118120
content_type=content_type,
119121
encoding=Encoding.BASE_64,
120-
# Per PEP 639 spec, license files are human-readable texts.
121-
# But in reality, we found non-printable bytes in some files!
122122
content=b64encode(
123123
content
124124
if isinstance(content, bytes)

0 commit comments

Comments
 (0)