Skip to content

lint failure: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from) #1115

Closed

Description

@jku

https://travis-ci.org/github/theupdateframework/tuf/jobs/719237881

pylint seems to have been upgraded on travis -- or pip on python3.8 now installs pylint 2.6.0 based on the test output. This seems to make linter fail because of the added raise-missing-from check:

************* Module tuf.formats
/home/travis/build/theupdateframework/tuf/tuf/formats.py:958:4: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
/home/travis/build/theupdateframework/tuf/tuf/formats.py:964:4: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module tuf.repository_lib
/home/travis/build/theupdateframework/tuf/tuf/repository_lib.py:544:4: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
/home/travis/build/theupdateframework/tuf/tuf/repository_lib.py:573:4: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
/home/travis/build/theupdateframework/tuf/tuf/repository_lib.py:613:4: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
/home/travis/build/theupdateframework/tuf/tuf/repository_lib.py:669:4: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module tuf.keydb
/home/travis/build/theupdateframework/tuf/tuf/keydb.py:345:4: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module tuf.scripts.repo
/home/travis/build/theupdateframework/tuf/tuf/scripts/repo.py:458:6: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module tuf.client.updater
/home/travis/build/theupdateframework/tuf/tuf/client/updater.py:1589:10: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)

We should consider "raise from" (although it's a bit of a pain with python2) or disable the linter check.

Activity

  1. jku commented on Aug 24, 2020

    @jku
    MemberAuthor

    six.raise_from(exc_value, exc_value_from) is probably the reasonable choice: it keeps old functionality for py2 but uses 'raise from' on py3

  2. sechkova commented on Aug 24, 2020

    @sechkova
    Contributor

    Thanks, @jku, six is already used in the project for python 2.x compatibility so it does seem the best fit.
    I opened #1116 based on your suggestion.

  3. lukpueh commented on Aug 24, 2020

    @lukpueh
    Member

    Kindly fixed in #1116. Thanks for the efforts @jku and @sechkova!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions