[openstack-dev] [swift] Plan to add Python 3 support to Swift

Victor Stinner vstinner at redhat.com
Fri Feb 12 11:13:12 UTC 2016


Hi,

Le 08/02/2016 14:42, Victor Stinner a écrit :
 > https://review.openstack.org/#/c/237019/

Nice, this one was merged!


> https://review.openstack.org/#/c/237027/
> https://review.openstack.org/#/c/236998/

These two changes look to be blocked by encodings issues. Tim Burke, 
Samuel Merritt and Christian Schwede have concerns about the exact 
behaviour on Python 3.

Let me explain how I'm working. I spend between 10 minutes and one day 
to port a single unit test and then I submit a patch (or patches if the 
change is big). I prefer to work incrementally: first fix the unit test, 
and then enhance the code if needed.

Right now, unit tests don't pass, there are still serious bytes vs 
Unicode issues. I would prefer to reach a first milestone where unit 
tests pass and then discuss how to fix complex encoding issues.

Change 236998: For the hmac patch, supporting arbitrary hash prefix or 
suffix requires to implement a new feature. Swift parses the 
configuration files using the ConfigParser which doesn't support 
arbitrary bytes. I understand the use case and I agree that something 
should be done, but I suggest to do that later.

Change 237027: For the encoding of HTTP headers, it looks like Swift 
doesn't respect HTTP RFCs. The HTTP requires headers to be encoded to 
Latin1, but Swift (server or client, sorry I don't know) encode headers 
to UTF-8. Something should be do too, but it will require a deep 
analysis, prepare a transition period, etc. This problem is complex and 
cannot be fixed right now.

Just to be clear: Swift does not support Python 3, so we are still free 
to change completely the code for Python 3, until Swift is fully 
compatible with Python 3.

Swift is not my main target, so I cannot spend too much time on it. If 
you expect me to solve all issues at once, I'm sorry, I cannot help :-/

Victor



More information about the OpenStack-dev mailing list