You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
device.Pull return {TypeError}coercing to Unicode: need string or buffer, file found #113
Sorry, I`ve changed code in /usr/local/lib/python2.7/dist-packages/adb/adb_commands.py 294 line then add a 'b', and regenrate the adb_commands.pyc file, but return same error after run code.
Activity
fahhem commentedon Jun 20, 2018
Is this on Windows?
evoup commentedon Jun 20, 2018
linuxmint
fahhem commentedon Jun 20, 2018
Try master as of now? Okay, then 'b' also affects the expected type in
write()instead of just the way the file is opened on Windowsevoup commentedon Jun 20, 2018
Sorry, I`ve changed code in /usr/local/lib/python2.7/dist-packages/adb/adb_commands.py 294 line then add a 'b', and regenrate the adb_commands.pyc file, but return same error after run code.
fahhem commentedon Jun 20, 2018
Hmm, what type is dest_file when you pass it into Pull? Is it the filename (a string) or an open file?
evoup commentedon Jun 20, 2018
Sorry, it is my fault. May be lost object bug in my code, can pull picture now. And it does not matter with 'b'.Thanks for your help!
fahhem commentedon Jun 20, 2018
Does it work with 'b' though? I think it's necessary for Windows, so if it works in Linux then I'll leave that change
evoup commentedon Jun 20, 2018
Yes, both add 'b' or without 'b' , can work in my linux
evoup commentedon Jun 20, 2018
HI:
I think I still find the problem after some debuging test, I assign dest_file param with '/tmp/1.png'.
The reason is calling
which dest_file is type:
so if we call os.path.exists(dest_file) , the param dest_file type should be string or buffer, it is file so get the exception
Handle open files/filenames correctly in Pull
fahhem commentedon Jun 20, 2018
How about with that commit? 82bfd52
evoup commentedon Jun 21, 2018
Tested ok, even if remove