-
Notifications
You must be signed in to change notification settings - Fork 171
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
Problems with parameters: a bytes-like object is required, not 'str' #37
Comments
Hi. Test it. |
I followed the instructions above, and eventually got it working. However, the instructions are a little unclear, so I thought I'd help clarify. For the first step, the line above which you insert the new line is indeed line 529 at the time of this writing (v3.7.4). To prevent a misalignment from an update however, this is the actual content of line 529 above which to insert: For the second step, the new code was not formatted properly as a code block, meaning when I copy and paste it in it's invalid. Instead of trying to figure out how Github mangled the string, I just added a "return true" line at the start of that "IsWorking()" function. |
I think it is a bad idea to directly edit the files in the python standard library. It might break other python scripts/programmes using that function. Also, you will need to edit it every time when python is updated. In fact, python allows you to replace functions on the fly (also called monkey-patching). So you can change the behaviour of the relevant function in the subprocess module within Just add the code after all the
And change the
|
Hello,
when starting adb-sync I always get the following error message. I'm using Windows 10, Python 3.7.2 and the latest version of the script.
C:\Users\Marco>adb-sync --reverse /sdcard/DCIM/Camera ~/Downloads INFO:root:Sync: local b'~/Downloads/Camera', remote b'/sdcard/DCIM/Camera' Traceback (most recent call last): File "C:\Users\Marco\Desktop\adb-sync-master\adb-sync.py", line 883, in <module> main() File "C:\Users\Marco\Desktop\adb-sync-master\adb-sync.py", line 870, in main if not syncer.IsWorking(): File "C:\Users\Marco\Desktop\adb-sync-master\adb-sync.py", line 507, in IsWorking return self.adb.IsWorking() File "C:\Users\Marco\Desktop\adb-sync-master\adb-sync.py", line 221, in IsWorking b'date +%s' % (self.QuoteArgument(test_string),)]) as stdout: File "C:\Users\Marco\Desktop\adb-sync-master\adb-sync.py", line 76, in __init__ self.popen = subprocess.Popen(args, stdout=subprocess.PIPE) File "C:\Users\Marco\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "C:\Users\Marco\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1119, in _execute_child args = list2cmdline(args) File "C:\Users\Marco\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 530, in list2cmdline needquote = (" " in arg) or ("\t" in arg) or not arg TypeError: a bytes-like object is required, not 'str'
I saw under Issue #10 that chaning the script could solve this problem but I'm not familiar with Python at all. I also tried different Python versions but no success. Are there any other solutions or will this problem be fixed in the future? I love this tool and I would be happy to use it again.
Thanks in advance!
The text was updated successfully, but these errors were encountered: