{"action":"opened","issue":{"url":"https://api.github.com/repos/appium/python-client/issues/268","repository_url":"https://api.github.com/repos/appium/python-client","labels_url":"https://api.github.com/repos/appium/python-client/issues/268/labels{/name}","comments_url":"https://api.github.com/repos/appium/python-client/issues/268/comments","events_url":"https://api.github.com/repos/appium/python-client/issues/268/events","html_url":"https://github.com/appium/python-client/issues/268","id":376304028,"node_id":"MDU6SXNzdWUzNzYzMDQwMjg=","number":268,"title":"push a zip file to my Android device in Appium","user":{"login":"Ucoon","id":18288622,"node_id":"MDQ6VXNlcjE4Mjg4NjIy","avatar_url":"https://avatars3.githubusercontent.com/u/18288622?v=4","gravatar_id":"","url":"https://api.github.com/users/Ucoon","html_url":"https://github.com/Ucoon","followers_url":"https://api.github.com/users/Ucoon/followers","following_url":"https://api.github.com/users/Ucoon/following{/other_user}","gists_url":"https://api.github.com/users/Ucoon/gists{/gist_id}","starred_url":"https://api.github.com/users/Ucoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ucoon/subscriptions","organizations_url":"https://api.github.com/users/Ucoon/orgs","repos_url":"https://api.github.com/users/Ucoon/repos","events_url":"https://api.github.com/users/Ucoon/events{/privacy}","received_events_url":"https://api.github.com/users/Ucoon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-01T08:48:31Z","updated_at":"2018-11-01T08:48:31Z","closed_at":null,"author_association":"NONE","body":"## The problem\r\n\r\nis there any way that pushing a zip file to my Android device? When using push_file() I found that it can push file such as text, but except zip file. I use python to write my scripts.\r\n## Environment\r\n\r\n* Appium version (or git revision) that exhibits the issue: 1.9.0\r\n* Desktop OS/version used to run Appium: Ubuntu 18.04\r\n* Node.js version (unless using Appium.app|exe): v8.12.0\r\n* Mobile platform/version under test: Android 5.0\r\n\r\n## This is my code:\r\n```\r\ntry:\r\ndriver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)\r\nexcept Exception as e:\r\nprint((\"WebDriverException Error : \", e))\r\n\r\nwith open('E:\\\\myupdate_318.zip', 'rb') as zip_file:\r\n    data = zip_file.read()\r\ndriver.push_file('/storage/sdcard1/myupdate.zip', data.encode('base64'))\r\nzip_file.close()  \r\n```\r\n## This is server log:\r\nTraceback (most recent call last): File \"/home/user/Project/Appium/AutoInstallSoftWare/AutoInstallSoftWare.py\", line 30, in test_unintall_old_package self.driver.push_file('/storage/sdcard1/myupdate.zip', data.encode('base64')) AttributeError: 'bytes' object has no attribute 'encode'\r\nWhat should I do?"}}
{"actor":{"display_login":"Ucoon"}}