Move item "Push to repository"
Fix docstrings/comment for time shift
The definition of the time shift in ftputil was changed several years
ago from "server time - client time" to "server time - UTC time".
Add TODO on documentation link fix
Add TODO item regarding download link
Follow this for the next version announcements.
Add new version to `versions.md`
Fix `dist` Makefile target
Assume installation with `pip`
Remove text from the `README.md` file that implicitly assumes that the
user may install ftputil with `python setup.py install`. This is
deprecated and presumably almost all users will use some form of Python
package manager instead.
Set version to 5.1.0 and patch files accordingly
Add announcement for version 5.1.0
Send "OPTS UTF8 ON" in default session factory if needed
This applies the feature/fix we have in `session.session_factory` also
to the default session factory for Python 3.9 and up. We don't need to
apply this change for Python 3.8 and lower because there, the encoding
is always latin-1.
ticket: 157
Extract helper function `_maybe_send_opts_utf8_on`
This basically is the former method `_handle_encoding` with a better
name. I extracted it because I want to use it in the definition of
`host.default_session_factory`.
ticket: 157
Mark up unused variable `year` to `_year`
This satisfies `ruff check`.
Make docstring clearer
ticket: 157
Don't use deprecated `datetime.datetime.utcnow`
This function is deprecated since Python 3.12. Note that we can't use
the workaround suggested in the Python 3.12 documentation which uses the
argument `datetime.UTC`. The problem is that this attribute isn't
present in Python 3.7. However, `datetime.timezone.utc` works.
Add Python 3.12 to Tox test targets
Test ftputil with Python 3.12
Increase Fedora image version
Along these lines, change the "native" Python to 3.11.
Get rid of overly complex design
After coming across RFC 2640
( https://datatracker.ietf.org/doc/html/rfc2640.html ), I realized that
the previously planned design can be greatly simplified.
The previous design was more complicated because I wanted to give users
more control in case the server doesn't support UTF-8 or supports it
only presumbly. After reading RFC 2640, I learned that we can test for
UTF-8 support with the FTP `FEAT` command, which I wasn't aware of.
Also, don't try to anticipate all things that might not work. Instead,
deliver a relatively simple solution and deliver a subsequent ftputil
version in the unlikely case it's necessary.
Another presumably even simpler approach would have been not to run
`FEAT` and instead just send `OPTS UTF8 ON` and catch possible
exceptions. However, since the RFC gives us the chance to implement
something cleaner, let's go for that.
ticket: 157
Format `test_real_ftp.py` with Black