Comment 9 for bug 1764814

Revision history for this message
Bryce Harrington (bryce) wrote :

Currently seeing this for python-qt4. Betting a number of python modules are similarly affected.

Launchpad's display_name's are notoriously unreliable, I've run into this problem in other projects many times. Nish is right that this needs better handling around line 1646:

    fallback_author = None
    if spi.spphr.package_creator.display_name:
        fallback_author = str(spi.spphr.package_creator.display_name)

So, what we probably need is something akin to:

    fallback_author = None
    try:
        if spi.spphr.package_creator.display_name:
            fallback_author = str(spi.spphr.package_creator.display_name)
    except:
        try:
            fallback_author = spi.spphr.package_creator.name
        except:
            fallback_author = "Unknown"

1) It'd be better if it caught the specific exception being thrown, but I'm not sure what that is. KeyError is thrown when the user doesn't exist, but not sure what 'User suspended' is.

2) This falls back to the 'name' field, which is almost as problematic as the display_name. Also, since it's the user's launchpad username it may not be at all relevant from a package standpoint. But I don't know the intent of this code well enough to see if there's a better fallback.

3) Worst case it's setting it to "Unknown", but would something different (or just None) be better?

4) There is similar code in import_applied_spi that'll need the same fix. (And might be worth putting into a helper routine.)