valerytschopp / python-radosgw-admin

Ceph RADOS Gateway admin operations
GNU General Public License v3.0
37 stars 22 forks source link

Support Python3 #4

Closed ClemPi closed 7 years ago

ClemPi commented 7 years ago

Code bytes http response. Handle urllib refactor.

Address #2

valerytschopp commented 7 years ago

Hi ClemPi, For the urllib refactor, wouldn't it be better to do something like this:

try:
    from urllib.parse import urlparse
except ImportError:
     from urlparse import urlparse

instead of explicitly checking the python version?

ClemPi commented 7 years ago

I did this because the method is not the same and we have to explicitly check the version when calling urlencode : https://github.com/valerytschopp/python-radosgw-admin/pull/4/commits/566adf64a0bae09c967109703153a11a2c13dc38#diff-fe3c0a5df953368eb825f1815aa2b8c9R99. But we can do the other way if you prefer

valerytschopp commented 7 years ago

Yes, I understand. Sorry my example was bad, I really would prefer:

try:
    from urllib.parse import urlencode
except ImportError:
    from urllib import urlencode

...
      urlencode(query_params)
...
ClemPi commented 7 years ago

Yes, better alternative. Just updated the PR