Skip to content

Fix parsing maintainers with unmatched email brackets - #5412

Open
RohitSutar1823 wants to merge 1 commit into
aboutcode-org:developfrom
RohitSutar1823:fix-parse-maintainer-name-email
Open

RohitSutar1823 wants to merge 1 commit into
aboutcode-org:developfrom
RohitSutar1823:fix-parse-maintainer-name-email

Conversation

@RohitSutar1823

Copy link
Copy Markdown

Fixes #5402

This pull request fixes parse_maintainer_name_email() so it extracts an email address only when both angle brackets are present. Previously, strings containing @ were incorrectly parsed when neither bracket or only one bracket was present.

Changes

  • Corrected the email-wrapper validation in src/packagedcode/utils.py.
  • Added regression tests in tests/packagedcode/test_utils.py covering:
    • A valid Name <email> value.
    • An email-like string without angle brackets.
    • A string with an unmatched angle bracket.

Tasks

  • Reviewed the contribution guidelines
  • PR has a descriptive title and links the original issue
  • Tests pass: venv/bin/python -m pytest tests/packagedcode/test_utils.py -q — 25 passed
  • Changes are on a uniquely named branch with no merge conflicts
  • Documentation and changelog updates are not applicable

Fixes aboutcode-org#5402

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: RohitSutar1823 <252551965+RohitSutar1823@users.noreply.github.com>
@RohitSutar1823
RohitSutar1823 force-pushed the fix-parse-maintainer-name-email branch from f2eb0f3 to f6aada6 Compare November 4, 2026 06:15
@RohitSutar1823

Copy link
Copy Markdown
Author

The failing Azure check is core_tests license_validate_ignorables_2. This failure is unrelated to the changed files (src/packagedcode/utils.py and tests/packagedcode/test_utils.py), and the same check is also failing on the current develop branch.

The targeted tests pass locally:

venv/bin/python -m pytest tests/packagedcode/test_utils.py -q — 25 passed

Could this check please be rerun or treated as a baseline/infrastructure failure?

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.

parse_maintainer_name_email returns empty name and wrong email when string has "@" but no angle brackets

1 participant