tabouassaleh / iqbox-ftp

Automatically exported from code.google.com/p/iqbox-ftp
0 stars 0 forks source link

Exception when sync a music folder with many songs #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I copied a folder named "The Official UK Top 40 Singles Chart 04-11-2012" 
with 40 songs from other place on my computer(please check the song name in the 
attached file) to current syncing folder

What is the expected output? What do you see instead?
-Expected output: Syncing progress without any error
-What I see: 
  IQ Box title changed to: "IQ Box (Not responding)"
- From WingIDE debuger:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 
107: ordinal not in range(128)
File "C:\Python27\Lib\threading.py", line 527, in __bootstrap
  self.__bootstrap_inner()
File "C:\Python27\Lib\threading.py", line 554, in __bootstrap_inner
  self.run()
File "C:\Python27\Lib\site-packages\watchdog\observers\api.py", line 249, in run
  self.dispatch_events(self.event_queue, self.timeout)
File "C:\Python27\Lib\site-packages\watchdog\observers\api.py", line 419, in 
dispatch_events
  self._dispatch_event(event, watch)
File "C:\Python27\Lib\site-packages\watchdog\observers\api.py", line 414, in 
_dispatch_event
  handler.dispatch(event)
File "C:\Python27\Lib\site-packages\watchdog\events.py", line 350, in dispatch
  _method_map[event_type](event)
File "d:\python\iqbox-latest\file_monitor.py", line 203, in on_created
  print "W>> DETECTED FILE CREATION: "+thePath
File "d:\python\iqbox-latest\iqbox_core.py", line 339, in write
  data = '{0} {1}'.format(dt.utcnow().strftime('%Y-%m-%d %H:%M:%S'), data) 

Please use labels and text to provide additional information.

Original issue reported on code.google.com by thuann89 on 1 Oct 2013 at 6:01

Attachments:

GoogleCodeExporter commented 9 years ago
Nice work documenting this issue. It's easy to solve because of the proper 
documentation!

Character u'\xe1'="á". The problem is the "á" in "Fun Feat Janelle Monáe - 
We Are Young.mp3"

That is because "á" is a unicode character and when we write logs or send FTP 
commands, IQBox tries to convert the string to ASCII and the conversion fails.
However, we are releasing support for UTF8 (an encoding for unicode) soon and 
this should solve the issue.

Worth noting: Not all FTP servers support unicode! Some would no allow the "á" 
character in any file name at all! So it's hard to know what to do in that 
case. But, most Windows FTP servers do allow unicode, including the free 
FileZilla server.

Another file with a special character is possibly the "Emeli Sandé - Read All 
About It, Pt. III.mp3"

I am working on unicode support and will release it within a week or two.

Original comment by simonis2...@gmail.com on 3 Oct 2013 at 6:23

GoogleCodeExporter commented 9 years ago
Unicode support added for servers that support it. Will be release in the next 
build. If the servers do not support UTF8 encoding for unicode, then these 
files will now be ignored.
In the future, we will add an ACE encoding as a workaround for these issues on 
non-UTF8 FTP servers, but that will require more voodoo.
Most modern FTP servers support unicode, but various Linux ones do not.

Original comment by simonis2...@gmail.com on 11 Oct 2013 at 6:41