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 #45

Closed
wants to merge 47 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f1542f7
Updating exception variable naming to be Python3 compatible.
pferate Dec 24, 2014
80f9281
Updating StringIO -> io.BytesIO. Also updated urlparse imports to ap…
pferate Dec 24, 2014
0727747
Updated built in function: file() -> open()
pferate Dec 24, 2014
fa8a6f4
Adding long() for compatibility
pferate Dec 24, 2014
10c20b4
Updating more import calls
pferate Dec 24, 2014
73328fb
Adding is_string() to handle both Python2 and Python3 easily (Maybe m…
pferate Dec 24, 2014
d4a189a
Fixing more urllib imports.
pferate Dec 24, 2014
bb67eae
Adding python 2 and 3 compatibility for iteritems().
pferate Dec 24, 2014
50026bd
Adding python 2 and 3 compatibility for iteritems() and iterkeys().
pferate Dec 24, 2014
2a1e5d3
Changing None to empty string for urlunparse().
pferate Dec 24, 2014
65c4874
Fixed inconsistent white space
pferate Dec 24, 2014
3de8a2f
Fixed urllib imports and unicode encoding attempt.
pferate Dec 24, 2014
8664fd4
Adding python 2 and 3 compatibility for iteritems().
pferate Jan 5, 2015
18a6d94
Updating BytesIO() input from string to bytestring
pferate Jan 5, 2015
38d281b
Updating xrange() to range().
pferate Jan 5, 2015
c0b5250
Updating `dict.has_key(key)` to `key in dict`, and importing reduce()…
pferate Jan 6, 2015
d994957
Allowing JSON content if already a str
pferate Jan 6, 2015
250d8ec
Updating `dict.has_key(key)` to `key in dict`, and changing strings t…
pferate Jan 6, 2015
202c5cb
Changing the file pointer for the MultiPartMessage: StringIO if pytho…
pferate Jan 6, 2015
539a651
Fixed None value assumption as 0.
pferate Jan 6, 2015
3489471
Cleaning up more unicode/bytes conflicts.
pferate Jan 7, 2015
836ede9
Removing questionable test (Not sure if we really want to open a bina…
pferate Jan 7, 2015
96c84ef
Fixed urllib import.
pferate Jan 7, 2015
391df3c
Tried and failed to get this test working for all python versions. S…
pferate Jan 7, 2015
58a7962
Fixed a unicode encoding case
pferate Jan 7, 2015
9b0a996
Adding branches to tox whitelist
pferate Jan 8, 2015
2defcf1
Adding travis-ci config file (based off of google/oauth2client)
pferate Jan 8, 2015
2c54788
Fixing formatting.
pferate Jan 8, 2015
e7f9739
Fixing more formatting (tox.ini).
pferate Jan 8, 2015
7df848c
Removing Tox Environment, docs (not yet implemented)
pferate Jan 8, 2015
9bbc85a
Cleaning up some excess commented out options.
pferate Jan 8, 2015
abb41b5
Changing different dictionary iterators to simpler syntax. That mean…
pferate Jan 8, 2015
5c622e3
Making mostly PEP8 compliant. A few lines were left over 80 characte…
pferate Jan 8, 2015
a1deda6
Some more PEP8 compliance.
pferate Jan 8, 2015
257cf90
First pass at coveralls integration.
pferate Jan 9, 2015
f2b69c5
Adding IDE (PyCharm) directory to `.gitignore`
pferate Jan 9, 2015
f23afee
Trying to have coveralls run in both 2.7 and 3.4.
pferate Jan 9, 2015
1ea731f
Another attempt to have coveralls run in 2.7 and 3.4.
pferate Jan 9, 2015
015fee2
Changing long to int
pferate Jan 14, 2015
65869b8
Changing long to int (Including missing conversion to int)
pferate Jan 14, 2015
5434b7a
Cleaning up imports (using six)
pferate Jan 14, 2015
ce5c5cf
Added `six` requirement and cleaned up lines for PEP8.
pferate Jan 16, 2015
4c44841
Remove unused imports
maxwell-k Jan 27, 2015
9513711
Remove unnecessary assignments
maxwell-k Jan 27, 2015
08dfb1f
Decode request result if on Python 3
maxwell-k Jan 27, 2015
15babeb
Merge pull request #2 from maxwell-k/python3
pferate Jan 28, 2015
49b3bf0
Convert JSON content to str if it is bytes.
pferate Feb 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed urllib import.
pferate committed Jan 7, 2015
commit 96c84efe954e992fc9b514254890fbb79c4a166a
8 changes: 6 additions & 2 deletions tests/test_http.py
Original file line number Diff line number Diff line change
@@ -26,14 +26,18 @@
import logging
import os
import unittest
import urllib
import random
try:
from io import BytesIO, StringIO, FileIO
except ImportError:
import BytesIO, StringIO, FileIO
import time

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

from googleapiclient.discovery import build
from googleapiclient.errors import BatchError
from googleapiclient.errors import HttpError
@@ -932,7 +936,7 @@ def _postproc(resp, content):
req = HttpRequest(
http,
_postproc,
'http://example.com?' + urllib.urlencode(query),
'http://example.com?' + urlencode(query),
method='GET',
body=None,
headers={},