Skip to content

Fix CocoaPods PodspecJsonHandler parsing crashes and drop of dependencies (fixes #5563) - #5564

Open
patelshivani2283-lab wants to merge 1 commit into
aboutcode-org:developfrom
patelshivani2283-lab:fix-cocoapods-podspec-json-parsing
Open

patelshivani2283-lab wants to merge 1 commit into
aboutcode-org:developfrom
patelshivani2283-lab:fix-cocoapods-podspec-json-parsing

Conversation

@patelshivani2283-lab

Copy link
Copy Markdown

Summary

Fixes #5563

Resolves multiple crashes and parsing omissions in CocoaPods PodspecJsonHandler:

  1. Safely handle manifests missing "source" without KeyError: 'source'.
  2. Handle author mappings containing None values without crashing with TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'.
  3. Stop appending .com to author email addresses, properly setting email=value instead of url='[email protected]'.
  4. Properly handle author lists by creating individual Party instances rather than setting Party.name to a Python list.
  5. Safely handle license dictionaries containing None or non-string values without crashing with TypeError.
  6. Extract declared dependencies and subspec dependencies into models.DependentPackage objects with proper PURLs, requirements, and scopes.
  7. Update test fixtures, add comprehensive unit tests covering all edge cases, and update CHANGELOG.rst and AUTHORS.rst.

Verification

Ran all CocoaPods unit tests:

scancode-toolkit/tests/packagedcode/test_cocoapods.py
21 passed in 2.26s

…cies (fixes aboutcode-org#5563)

- Handle missing source without KeyError in PodspecJsonHandler
- Safely handle null, dictionary, and list author representations without TypeError crashes or appending .com to email addresses
- Safely handle non-string values in license dictionary without TypeError crashes
- Parse declared dependencies and subspec dependencies into DependentPackage instances
- Update test fixture and add comprehensive unit tests covering all edge cases
- Update CHANGELOG.rst and AUTHORS.rst

Signed-off-by: Shivani Patel <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] PodspecJsonHandler crashes on missing source, null author/license values, corrupts author email, and drops dependencies

1 participant