From 11acb49295cffb8586378abc97c93313530645e9 Mon Sep 17 00:00:00 2001 From: devdave Date: Tue, 28 May 2013 18:33:37 -0500 Subject: [PATCH 1/4] Allow for long's as well as ints for request params _params['max_id'] 330122291755220993L type(_params['max_id']) isinstance(_params['max_id'], int) False isinstance(_params['max_id'], (long,int)) True --- twython/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twython/helpers.py b/twython/helpers.py index 7b8275b..049fb40 100644 --- a/twython/helpers.py +++ b/twython/helpers.py @@ -12,7 +12,7 @@ def _transparent_params(_params): params[k] = 'true' else: params[k] = 'false' - elif isinstance(v, basestring) or isinstance(v, int): + elif isinstance(v, basestring) or isinstance(v, (long,int)): params[k] = v else: continue -- 2.39.5 From a246743698ba085074e584ebf0829ffaec5233fa Mon Sep 17 00:00:00 2001 From: devdave Date: Tue, 28 May 2013 20:03:20 -0500 Subject: [PATCH 2/4] Added compat, numeric_types as allowed param type. --- twython/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twython/helpers.py b/twython/helpers.py index 049fb40..daa3370 100644 --- a/twython/helpers.py +++ b/twython/helpers.py @@ -1,4 +1,4 @@ -from .compat import basestring +from .compat import basestring, numeric_types def _transparent_params(_params): @@ -12,7 +12,7 @@ def _transparent_params(_params): params[k] = 'true' else: params[k] = 'false' - elif isinstance(v, basestring) or isinstance(v, (long,int)): + elif isinstance(v, basestring) or isinstance(v, numeric_types): params[k] = v else: continue -- 2.39.5 From b0d801b7bb6a71ffb31d6c18092c8f1eb6b42506 Mon Sep 17 00:00:00 2001 From: devdave Date: Tue, 28 May 2013 20:05:04 -0500 Subject: [PATCH 3/4] Added numeric_types --- twython/compat.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/twython/compat.py b/twython/compat.py index 79f9c2c..26af6e8 100644 --- a/twython/compat.py +++ b/twython/compat.py @@ -22,6 +22,7 @@ if is_py2: str = unicode basestring = basestring + numeric_types = (int, long, float) elif is_py3: @@ -29,3 +30,4 @@ elif is_py3: str = str basestring = (str, bytes) + numeric_types = (int, float) -- 2.39.5 From 13d4725fcad056e1f78ea3c1636720700eb3c17a Mon Sep 17 00:00:00 2001 From: devdave Date: Tue, 28 May 2013 21:01:05 -0500 Subject: [PATCH 4/4] Update AUTHORS.rst --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 2db7027..e155804 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -39,3 +39,4 @@ Patches and Suggestions - `Paul Solbach `_, fixed requirement for oauth_verifier - `Greg Nofi `_, fixed using built-in Exception attributes for storing & retrieving error message - `Jonathan Vanasco `_, Debugging support, error_code tracking, Twitter error API tracking, other fixes +- `DevDave `_, quick fix for longs with helper._transparent_params -- 2.39.5