Skip to content

fix(pypi): stop reporting a package's publisher as the account holder - #562

Draft
brunolm wants to merge 1 commit into
kaifcodec:mainfrom
brunolm:fix/email-key-classification
Draft

fix(pypi): stop reporting a package's publisher as the account holder#562
brunolm wants to merge 1 commit into
kaifcodec:mainfrom
brunolm:fix/email-key-classification

Conversation

@brunolm

@brunolm brunolm commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

tl;dr

  • PyPI reported a package's publisher as the account holder. author_email was emitted as email and author as display_name, so scanning hugovk published a defunct company's address and name as that account's own.
  • It now credits every publisher its packages name, under keys that say where they came from β€” author, author_email, maintainer, maintainer_email.

Package metadata is not the account holder's

Before. Both values come from PIL β€” first package alphabetically, published by
Secret Labs AB in the 1990s β€” and the account owner appears nowhere:

  [βœ”] Pypi (hugovk): Found
      β”œβ”€β”€ display_name: Secret Labs AB (PythonWare)
      β”œβ”€β”€ email: info@pythonware.com
      β”œβ”€β”€ packages_count: 24
      └── packages: ['PIL', 'blurb', 'em-keyboard', 'fino', 'flake8-implicit-str-concat']

After:

  [βœ”] Pypi (hugovk): Found
      β”œβ”€β”€ packages_count: 24
      β”œβ”€β”€ packages: ['PIL', 'blurb', 'em-keyboard', 'fino', 'flake8-implicit-str-concat']
      β”œβ”€β”€ author: Secret Labs AB (PythonWare), Larry Hastings, Kenneth Reitz, Hugo van Kemenade, Dylan Turner
      β”œβ”€β”€ author_email: info@pythonware.com, larry@…, me@…, 58230987+…@users.noreply.github.com
      β”œβ”€β”€ maintainer: Python Core Developers, Hugo van Kemenade
      └── maintainer_email: core-workflow@mail.python.org

Three changes produce that:

Change Effect
email β†’ author_email / maintainer_email, display_name β†’ author / maintainer The key names its source, so no consumer reads it as the account's own address or name
Every sampled package is read, not just up to the first hit Five publishers surface instead of whichever one sorts first; the account owner is now among them
Contacts parsed with email.utils.getaddresses "A <a@x>, B <b@y>" and "Thomas Kluyver & contributors <thomas@…>" no longer mangle

Cost: min(5, packages) requests every time, where a lucky first package used to
cost 1. That is the ceiling the old loop already hit whenever it found nothing.

Keys changed

Removed Added
email, display_name author, author_email, maintainer, maintainer_email

Neither removed key has another reader in the repo β€” the display_name hits in
core/orchestrator.py and core/email_orchestrator.py are a local variable
holding a category label. Consumers of the exported JSON/CSV/PDF that key off
the old names need updating.

Testing

Handle Case Result
hugovk packages with several publishers Found; 4 addresses, 5 authors, 2 maintainers
<pypi-user-c> package with an author, no email Found; author only
<pypi-user-b> package with no author, no email Found; packages_count + packages only
zzznotarealuser99xzq nonexistent Not Found

Not covered: _package_info's request-failure path, a package crediting two
distinct maintainer_emails, and the PDF exporter β€” the key rename was checked
by grep, not by rendering every format.

Release metadata credits whoever published a package, so folding
author_email/maintainer_email into extra["email"] presented a
co-maintainer's or a mailing list's address as the account's own, and
author/maintainer under display_name did the same for their name. Both
key names are read as claims about the account holder.

Emit them under keys that name their source, and report every distinct
value across the sampled packages rather than the first one an
alphabetical walk happened to reach.
@brunolm
brunolm force-pushed the fix/email-key-classification branch 2 times, most recently from 18fe4a3 to ca0e9cd Compare August 9, 2026 21:25
@brunolm brunolm changed the title fix(pypi,reddit): stop package metadata and a boolean from posing as the account's email fix(pypi): stop reporting a package's publisher as the account holder Aug 9, 2026
@brunolm brunolm added the bug fix Fixed a bug in existing files label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Fixed a bug in existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant