Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8 #61

Closed
dirk-thomas opened this issue Feb 19, 2020 · 7 comments
Labels

Comments

@dirk-thomas
Copy link
Contributor

@dirk-thomas
Copy link
Contributor Author

Instead of creating separate tickets for each deprecation warning I will add more here:

  • osrf_pycommon/cli_utils/verb_pattern.py:44:

    DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()

  • osrf_pycommon/tests/unit/test_cli_utils/test_verb_pattern.py:69:

    DeprecationWarning: Please use assertRaisesRegex instead.

@zmk5
Copy link
Contributor

zmk5 commented Apr 27, 2020

According to the python docs, @asyncio.coroutine should be replaced with async def. After trying this, however, I get errors that complain about the use of yield within an async definition used here:

        # Start the subprocess
        if shell is True:
            transport, protocol = yield from loop.subprocess_shell(
                protocol_factory, " ".join(cmd), cwd=cwd, env=env,
                stdout=stdout_slave, stderr=stderr_slave, close_fds=False)
        else:
            transport, protocol = yield from loop.subprocess_exec(
                protocol_factory, *cmd, cwd=cwd, env=env,
                stdout=stdout_slave, stderr=stderr_slave, close_fds=False)

@zmk5
Copy link
Contributor

zmk5 commented Apr 27, 2020

Additionally, I found out that >python3.6 supports asynchronous generators, but not below. Fixing the first deprecation could have CI routines that fail to build for anything lower than python3.7.

@clalancette
Copy link
Contributor

Additionally, I found out that >python3.6 supports asynchronous generators, but not below. Fixing the first deprecation could have CI routines that fail to build for anything lower than python3.7.

I think we still want to maintain compatibility with at least Python 3.6 (Ubuntu Bionic). So that doesn't seem to be an option right now.

@zmk5
Copy link
Contributor

zmk5 commented Apr 27, 2020

That's what I thought, so the fix for the first deprecation will need to be a bit more creative haha.

wjwwood pushed a commit that referenced this issue Apr 28, 2020
* fixed simple deprecation warnings

* fixed the second assertRaisesRegex

* deprecation fix that allows successful build in Python 2.7 for Xenial

* added conditional for use of getargspec  Python2.7 in Xenial

* getfullargspec returns 7 values instead of 4 like getargspec
@zmk5
Copy link
Contributor

zmk5 commented Apr 30, 2020

@ivanpauno I believe these are the issues you still found lingering with the launch bug. I'm still trying to figure out what do with the asynchronous.coroutine.

@jacobperron
Copy link

I think this was resolved in #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants