{"action":"created","issue":{"url":"https://api.github.com/repos/xiaocong/uiautomator/issues/145","labels_url":"https://api.github.com/repos/xiaocong/uiautomator/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/xiaocong/uiautomator/issues/145/comments","events_url":"https://api.github.com/repos/xiaocong/uiautomator/issues/145/events","html_url":"https://github.com/xiaocong/uiautomator/issues/145","id":117582705,"number":145,"title":"Drag operation may never return.","user":{"login":"yunfanzhang","id":5918910,"avatar_url":"https://avatars.githubusercontent.com/u/5918910?v=3","gravatar_id":"","url":"https://api.github.com/users/yunfanzhang","html_url":"https://github.com/yunfanzhang","followers_url":"https://api.github.com/users/yunfanzhang/followers","following_url":"https://api.github.com/users/yunfanzhang/following{/other_user}","gists_url":"https://api.github.com/users/yunfanzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/yunfanzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yunfanzhang/subscriptions","organizations_url":"https://api.github.com/users/yunfanzhang/orgs","repos_url":"https://api.github.com/users/yunfanzhang/repos","events_url":"https://api.github.com/users/yunfanzhang/events{/privacy}","received_events_url":"https://api.github.com/users/yunfanzhang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-18T13:06:29Z","updated_at":"2015-11-20T06:57:59Z","closed_at":null,"body":"I use dev.drag(XXXXX) when my android emulator start, But sometimes, It may be never return. \r\nWhen I use control + c kill the process\r\nThe stack is \r\nTraceback (most recent call last):\r\n  File \"weixin_hack_emulator_client.py\", line 493, in <module>\r\n\r\n  File \"weixin_hack_emulator_client.py\", line 487, in main\r\n    if not dev:\r\n  File \"weixin_hack_emulator_client.py\", line 386, in login2weixin\r\n    def login2weixin(self):\r\n  File \"weixin_hack_emulator_client.py\", line 415, in init_emulator\r\n\r\n  File \"weixin_hack_emulator_client.py\", line 367, in start_emulator\r\n    self.unlock_screen()\r\n  File \"weixin_hack_emulator_client.py\", line 375, in unlock_screen\r\n    if not self.weixin_device.dev.click(1, 1):\r\n  File \"/usr/local/lib/python2.7/dist-packages/uiautomator/__init__.py\", line 598, in drag\r\n    return self.server.jsonrpc.drag(sx, sy, ex, ey, steps)\r\n  File \"/usr/local/lib/python2.7/dist-packages/uiautomator/__init__.py\", line 424, in wrapper\r\n    server.start(timeout=30)\r\n  File \"/usr/local/lib/python2.7/dist-packages/uiautomator/__init__.py\", line 469, in start\r\n    self.install()\r\n  File \"/usr/local/lib/python2.7/dist-packages/uiautomator/__init__.py\", line 404, in install\r\n    self.adb.cmd(\"install\", \"-rt\", os.path.join(base_dir, apk)).wait()\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 1291, in wait\r\n    pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 478, in _eintr_retry_call\r\n    return func(*args)\r\nKeyboardInterrupt"},"comment":{"url":"https://api.github.com/repos/xiaocong/uiautomator/issues/comments/158299267","html_url":"https://github.com/xiaocong/uiautomator/issues/145#issuecomment-158299267","issue_url":"https://api.github.com/repos/xiaocong/uiautomator/issues/145","id":158299267,"user":{"login":"masterwrw","id":15925432,"avatar_url":"https://avatars.githubusercontent.com/u/15925432?v=3","gravatar_id":"","url":"https://api.github.com/users/masterwrw","html_url":"https://github.com/masterwrw","followers_url":"https://api.github.com/users/masterwrw/followers","following_url":"https://api.github.com/users/masterwrw/following{/other_user}","gists_url":"https://api.github.com/users/masterwrw/gists{/gist_id}","starred_url":"https://api.github.com/users/masterwrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masterwrw/subscriptions","organizations_url":"https://api.github.com/users/masterwrw/orgs","repos_url":"https://api.github.com/users/masterwrw/repos","events_url":"https://api.github.com/users/masterwrw/events{/privacy}","received_events_url":"https://api.github.com/users/masterwrw/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T06:57:59Z","updated_at":"2015-11-20T06:57:59Z","body":"No log output when the usb line disconnected, just block.\r\nand another issues is: (ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。) when i start program of first time, second time no this error.\r\ncode:\r\nimport sys\r\nimport os\r\nimport time\r\nimport json\r\nimport codecs\r\nimport socket\r\nimport threading\r\nimport logging\r\nimport random\r\nimport subprocess\r\nfrom uiautomator import Device\r\n\r\nd = Device(\"3329eaf\")\r\n\r\ndef test():\r\n    print(\"test...\")\r\n    i = 0\r\n    while i < 100:\r\n        i += 1\r\n        time.sleep(1)\r\n        print(\"click...\", i)\r\n        d.click(200, 200)\r\n\r\ndef main():\r\n    dev_info = d.info\r\n    print(dev_info)\r\n    width = dev_info['displayWidth']\r\n    height = dev_info['displayHeight']\r\n\r\n    test()\r\n    sys.exit()\r\n\r\ngot error:\r\nD:\\Python34\\python.exe E:/project/pyqt/TaskProcess/test.py\r\n{'displayWidth': 480, 'displayRotation': 0, 'displayHeight': 854, 'screenOn': True, 'currentPackageName': 'com.android.launcher', 'naturalOrientation': True, 'productName': 'P810N30', 'displaySizeDpY': 569, 'displaySizeDpX': 320, 'sdkInt': 18}\r\ntest...\r\nclick... 1\r\nTraceback (most recent call last):\r\n  File \"D:\\Python34\\lib\\site-packages\\urllib3\\connectionpool.py\", line 376, in _make_request\r\n    httplib_response = conn.getresponse(buffering=True)\r\nTypeError: getresponse() got an unexpected keyword argument 'buffering'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"D:\\Python34\\lib\\site-packages\\urllib3\\connectionpool.py\", line 559, in urlopen\r\n    body=body, headers=headers)\r\n  File \"D:\\Python34\\lib\\site-packages\\urllib3\\connectionpool.py\", line 378, in _make_request\r\n    httplib_response = conn.getresponse()\r\n  File \"D:\\Python34\\lib\\http\\client.py\", line 1172, in getresponse\r\n    response.begin()\r\n  File \"D:\\Python34\\lib\\http\\client.py\", line 351, in begin\r\n    version, status, reason = self._read_status()\r\n  File \"D:\\Python34\\lib\\http\\client.py\", line 313, in _read_status\r\n    line = str(self.fp.readline(_MAXLINE + 1), \"iso-8859-1\")\r\n  File \"D:\\Python34\\lib\\socket.py\", line 371, in readinto\r\n    return self._sock.recv_into(b)\r\nConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。\r\n"}}