Page 1 of 1

UnicodeDecodeError: 'ascii' codec

Posted: November 24th, 2011, 4:04 pm
by leclercb
Hi,

Since 0.6.10, I face this problem, previous versions were working well.

Version: 0.6.10
OS: OSX Lion 10.7.2
Install-type: OSX .app
Skin: Plush
IPV6: No
Is the issue reproducible? Yes, it happens on all my downloads, the post-processing always fails. I see the files in Complete folder (so the download is ok), but the NZB is not deleted and the files in Incomplete are not deleted too.
SabNzb keeps trying the reprocess the post-processing, so I quit SabNzb, then I delete the NZB and the files in Incomplete, and it's ok, but still annoying :)

Stacktrace:

2011-11-24 21:54:08,936::INFO::[notifier:86] Sending notification [4. On download terminated] to localhost:23053
2011-11-24 21:54:08,936::ERROR::[postproc:443] Echec du post-traitement pour 2101acs290 ()
2011-11-24 21:54:08,937::INFO::[postproc:445] Traceback:
Traceback (most recent call last):
File "sabnzbd/postproc.pyc", line 436, in process_job
File "sabnzbd/utils/osx.pyc", line 124, in sendGrowlMsg
File "gntp/notifier.pyc", line 102, in notify
File "gntp/notifier.pyc", line 128, in send
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 302: ordinal not in range(128)
2011-11-24 21:54:08,937::INFO::[notifier:86] Sending notification [4. On download terminated] to localhost:23053
2011-11-24 21:54:29,718::INFO::[__init__:949] Restarting because of crashed postprocessor

Re: UnicodeDecodeError: 'ascii' codec

Posted: November 24th, 2011, 4:15 pm
by sander
Looks like the error message on http://docs.python.org/howto/unicode.ht ... icode-type which happens when non-USACII stuff is put into unicode()

So, as you download French stuff, and it error is in gntp, is there a non-USASCII charachter in your name, or directory, or system name, or ... ?

PS 1: yes, I would say the error message is a bug
PS 2: I don't know if the error message is the cause of the download/nzb problem

Re: UnicodeDecodeError: 'ascii' codec

Posted: November 24th, 2011, 4:30 pm
by sander
PS 3:

I had a look at the source code: line 128 of gntp/notifier.py is:

"s.send(data.encode('utf-8', 'replace'))"

in the code below.

So my advice: set logging level to 'debug' (via http://localhost:8080/connections/ and then Latest Warning and then Logging"). Then the names used should be in your log file.

Code: Select all

        def send(self,type,data):
                '''
                Send the GNTP Packet
                '''
                #logger.debug('To : %s:%s <%s>\n%s',self.hostname,self.port,type,data)
                #Less verbose please
                logger.debug('To : %s:%s <%s>',self.hostname,self.port,type)

                s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                s.settimeout(1)
                s.connect((self.hostname,self.port))
                s.send(data.encode('utf-8', 'replace'))
                response = gntp.parse_gntp(s.recv(1024))
                s.close()

                #logger.debug('From : %s:%s <%s>\n%s',self.hostname,self.port,response.__class__,response)
                #Less verbose please
                logger.debug('From : %s:%s <%s>',self.hostname,self.port,response.__class__)
                return response

Re: UnicodeDecodeError: 'ascii' codec

Posted: November 24th, 2011, 4:54 pm
by shypike
Already solved in release 0.6.11RC1.
See Announcements.

Re: UnicodeDecodeError: 'ascii' codec

Posted: November 25th, 2011, 4:38 am
by leclercb
Well, if it's already solved... :)
Thank you both for your help.