Comments (6)
modify
b'(', b'(; #`ls`$PATH\'"(\\\\\\\\){};!\xc0\xaf\xff\xc2\xbf'
to
b'(', '(; #`ls`$PATH\'"(\\\\\\\\){};!\xc0\xaf\xff\xc2\xbf'
can fix the problem : )
from adb-sync.
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```
from adb-sync.
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
from adb-sync.
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
main()
File "C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools\adb-sync", line 870, in main
if not syncer.IsWorking():
File "C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools\adb-sync", line 507, in IsWorking
return self.adb.IsWorking()
File "C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools\adb-sync", line 221, in IsWorking
b'date +%s' % (self.QuoteArgument(test_string),)]) as stdout:
File "C:\Users\sriva\Downloads\platform-tools_r31.0.0-windows\platform-tools\adb-sync", line 201, in QuoteArgument
arg = arg.replace(b'\', b'\\')
TypeError: replace() argument 1 must be str, not bytes
from adb-sync.
Can anyone help to resolve the issue.
Traceback (most recent call last):
File "C:\Baymax_v0.3\install.py", line 112, in
if res.decode().count("Android Debug Bridge version") > 0:
^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 92: invalid start byte
from adb-sync.
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
from adb-sync.
Related Issues (20)
- error running it. stacktrace. HOT 1
- Colon not supported in folder name HOT 8
- Hard-coded location of python3 HOT 2
- TypeError with latest rev HOT 1
- Problems with parameters: a bytes-like object is required, not 'str' HOT 3
- adb-sync seems to close standard input? HOT 3
- anyway to --reverse and --delete?
- Is this project still active? HOT 2
- windows 10 HOT 8
- adb-sync doesn't work correctly with symlinks
- Crashes when trying to copy files with question marks in the name.
- Copying from external storage HOT 4
- adb-sync doesn't copy files properly if names are same on local and remote HOT 5
- When the file length is the same, it will be considered as no difference HOT 1
- two way sync breaks when filename contains spaces
- Scanning and diffing takes a long time for large directories HOT 2
- "bad date" from "touch" when using -t option HOT 1
- Ignore unreadable files
- Use my fork HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adb-sync.