Open krantic opened 4 years ago
I also have this issue
D:\Sources\adb-sync>C:\Users\redacted\AppData\Local\Programs\Python\Python38\python.exe adb-sync -R /storage/emulated/0/Music C:\Users\redacted\Desktop\Backup\Music
INFO:root:Sync: local b'C:\\Users\\redacted\\Desktop\\Backup\\Music/Music', remote b'/storage/emulated/0/Music'
Traceback (most recent call last):
File "adb-sync", line 883, in <module>
main()
File "adb-sync", line 870, in main
if not syncer.IsWorking():
File "adb-sync", line 507, in IsWorking
return self.adb.IsWorking()
File "adb-sync", line 219, in IsWorking
with Stdout(self.adb +
File "adb-sync", line 76, in __init__
self.popen = subprocess.Popen(args, stdout=subprocess.PIPE)
File "C:\Users\redacted\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\redacted\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1247, in _execute_child
args = list2cmdline(args)
File "C:\Users\redacted\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 549, in list2cmdline
for arg in map(os.fsdecode, seq):
File "C:\Users\redacted\AppData\Local\Programs\Python\Python38\lib\os.py", line 818, in fsdecode
return filename.decode(encoding, errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 41: invalid start byte```
Same problem no Windows
C:\Users\Pavel\Phone>python adb-sync\adb-sync --reverse /sdcard/DCIM .
INFO:root:Sync: local b'./DCIM', remote b'/sdcard/DCIM'
Traceback (most recent call last):
File "adb-sync\adb-sync", line 883, in <module>
main()
File "adb-sync\adb-sync", line 870, in main
if not syncer.IsWorking():
File "adb-sync\adb-sync", line 507, in IsWorking
return self.adb.IsWorking()
File "adb-sync\adb-sync", line 219, in IsWorking
with Stdout(self.adb +
File "adb-sync\adb-sync", line 76, in __init__
self.popen = subprocess.Popen(args, stdout=subprocess.PIPE)
File "C:\Users\Pavel\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Pavel\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1247, in _execute_child
args = list2cmdline(args)
File "C:\Users\Pavel\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 549, in list2cmdline
for arg in map(os.fsdecode, seq):
File "C:\Users\Pavel\AppData\Local\Programs\Python\Python38\lib\os.py", line 818, in fsdecode
return filename.decode(encoding, errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 41: invalid start byte
Sync seems working after I disable checks in IsWorking function e.g. made it just return True
, but I think it should be a better way to fix it
modify
b'(', b'(; #`ls`$PATH\'"(\\\\\\\\){};!\xc0\xaf\xff\xc2\xbf'
to
b'(', '(; #`ls`$PATH\'"(\\\\\\\\){};!\xc0\xaf\xff\xc2\xbf'
can fix the problem : )
modify
b'(', b'(; #`ls`$PATH\'"(\\\\\\\\){};!\xc0\xaf\xff\xc2\xbf'
to
b'(', '(; #`ls`$PATH\'"(\\\\\\\\){};!\xc0\xaf\xff\xc2\xbf'
can fix the problem : )
Now returns with error:
C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools>python adb-sync -R /sdcard/Movies/ "C:\Users\sriva\Desktop\"
INFO:root:Sync: local b'C:\Users\sriva\Desktop"', remote b'/sdcard/Movies/'
Traceback (most recent call last):
File "C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools\adb-sync", line 883, in
Can anyone help to resolve the issue.
Traceback (most recent call last):
File "C:\Baymax_v0.3\install.py", line 112, in
test_strings = [
b'(', b'(; #`ls`$PATH\'"(\\\\\\\\){};!'
]
Remove \xc0\xaf\xff\xc2\xbf and it will work. I actually don't think the IsWorking function here is very necessary. This paragraph is presumably to test whether some special characters that may be present in the file name can interact properly.
I guess this is probably due to the different decode mechanism of python3 and python2.
Reference: https://stackoverflow.com/questions/23772144/python-unicodedecodeerror-utf8-codec-cant-decode-byte-0xc0-in-position-0-i https://security.stackexchange.com/questions/48879/why-does-directory-traversal-attack-c0af-work
Hello, when starting adb-sync I always get the following error message. I'm using Windows 10 1909, Python 3.8.1 and the latest version of the script.
As a workarround I tried different encodings for the script but without success:
Are there any other solutions ? Thanks in advance!