Conversation
I've done three things: 1. Replaced print with print(), imported from __future__ 2. Wrapped python2-only libraries in try,except with their python3 equivalents 3. Replaced xrange with range, which in Python3 defaults to xrange-like functionality. In all cases, the size of the expclicit list is either small (e.g. xrange(5) or xrange(self.max_attempts) or small compared to the other data (self.index_map).
|
The verified_https code relies on internals (non-public api) which probably changed in 3.x. It looks like 3.4 has better built-in support for verifying peer certificates, but not sure about earlier 3.x. It will probably be a pain to make verified _https support a wider range of versions, but not impossible. This is one of the biggest failings of the Python standard library, we shouldn't have to go through major hoops just to get not broken https, I can't believe it took until 3.4. Another direction would be to use a third party library like requests, but I really want Transfer API lib to work out of the box with Python standard lib. |
|
Before spending time on verified_https, I would sub the standard lib HTTPSConnection back in(don't use verified_https at all) and see if it works in Python3. My guess is that it will work and the problem really is in verified_https, but it's possible there is a more subtle change in how the httplib works that is causing it to break. |
Here's a bunch of "translation". Python2.7 seems to still be working fine. I've run into a non-trivial issue in Python3. I can authenticate, but issuing any real calls leads to an error buried in sockets. Any suggestions?