Warning about ISessionSetEnv interface
I'm setting up a manhole with twisted.conch.manhole, and it works, but gives this warning:
Can't handle environment variables for SSH avatar
On Tue, 24 May 2022 at 14:35, Peter Westlake
I'm setting up a manhole with twisted.conch.manhole, and it works, but gives this warning:
Can't handle environment variables for SSH avatar
: does not provide ISessionSetEnv interface. It should be decorated with @implementer(ISession, ISessionSetEnv) to support env variables. I've looked at the release notes about #9315, but can't see where in my code to add @implementer. Here's the code:
Hi Peter, I don't think there is anything wrong with your code. The issue is with manhole supoprt for SSH - twisted.conch.manhole_ssh.TerminalSession You can ignore it, or try to send a fix for https://github.com/twisted/twisted/blob/trunk/src/twisted/conch/manhole_ssh.... to implement or ignore the setEnv command. I guess that for manhole just ignoring the setEnv requests is ok. I am not sure what use case you can have for remote environment control via manhole. [snip] Cheers -- Adi Roiban
On Tue, May 24, 2022 at 9:50 AM Adi Roiban
On Tue, 24 May 2022 at 14:35, Peter Westlake
wrote: I'm setting up a manhole with twisted.conch.manhole, and it works, but
gives this warning:
Can't handle environment variables for SSH avatar
: does not provide ISessionSetEnv interface. It should be decorated with @implementer(ISession, ISessionSetEnv) to support env variables. I've looked at the release notes about #9315, but can't see where in my
code to add @implementer. Here's the code:
Hi Peter,
I don't think there is anything wrong with your code.
The issue is with manhole supoprt for SSH - twisted.conch.manhole_ssh.TerminalSession
You can ignore it, or try to send a fix for
https://github.com/twisted/twisted/blob/trunk/src/twisted/conch/manhole_ssh.... to implement or ignore the setEnv command.
I guess that for manhole just ignoring the setEnv requests is ok. I am not sure what use case you can have for remote environment control via manhole.
Conch shouldn't even emit this warning. The fallback behavior of ignoring the env request is fine. There's no reason to bother people about their session not implementing this interface if they don't need to support environment variables. A good PR would be one that just deletes the log.warn call. Jean-Paul
Okay, thanks! I'll see what I can do about a PR. Peter. On Tue, 24 May 2022, at 15:45, Jean-Paul Calderone wrote:
Conch shouldn't even emit this warning. The fallback behavior of ignoring the env request is fine. There's no reason to bother people about their session not implementing this interface if they don't need to support environment variables.
A good PR would be one that just deletes the log.warn call.
Jean-Paul
The ticket is #10347 https://twistedmatrix.com/trac/ticket/10347. I've assigned myself, if that's okay. Peter. On Tue, 24 May 2022, at 18:44, Peter Westlake wrote:
Okay, thanks! I'll see what I can do about a PR.
Peter.
On Tue, 24 May 2022, at 15:45, Jean-Paul Calderone wrote:
Conch shouldn't even emit this warning. The fallback behavior of ignoring the env request is fine. There's no reason to bother people about their session not implementing this interface if they don't need to support environment variables.
A good PR would be one that just deletes the log.warn call.
Jean-Paul
_______________________________________________ Twisted mailing list -- twisted@python.org To unsubscribe send an email to twisted-leave@python.org https://mail.python.org/mailman3/lists/twisted.python.org/ Message archived at https://mail.python.org/archives/list/twisted@python.org/message/YZCLLABAJQQ... Code of Conduct: https://twisted.org/conduct
On Tue, 24 May 2022, at 19:15, Peter Westlake wrote:
The ticket is #10347 https://twistedmatrix.com/trac/ticket/10347. I've assigned myself, if that's okay.
Running the tests with tox -e nocov gives an error, builtins.ModuleNotFoundError: No module named 'hamcrest'. This is on Ubuntu 20.04, Python 3.8.10, and I did install python-hamcrest. Python 3 can import it. Running just tox instead of tox -e nocov gives several "Connection reset by peer" and a huge number of "Cannot find link target" errors. How should I run the tests? Peter.
On May 24, 2022, at 2:20 PM, Peter Westlake
wrote: On Tue, 24 May 2022, at 19:15, Peter Westlake wrote:
The ticket is #10347 https://twistedmatrix.com/trac/ticket/10347. I've assigned myself, if that's okay.
Running the tests with tox -e nocov gives an error, builtins.ModuleNotFoundError: No module named 'hamcrest'.
`nocov` by itself isn't really a valid environment. You probably want `tox -e alldeps-nocov`. (In general although you have lots of options for how to compose an environment depending on what you want to test, start with the stuff in `tox -l` for most projects.)
This is on Ubuntu 20.04, Python 3.8.10, and I did install python-hamcrest. Python 3 can import it.
Note that the python3 environment you're in as you set up `tox` is not itself the environment `tox` is running tests in. You need to run ./.tox/{env}/bin/python, so in this case ./.tox/nocov/bin/python.
Running just tox instead of tox -e nocov gives several "Connection reset by peer" and a huge number of "Cannot find link target" errors.
`tox` itself will try to run (among other things) the release preparation environment, which will probably mess things up.
How should I run the tests?
Something like "tox -r -p auto -e lint -e mypy -e alldeps-nocov -e nodeps-nocov" probably :-). -g
Peter.
_______________________________________________ Twisted mailing list -- twisted@python.org mailto:twisted@python.org To unsubscribe send an email to twisted-leave@python.org mailto:twisted-leave@python.org https://mail.python.org/mailman3/lists/twisted.python.org/ https://mail.python.org/mailman3/lists/twisted.python.org/ Message archived at https://mail.python.org/archives/list/twisted@python.org/message/H6Z2TDALIGX... https://mail.python.org/archives/list/twisted@python.org/message/H6Z2TDALIGX... Code of Conduct: https://twisted.org/conduct https://twisted.org/conduct
On Wed, 25 May 2022, at 00:18, Glyph wrote:
On May 24, 2022, at 2:20 PM, Peter Westlake
wrote:
How should I run the tests?
Something like "tox -r -p auto -e lint -e mypy -e alldeps-nocov -e nodeps-nocov" probably :-).
That;s a lot better, thanks! Everything passes except for three errors right at the end, "builtins.TypeError: a bytes-like object is required, not 'str'" in pydoctor/model.py, line 634. Those look sufficiently unrelated to the change for me to put in the pull request. The PR is https://github.com/twisted/twisted/pull/1733. Peter.
participants (4)
-
Adi Roiban
-
Glyph
-
Jean-Paul Calderone
-
Peter Westlake