borg
borg copied to clipboard
use more py39 features
master and 1.4-maint branch only, 1.2-maint is still on py38, 1.1-maint even older.
https://docs.python.org/3/whatsnew/3.9.html
especially:
- [ ] https://docs.python.org/3/whatsnew/3.9.html#dictionary-merge-update-operators
- [ ] https://docs.python.org/3/whatsnew/3.9.html#new-string-methods-to-remove-prefixes-and-suffixes
https://docs.python.org/3/whatsnew/3.9.html#random new randbytes function
Note: random.randbytes is not intended for secure random:
This method should not be used for generating security tokens. Use secrets.token_bytes() instead.
In my humble opinion we should always use secure random even if it is not always necessary. Deciding which numbers are safe to generate insecurely and which ones are not is error prone. It is much simpler to generate all random securely unless we are experiencing a measurable performance degradation.
#7487 < ran pyupgrade (master). #7996 < ran pyupgrade (1.4-maint).
Considering dropping py38 and requiring >=py39 for borg 1.4. Any issues with that?
Note: py38 will run out of upstream support by 2024-10 anyway.
Update:
- dropped py38 for 1.4-maint - dists adopting borg 1.4 will have python >= 3.9, thus no problem.
- master (borg2) already dropped py38 in the past
TODO: do manual changes for better using py39 features where needed.