Skip to content

[18.0][FIX] auto_backup: pin paramiko for compatibility with pysftp - #3343

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
StefanRijnhart:18.0-auto_backup-pin_paramiko
Aug 14, 2025
Merged

OCA-git-bot merged 1 commit into
OCA:18.0from
StefanRijnhart:18.0-auto_backup-pin_paramiko

Conversation

@StefanRijnhart

Copy link
Copy Markdown
Member

paramiko 4.0.0 dropped support for DSSKey imported by pysftp. See paramiko/paramiko#2537

File "/home/odoo/odoo/18.0/server-tools/auto_backup/tests/test_db_backup.py", line 9, in <module>
    import pysftp
  File "/home/odoo/.cache/pypoetry/virtualenvs/18-0-liVCuCj7-py3.12/lib/python3.12/site-packages/pysftp/__init__.py", line 14, in <module>
    from paramiko import AgentKey, RSAKey, DSSKey
ImportError: cannot import name 'DSSKey' from 'paramiko'

The import error was dropped silently, making the error show up as

File "/home/odoo/odoo/18.0/server-tools/auto_backup/tests/test_db_backup.py", line 28, in <module>
    class TestConnectionException(pysftp.ConnectionException):
                                  ^^^^^^
NameError: name 'pysftp' is not defined

@ByteMeAsap ByteMeAsap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

from datetime import datetime, timedelta
from unittest.mock import PropertyMock, patch

import pysftp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also make the same change at

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks.

paramiko 4.0.0 dropped support for DSSKey imported by pysftp. See paramiko/paramiko#2537

```
File "/home/odoo/odoo/18.0/server-tools/auto_backup/tests/test_db_backup.py", line 9, in <module>
    import pysftp
  File "/home/odoo/.cache/pypoetry/virtualenvs/18-0-liVCuCj7-py3.12/lib/python3.12/site-packages/pysftp/__init__.py", line 14, in <module>
    from paramiko import AgentKey, RSAKey, DSSKey
ImportError: cannot import name 'DSSKey' from 'paramiko'
```

The import error was dropped silently, making the error show up as

```
File "/home/odoo/odoo/18.0/server-tools/auto_backup/tests/test_db_backup.py", line 28, in <module>
    class TestConnectionException(pysftp.ConnectionException):
                                  ^^^^^^
NameError: name 'pysftp' is not defined
```

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-3343-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 6353881 into OCA:18.0 Aug 14, 2025
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 5a9d89c. Thanks a lot for contributing to OCA. ❤️

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants