Skip to content

Accept both OpenSSH scp missing-direction error messages - #851

Closed
rosset wants to merge 1 commit into
ronf:developfrom
rosset:develop
Closed

rosset wants to merge 1 commit into
ronf:developfrom
rosset:develop

Conversation

@rosset

@rosset rosset commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Accept both OpenSSH scp missing-direction error messages

The exact stderr message varies between OpenSSH versions, so match against both known variants instead of a single exact string.

Fixes the test against OpenSSH 10.6

@ronf

ronf commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR, and for tracking down this failure!

I looked into where the message comes from, and it isn't OpenSSH. The scp xxx command in this test runs against asyncssh's own SCP server, not OpenSSH's scp. That server parses its arguments with Python's argparse, so the error text comes from argparse. CPython changed this message in python/cpython#157134 (gh-157127, "Reword the argparse mutually exclusive group error message"). That change is only on CPython main so far, which will become 3.16. The 3.13, 3.14 and 3.15 branches still produce the old wording. My guess is that your environment has a 3.16 pre-release, which would also explain why the failure showed up alongside OpenSSH 10.6.

The code change itself looks good to me. Could you update the comment and the commit message to name the actual cause? For example:

            # argparse reworded this message in Python 3.16 (gh-157127)

and a commit message something like:

Accept Python 3.16 argparse wording for missing scp direction

Python 3.16 rewords the argparse error for a missing required
mutually exclusive argument, so accept both the old and new
messages in the SCP missing direction test.

Once that's updated, I'm happy to merge it. Thanks again!

Python 3.16 rewords the argparse error for a missing required
mutually exclusive argument, so accept both the old and new
messages in the SCP missing direction test.

Signed-off-by: Filipe Rosset <rosset.filipe@gmail.com>
@rosset

rosset commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the PR, and for tracking down this failure!

I looked into where the message comes from, and it isn't OpenSSH. The scp xxx command in this test runs against asyncssh's own SCP server, not OpenSSH's scp. That server parses its arguments with Python's argparse, so the error text comes from argparse. CPython changed this message in python/cpython#157134 (gh-157127, "Reword the argparse mutually exclusive group error message"). That change is only on CPython main so far, which will become 3.16. The 3.13, 3.14 and 3.15 branches still produce the old wording. My guess is that your environment has a 3.16 pre-release, which would also explain why the failure showed up alongside OpenSSH 10.6.

The code change itself looks good to me. Could you update the comment and the commit message to name the actual cause? For example:

        # argparse reworded this message in Python 3.16 (gh-157127)

and a commit message something like:

Accept Python 3.16 argparse wording for missing scp direction

Python 3.16 rewords the argparse error for a missing required
mutually exclusive argument, so accept both the old and new
messages in the SCP missing direction test.

Once that's updated, I'm happy to merge it. Thanks again!

done

@ronf

ronf commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Thanks for the update! This has been merged into develop as commit 44a9e2c.

@ronf ronf closed this Nov 30, 2026
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9877d1e) to head (be53411).
⚠️ Report is 13 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop      #851    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          104       105     +1     
  Lines        35533     35818   +285     
  Branches      3407      3423    +16     
==========================================
+ Hits         35533     35818   +285     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants