urllib3 error under python3.12
I have:
-
searched https://gitlab.com/duplicity/duplicity/-/issues for similar issues. If you find a similar issue and the issue is still open, add a comment to the existing issue instead of opening a new one. If you find a Closed issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one. -
Snap is not applicable for this issue
Summary
Duplicity gives the following error when run under Python 3.12:
Attempt of list Nr. 1 failed. ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
Environment
- AlmaLinux 9.4 and MacOS Sonoma
- Python 3.12.1
- Duplicity 3.0.0 from PyPI
Command: duplicity list-current-files boto3+s3://...
Steps to reproduce
- Create a fresh Python virtual environment using Python 3.12
- In that environment:
pip install wheelpip install duplicityduplicity list-current-files ...
What is the current bug behaviour?
Generates these messages:
Attempt of list Nr. 1 failed. ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
Attempt of list Nr. 2 failed. ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
Attempt of list Nr. 3 failed. ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
Attempt of list Nr. 4 failed. ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
Giving up after 5 attempts. ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
What is the expected correct behaviour?
No such error messages, and the command completes normally.
Relevant logs and/or screenshots
Possible fixes
Upgrading to urlib3 1.26.5 or higher fixes the issue. (That version updated the vendored six library to 1.16.0.)
I also tested this with Python 3.11. The issue does not occur for that version.