Closed nigotiator closed 6 years ago
I got this problem too, it's occurred in Win 10 (Python 2.7.15 and robot 3.0.4) and Win7 (Python 2.7.13 and robot 3.0.4). But there's no such issue in Fedora (Python 2.7.15 and robot 3.0.4).
After a few tries, I found that under Python 3 (my environment is Python 3.7.0 and robot 3.0.4) will be work in Windows. (but it's not a solution, it's a workaround)
@hidebear: Using Python 2 (over 3) is a workaround, not a solution.
Anyway, I am interested in the problem so I'll see if I can reproduce this on Windows 10.
Could not reproduce.
@asyrjasalo
I meet the same problem, my response has a filed named registerTime
, which value will be a long type when used response.json()
and lead this problem, I print response.json()
, response.text
, response.content
, result is below:
response.json()
:
{u'message': u'\u6210\u529f', u'code': u'100000', u'data': {u'mobileNumber': u'15252896407', u'channelUserKey': u'5||eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNTQ1MTgyNDYwMTk1LCJleHAiOjE1NDU3ODcyNjAsInVzZXJJZCI6IjM0MDAwMjEzIn0.I706vOZeIORzuv92AKIQq1IvFq4JTJe4-VGVggeT5RTDpw5O3TZDobbdjkuxamaIHgU1hpN3kiwm42WTUtITg', u'weixinAvatar': None, u'unionId': None, u'userId': u'34000213', u'registerTime': 1545182459000L, u'bindingMobileNumber': True, u'userSig': u'eJxFkNFOgzAUhtFW41pCyVosgsGBllGnGxZ1JsGoWxHoDSloMT47usaiTfn4v9ycr7--DiH7f6ukBIqVmjmqsp5cJBza2PLUFxVtSaKxNjSilBaKETVwP0wgCCMMXERegfQsWFhhrsousZQLD7xwY4mTB7fInSp1RHZHdI2qxv0u1GPpPThH2e8TgIm65LIB-jdmxyIt5CWLcoKXHwGb0eRfrh0c0uhPMN3itfzroeyvn9HGdfrxfT1r1XKsapitdy1w9aBmLiYaOm6LeRQHxPMX6Is1FopmfJ7T9*L469Vw4', u'nickName': u'15252896407'}}
response.text
:
{"code":"100000","message":"成功","data":{"userId":"34000213","channelUserKey":"5||eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNTQ1MTgyNDYwMTk1LCJleHAiOjE1NDU3ODcyNjAsInVzZXJJZCI6IjM0MDAwMjEzIn0.I706vOZeIORzuv92AKIQq1IvFq4JTJe4-VGVggeT5RTDpw5O3TZDobbdjkuxamaIHgU1hpN3kiwm42WTUtITg","weixinAvatar":null,"nickName":"15252896407","unionId":null,"mobileNumber":"15252896407","userSig":"eJxFkNFOgzAUhtFW41pCyVosgsGBllGnGxZ1JsGoWxHoDSloMT47usaiTfn4v9ycr7--DiH7f6ukBIqVmjmqsp5cJBza2PLUFxVtSaKxNjSilBaKETVwP0wgCCMMXERegfQsWFhhrsousZQLD7xwY4mTB7fInSp1RHZHdI2qxv0u1GPpPThH2e8TgIm65LIB-jdmxyIt5CWLcoKXHwGb0eRfrh0c0uhPMN3itfzroeyvn9HGdfrxfT1r1XKsapitdy1w9aBmLiYaOm6LeRQHxPMX6Is1FopmfJ7T9*L469Vw4","registerTime":1545182459000,"bindingMobileNumber":true}}
response.content
:
{"code":"100000","message":"鎴愬姛","data":{"userId":"34000213","channelUserKey":"5||eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNTQ1MTgyNDYwMTk1LCJleHAiOjE1NDU3ODcyNjAsInVzZXJJZCI6IjM0MDAwMjEzIn0.I706vOZeIORzuv92AKIQq1IvFq4JTJe4-VGVggeT5RTDpw5O3TZDobbdjkuxamaIHgU1hpN3kiwm42WTUtITg","weixinAvatar":null,"nickName":"15252896407","unionId":null,"mobileNumber":"15252896407","userSig":"eJxFkNFOgzAUhtFW41pCyVosgsGBllGnGxZ1JsGoWxHoDSloMT47usaiTfn4v9ycr7--DiH7f6ukBIqVmjmqsp5cJBza2PLUFxVtSaKxNjSilBaKETVwP0wgCCMMXERegfQsWFhhrsousZQLD7xwY4mTB7fInSp1RHZHdI2qxv0u1GPpPThH2e8TgIm65LIB-jdmxyIt5CWLcoKXHwGb0eRfrh0c0uhPMN3itfzroeyvn9HGdfrxfT1r1XKsapitdy1w9aBmLiYaOm6LeRQHxPMX6Is1FopmfJ7T9*L469Vw4","registerTime":1545182459000,"bindingMobileNumber":true}}
This problem probably caused by when the number field value in the response is exceed the sys.maxint
when using python2, everything is ok after upgrade to python 3.
This workaround works with which exact versions of python and robot please?
@iamdhruvanand update to the newest python3.
This very simple GET test fails in Windows10 (Python 2.7.15) but it works with Ubuntu 16.04 (Python 2.7.12). Fails in Windows with
SchemaGenerationError: Could not find matching type for object: 1536489510350L
Test was run in virtualenv in both systems and following packages were only installed by pip:
Test uses Liikennevirasto's open api to get the vessel location --> Can be easily tested with Curl or with browser:
curl -X GET --header 'Accept: application/json' 'https://meri.digitraffic.fi/api/v1/locations/latest/230629000'
Test case:
Traceback: