~sschwarzer/ftputil

1

[ftputil] Python 3.9's ftplib path encoding change - feedback on ticket #143?

Details
Message ID
<6d202007-c789-06bd-916b-c09f016dfc61@sschwarzer.net>
DKIM signature
missing
Download raw message
In Python 3.9, `ftplib.FTP` now uses UTF-8 by default to
encode directory and file paths. [1] All previous Python 2.x
and 3.x versions used latin-1. Unfortunately, this also
causes a backward-incompatible change in ftputil (despite no
changes in ftputil itself) if you switch from Python 3.8 and
earlier to Python 3.9 and later (assuming later Python
version will also default to UTF-8 as path encoding).

This seemingly small change gives me quite some headaches
since I take backward compatibility rather seriously.

I entered Ticket #143 [2] to write down my thoughts and
potential plans. I'd be interested in your feedback, either
in the ticket or here on the mailing list.

What do you think?

[1] https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-python-api
    (7th bullet point)
[2] https://ftputil.sschwarzer.net/trac/ticket/143

Stefan
Details
Message ID
<CAA2zXtCKafjyaESUsSQLNDhF5--xdky5z_-BR3--TYCJoa3vPg@mail.gmail.com>
In-Reply-To
<6d202007-c789-06bd-916b-c09f016dfc61@sschwarzer.net> (view parent)
DKIM signature
missing
Download raw message
I can appreciate the difficult decisions you have to make. First, let
me say whichever path you choose, ftputil remains a useful and
high-quality library.

I do not know how representative I am of Python developers, but
personally, I tend to think of ftputil as kind of a replacement for
the corresponding facilities in the standard library. I still use
ftplib sometimes, but if I decide that my Python program is getting
complicated enough to introduce ftputil (or that ftputil just happens
to be a much better fit), then I stop using ftplib and switch
completely over to ftputil. I don't see myself using both in the same
program.

So I personally don't think I have much need for ftputil and ftplib
paths to be 100% compatible. In fact, I might even be inclined to
specifically use ftputil *in order to* prevent my program from
behaving differently in Python 3.8 and 3.9 (if you take that path).

Those are just my thoughts. I support the library regardless. And
honestly, it shouldn't affect me at all either way, because I'm in the
U.S. and I've never encountered a non-ASCII path while trying to use
FTP.

John Y.
Reply to thread Export thread (mbox)