Skip to content
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

Fix issue when file names contain invalid characters #45

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

zorone
Copy link

@zorone zorone commented Jul 24, 2024

This problem mostly occur when pulling file from Android to Windows.

I have to implement it in various spots.

  1. check if source and destination from user argument is valid.
  2. change module from os.path to posixpath referring from here, to prevent converting file name from '\\' to '/' on Android side.
  3. convert file name in Local side to a valid one.

I also add --no-del option, which will prevent from removing files. I find it useful if I want to transferring to just one side. I implement it in various locations too.

  1. change action variable to argparse.BooleanOptionalAction. Reference here.
  2. Make sure that files won't get overridden if --no-del is set.
  3. Set condition to not perform delete operation.

Lastly, I also tweak logging_fatal() a bit since it prevents program from running further when there are any fatal error occurs. In my opinion, it feels really bad when program stops while it could still proceed. Like when there are some bad file names. It will halt the works although you could just skip those bad ones.

I have put TODO and FIXME all over the places, you could remove it if you want.

@zorone zorone marked this pull request as ready for review July 24, 2024 18:59
@zorone
Copy link
Author

zorone commented Jul 25, 2024

@jb2170 Could you review my code, please? It's my first time I commit full work to an open source project. I'm scared I would mess up something.

zorone added 2 commits July 28, 2024 17:43
Prevent bug when user use BetterADBSync on POSIX system, on pull direction, and destination argument also contains colon at the 2nd character.
A.K.A. adbsync pull /sdcard/Documents/0:2024-07-30.log 0:2024-07-30.log
@jb2170
Copy link
Owner

jb2170 commented Jul 31, 2024

I'll have a look at this soon thanks! I'm a bit busy right now, but this project isn't orphaned.

(>19th August)

@zorone
Copy link
Author

zorone commented Aug 1, 2024

Sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants