Skip to content

Does not work on Python 3 due to type checking #2

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

Closed
imrehg opened this issue Jul 28, 2016 · 2 comments
Closed

Does not work on Python 3 due to type checking #2

imrehg opened this issue Jul 28, 2016 · 2 comments
Assignees

Comments

@imrehg
Copy link
Contributor

imrehg commented Jul 28, 2016

Commit 027de2d broke the SDK on Python 3 as there is no long type on Python 3, only in Python 2. Compare Python 2 numeric types and Python 3 numeric types

Possible workaround is similar as shown here: http://python3porting.com/differences.html#long

This shows up in the tests as well:

test_send_message (tests.test_messages_api.MessagesApiTests) ... ERROR
test_get_user_devices (tests.test_users_api.UsersApiTests) ... ERROR
test_get_self_async (tests.test_users_api.UsersApiTests) ... ERROR
test_get_self (tests.test_users_api.UsersApiTests) ... ERROR

======================================================================
ERROR: test_send_message (tests.test_messages_api.MessagesApiTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/src/app/artikcloud-python/tests/test_messages_api.py", line 40, in test_send_message
    response = self.messages_api.send_message_action(self.message)
  File "/usr/src/app/artikcloud-python/artikcloud/apis/messages_api.py", line 585, in send_message_action
    callback=params.get('callback'))
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 322, in call_api
    response_type, auth_settings, callback)
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 114, in __call_api
    header_params = self.sanitize_for_serialization(header_params)
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 193, in sanitize_for_serialization
    types = (str, int, long, float, bool, tuple)
NameError: name 'long' is not defined

======================================================================
ERROR: test_get_user_devices (tests.test_users_api.UsersApiTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/src/app/artikcloud-python/tests/test_users_api.py", line 24, in setUp
    self.user_id = self.users_api.get_self().data.id
  File "/usr/src/app/artikcloud-python/artikcloud/apis/users_api.py", line 282, in get_self
    callback=params.get('callback'))
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 322, in call_api
    response_type, auth_settings, callback)
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 114, in __call_api
    header_params = self.sanitize_for_serialization(header_params)
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 193, in sanitize_for_serialization
    types = (str, int, long, float, bool, tuple)
NameError: name 'long' is not defined

======================================================================
ERROR: test_get_self_async (tests.test_users_api.UsersApiTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/src/app/artikcloud-python/tests/test_users_api.py", line 24, in setUp
    self.user_id = self.users_api.get_self().data.id
  File "/usr/src/app/artikcloud-python/artikcloud/apis/users_api.py", line 282, in get_self
    callback=params.get('callback'))
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 322, in call_api
    response_type, auth_settings, callback)
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 114, in __call_api
    header_params = self.sanitize_for_serialization(header_params)
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 193, in sanitize_for_serialization
    types = (str, int, long, float, bool, tuple)
NameError: name 'long' is not defined

======================================================================
ERROR: test_get_self (tests.test_users_api.UsersApiTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/src/app/artikcloud-python/tests/test_users_api.py", line 24, in setUp
    self.user_id = self.users_api.get_self().data.id
  File "/usr/src/app/artikcloud-python/artikcloud/apis/users_api.py", line 282, in get_self
    callback=params.get('callback'))
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 322, in call_api
    response_type, auth_settings, callback)
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 114, in __call_api
    header_params = self.sanitize_for_serialization(header_params)
  File "/usr/src/app/artikcloud-python/artikcloud/api_client.py", line 193, in sanitize_for_serialization
    types = (str, int, long, float, bool, tuple)
NameError: name 'long' is not defined
@yujingwu
Copy link
Member

@maneeshsahu could you please take a look? @imrehg already submit a pull request to fix the issue. Thanks

@yujingwu yujingwu self-assigned this Aug 2, 2016
@yujingwu
Copy link
Member

yujingwu commented Aug 2, 2016

I talked to Maneesh. It is ok to merge the pull which fixes this issue.

@yujingwu yujingwu closed this as completed Aug 4, 2016
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