Skip to content

Fix crash in assemble_package when manifest is at codebase root#2070

Open
Kaushik-Kumar-CEG wants to merge 1 commit intoaboutcode-org:mainfrom
Kaushik-Kumar-CEG:fix/assemble-package-attributeerror
Open

Fix crash in assemble_package when manifest is at codebase root#2070
Kaushik-Kumar-CEG wants to merge 1 commit intoaboutcode-org:mainfrom
Kaushik-Kumar-CEG:fix/assemble-package-attributeerror

Conversation

@Kaushik-Kumar-CEG
Copy link

@Kaushik-Kumar-CEG Kaushik-Kumar-CEG commented Feb 26, 2026

Fixes the issue reported in : scancode-action #11

when a package manifest (e.g. pom.xml) is at the root of the input directory, assemble_package() crashes with:

AttributeError: 'NoneType' object has no attribute 'path'

this happens because packagedcode's maven handler calls resource.parent() which returns None when there is no parent path, then passes that None to assign_package_to_resources()

Fix

wrapped handler.assemble() in assemble_package() with a try/except AttributeError so the pipeline logs a warning and continues instead of crashing

Testing

reproduced and verified locally

@Kaushik-Kumar-CEG
Copy link
Author

Kaushik-Kumar-CEG commented Feb 26, 2026

Hi @pombredanne @AyanSinhaMahapatra @tdruez @keshav-space

this fixes the issue reported in scancode-action #11

happy to make any changes if needed!
please let me know your thoughts :)

@tdruez
Copy link
Contributor

tdruez commented Mar 9, 2026

Catching the exception here just silences the error, it doesn't address why it's happening in the first place.

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.

2 participants