Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 migration #167

Closed
je-vv opened this issue Nov 10, 2016 · 3 comments
Closed

python3 migration #167

je-vv opened this issue Nov 10, 2016 · 3 comments

Comments

@je-vv
Copy link

je-vv commented Nov 10, 2016

Wondering if possible to migrate to python3 as the dependencies are available for python3 as well. On a 1st trial, besides the oaut2 lib patch (see issue #166), the following patch for httplib is also required:

diff -Naur GDriveFS-0.14.8-old/gdrivefs/gdtool/drive.py GDriveFS-0.14.8/gdrivefs/gdtool/drive.py
--- GDriveFS-0.14.8-old/gdrivefs/gdtool/drive.py 2016-11-10 11:38:48.477494868 -0600
+++ GDriveFS-0.14.8/gdrivefs/gdtool/drive.py 2016-11-10 11:41:13.914160628 -0600
@@ -4,7 +4,7 @@
import random
import json
import time
-import httplib
+import http.client
import ssl
import tempfile
import pprint
@@ -54,7 +54,7 @@
for n in range(0, 5):
try:
return f(*args, **kwargs)
- except (ssl.SSLError, httplib.BadStatusLine) as e:
+ except (ssl.SSLError, http.client.BadStatusLine) as e:
# These happen sporadically. Use backoff.
_logger.exception("There was a transient connection "
"error (%s). Trying again [%s]: %s",

But that's not all. Some python3 libraries have changed substantially, therefore, there errors to be solved like:

...
File "/usr/lib/python3.5/tempfile.py", line 483, in func_wrapper
return func(*args, **kwargs)
TypeError: a bytes-like object is required, not 'str'

So, more fixes are required...

@dsoprea
Copy link
Owner

dsoprea commented Dec 8, 2016

It's be awesome if you might start introducing these changes. Furthermore, you'd be a rockstar in my book if you could write some unit-tests for the affected areas.

Naturally, I'd provide any support that I could. I'd even mention you in the documentation for helping with the effort. Hello egoboo.

@GreyAlien502
Copy link
Contributor

I believe i have made all the changes necessary to move this project to python 3 (3.6).
I have tested it out by using all the features, but i'm not sure what unit tests would be useful here.

@dsoprea
Copy link
Owner

dsoprea commented Jan 28, 2019

Merged.

@dsoprea dsoprea closed this as completed Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants