Closed TorokLev closed 5 years ago
Could you add more info, like Version, OS version, command line, and logging output (with -vv
)?
OS: ubuntu 16.04
lev@yellow:~/00$ uname -a
Linux yellow 4.4.0-121-generic #145-Ubuntu SMP Fri Apr 13 13:47:23 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
lev@yellow:~/00$ pyftpsync -V
/usr/local/lib/python2.7/dist-packages/keyring/backends/Gnome.py:6: PyGIWarning: GnomeKeyring was imported without specifying a version first. Use gi.require_version('GnomeKeyring', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GnomeKeyring
2.0.0
Server side: Android WiFi FTP Server
And this is the sequence:
1)
lev@yellow:~/tmp2$ pyftpsync upload --delete /home/lev/tmp2 ftp://android:xxxxx@192.168.43.230:2222:/tmp2
/usr/local/lib/python2.7/dist-packages/keyring/backends/Gnome.py:6: PyGIWarning: GnomeKeyring was imported without specifying a version first. Use gi.require_version('GnomeKeyring', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GnomeKeyring
Upload /home/lev/tmp2
to ftp://192.168.43.230/tmp2
Traceback (most recent call last):
File "/usr/local/bin/pyftpsync", line 11, in
2)
lev@yellow:~/tmp2$ pyftpsync upload --delete /home/lev/tmp2 ftp://android:xxxxx@192.168.43.230:2221:/tmp2
/usr/local/lib/python2.7/dist-packages/keyring/backends/Gnome.py:6: PyGIWarning: GnomeKeyring was imported without specifying a version first. Use gi.requireversion('GnomeKeyring', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GnomeKeyring
Upload /home/lev/tmp2
to ftp://192.168.43.230/tmp2
COPY EXISTING > 01 - Születés.mp3
SKIP DOWNLOAD < 01 - Születés.mp3
Wrote 1/1 files in 0 directories, skipped: 0. Elap: 23.99 sec.
lev@yellow:~/tmp2$ pyftpsync upload --delete /home/lev/tmp2 ftp://android:xxxxx@192.168.43.230:2221:/tmp2
/usr/local/lib/python2.7/dist-packages/keyring/backends/Gnome.py:6: PyGIWarning: GnomeKeyring was imported without specifying a version first. Use gi.requireversion('GnomeKeyring', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GnomeKeyring
Upload /home/lev/tmp2
to ftp://192.168.43.230/tmp2
CONFLICT: '01 - Sz\xc3\xbclet\xc3\xa9s.mp3' was modified on both targets since last sync (n.a.).
(No meta data available.)
Local: 2018-06-16 08:42:11, 13,675,540 bytes
Remote: 2018-06-16 12:34:32, 13,675,540 bytes (newer)
Use Local, Skip, Binary compare, Help ? l
COPY CONFLICT > 01 - Születés.mp3
DELETE MISSING >X 01 - Születés.mp3
Wrote 1/1 files in 0 directories, skipped: 0.
3)
lev@yellow:~/tmp2$ pyftpsync upload --delete /home/lev/tmp2 ftp://android:xxxxx@192.168.43.230:2221:/tmp2
/usr/local/lib/python2.7/dist-packages/keyring/backends/Gnome.py:6: PyGIWarning: GnomeKeyring was imported without specifying a version first. Use gi.require_version('GnomeKeyring', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GnomeKeyring
Upload /home/lev/tmp2
to ftp://192.168.43.230/tmp2
CONFLICT: '01 - Sz\xc3\xbclet\xc3\xa9s.mp3' was modified on both targets since last sync (n.a.).
(No meta data available.)
Local: 2018-06-16 08:42:11, 13,675,540 bytes
Remote: 2018-06-16 12:35:24, 13,675,540 bytes (newer)
Use Local, Skip, Binary compare, Help ? l
COPY CONFLICT > 01 - Születés.mp3
Traceback (most recent call last):es...
File "/usr/local/bin/pyftpsync", line 11, in
Lev
Thanks for reporting, I wasfinally able to reproduce this (or similar) here. I assume this is caused by the encoding used on the FTP server to store the file names. Which clients do you use to upload files to that server, only pyftpsync, or others as well (FileZilla, ...)?
Hi Mark, On another directory I simply copied files to the SD card directly. Then I ran pyftpsync to do sync on the same directory which became suspicious for me. So I made a test on a fresh directory, with a single file with the output that I presented to you. So I don't use FileZilla.
Is there anything that I can do to solve this? Or do you suggest any specific ftp server for android to use pyftpsync with instead?
Thanks a lot, Lev
On Sat, Jun 23, 2018 at 9:22 AM Martin Wendt notifications@github.com wrote:
Thanks for reporting, I wasfinally able to reproduce this (or similar) here. I assume this is caused by the encoding used on the FTP server to store the file names. Which clients do you use to upload files to that server, only pyftpsync, or others as well (FileZilla, ...)?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mar10/pyftpsync/issues/30#issuecomment-399645613, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUAQlmbHvaW2GjhyyGK3RGBbyx6xTF5ks5t_ezAgaJpZM4UqaDB .
I think this is a general problem, that may be tricky to solve generally: How should pyftpsync handle the case that local and remote target use different encodings for file names? In order to support all use cases, I guess only UTF-8 would make sense, but re-encoding may lead to different file names on both sides.
I probably need to think about this a bit more, when I find time.
On another directory I simply copied files to the SD card directly.
pyftpsync upload
to initialize the files, instead of copying with File Explorer? And then use pyftpsync sync
after that?On Sun, Jun 24, 2018 at 6:38 PM Martin Wendt notifications@github.com wrote:
I think this is a general problem, that may be tricky to solve generally: How should pyftpsync handle the case that local and remote target use different encodings for file names? In order to support all use cases, I guess only UTF-8 would make sense, but re-encoding may lead to different file names on both sides.
I probably need to think about this a bit more, when I find time.
On another directory I simply copied files to the SD card directly.
- Did you use Windows File Explorer? Which filesystem was the SD card formatted with (FAT32, ...)?
It is fat32, created on linux I probably used midnight commander or Nautilus. Midnight commander was coughing on similar issues. I can retest it.
- Would it work if the SD card is empty and you use pyftpsync upload to initialize the files, instead of copying? And then use pyftpsync sync after that?
I made pyftpsync to sync the file 3x in an empty directory on the SD card. The output was the one I sent you.
- Does it make a difference if you run pyftpsync on Python 3?
Will test it.
Lev
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mar10/pyftpsync/issues/30#issuecomment-399769478, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUAQvNlSJuf3jqaydgXi9MtWB6M2YJCks5t_8CUgaJpZM4UqaDB .
Was able to reproduce it with Python 2, but not with Python 3 so far.
Hi Mark, Maybe I used python 2. Cannot remember. Will test it again. But it points to the utf-8 problems you mentioned before. Thanks Lev
On Sat, 2 Feb 2019, 17:05 Martin Wendt <notifications@github.com wrote:
Was able to reproduce it with Python 2, but not with Python 3 so far.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mar10/pyftpsync/issues/30#issuecomment-459976571, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUAQiSLBo2LZ9xiR0tfq1TygfalLP6zks5vJbc6gaJpZM4UqaDB .
I released v3.0, that should address the problem. Please open a new issue, if it still does not work for you.
Hi, It looks like that there is a utf-8 encoding problem in writing/reading to json file as:
the corresponding json looks like:
Thanks,