Skip to content

subprocess_middleware workers.py uses log.warn rather than log.warning #1

Open

Description

@netsettler

In testing some cgap-portal code under github actions, I saw this DeprecationWarning:

  /home/runner/.cache/pypoetry/virtualenvs/encoded-e-hjmLy7-py3.6/lib/python3.6/site-packages/subprocess_middleware/worker.py:124: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
    log.warn('Retrying: %r\n%s', e, errout)

The file https://github.com/lrowe/subprocess_middleware/blob/master/src/subprocess_middleware/worker.py#L124 does indeed appear to have a call to log.warn that should presumably be log.warning, according to logging doc, which says (in the entry for logging.warning:

Note: There is an obsolete function warn which is functionally identical to warning. As warn is deprecated, please do not use it - use warning instead.

I didn't test such a fix, but I did check that indeed logging.warning exists in Python 2.7. I'm using Python 3.6 and it's there as well. I can't speak to Python 3.4, but I imagine it's there. It looks like you're better set up to test this properly, but it sounds like a safe substitution to me.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions