Page 2 of 2

Re: Sabnzbd keeps crashing TypeError: can't concat int to bytes

Posted: June 5th, 2020, 5:59 pm
by ash7777
Thanks! It's working much better now.

I'm mystified by something. If I understand correctly, these lines:

Code: Select all

        try:
            self.servercount[serverid] += bytes
        except KeyError:
            # Not yet known, so initialize:
            self.servercount[serverid] = bytes
are functionally equivalent to these lines (which are the original code):

Code: Select all

        if serverid in self.servercount:
            self.servercount[serverid] += bytes
        else:
            self.servercount[serverid] = bytes
and these lines work around the problem I was having:

Code: Select all

        except Exception as e:
            # could not add int, so reset
            logging.warning("Non-int value in self.servercount[serverid]: %s", self.servercount[serverid])
            self.servercount[serverid] = bytes
which implies I should be seeing log entries that say "Non-int value in ..." and I'm not seeing any such lines. Does that surprise you?

Re: Sabnzbd keeps crashing TypeError: can't concat int to bytes

Posted: June 5th, 2020, 6:18 pm
by sander
"much better"? Not 100% good?

"I'm not seeing any such lines. Does that surprise you?" Yes, that does surprise me: I would expect it once.

Re: Sabnzbd keeps crashing TypeError: can't concat int to bytes

Posted: June 5th, 2020, 7:31 pm
by ash7777
Sorry, I tend to understate. It's been running for about an hour and everything seems completely normal.

It is possible the message was logged once. I cleaned the log files at shortly after applying the fix.

Re: Sabnzbd keeps crashing TypeError: can't concat int to bytes

Posted: June 5th, 2020, 7:37 pm
by sander
Good that it works.

Pity you cleaned the log files: I was very curious what Warning print would say.

Re: Sabnzbd keeps crashing TypeError: can't concat int to bytes

Posted: June 8th, 2020, 5:54 am
by sander
ash7777

safihre has changed the code in a much better way (https://github.com/sabnzbd/sabnzbd/comm ... 27c7c36a27 specifcally https://github.com/sabnzbd/sabnzbd/comm ... cL775-R777 ), hopefully removing the root cause of your problem.
That means that with the next release, which you will receive via the Ubuntu jcfp PPA (so beta3, or anything higher than beta2), the problem should not occur anymore (and my workaround is not necesary anymore).

Re: Sabnzbd keeps crashing TypeError: can't concat int to bytes

Posted: October 13th, 2020, 9:01 am
by ash7777
I haven't upgraded since this happened, and it occurred again yesterday.

The log message was:

Code: Select all

 Non-int value in self.servercount[serverid]: b'220'

Re: Sabnzbd keeps crashing TypeError: can't concat int to bytes

Posted: October 13th, 2020, 9:16 am
by sander
ash7777 wrote:
October 13th, 2020, 9:01 am
I haven't upgraded since this happened
Upgrade! There were a lot of improvements and releases since June 2020.