-
-
Notifications
You must be signed in to change notification settings - Fork 608
Closed
Labels
Description
From aboutcode-org/scancode.io#1616 (comment)
Error raised when running the PythonInstalledWheelMetadataFile.parse
on those files: metatdata_files.zip
>>> from packagedcode.pypi import PythonInstalledWheelMetadataFile
>>> location = "beartype-0.19.0.dist-info.METADATA"
>>> results = PythonInstalledWheelMetadataFile.parse(location=location, package_only=False)
>>> print(list(results))
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Volumes/nexB/repos/scancode.io/.venv/lib/python3.12/site-packages/packagedcode/pypi.py", line 380, in parse
yield parse_metadata(
^^^^^^^^^^^^^^^
File "/Volumes/nexB/repos/scancode.io/.venv/lib/python3.12/site-packages/packagedcode/pypi.py", line 1013, in parse_metadata
extracted_license_statement, license_file = get_declared_license(metainfo=meta)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Volumes/nexB/repos/scancode.io/.venv/lib/python3.12/site-packages/packagedcode/pypi.py", line 1686, in get_declared_license
license_file = lic.pop('file')
^^^^^^^
AttributeError: 'str' object has no attribute 'pop'
Bug in the get_delcared_license function.
- The
lic.pop('file')
should have a default value in any cases, such aslic.pop('file', None)
- Fix the issue the licenses are properly detected on those 2 files.
AyanSinhaMahapatra