SABnzbd Python3 - 3.0.0-develop: Multicore Par2

Questions and bug reports for Beta releases should be posted here.
Forum rules
Help us help you:
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
thegreatnorth
Newbie
Newbie
Posts: 2
Joined: May 1st, 2019, 10:27 am

SABnzbd Python3 - 3.0.0-develop: Multicore Par2

Post by thegreatnorth »

Does anyone know if the Python3 - 3.0.0-develop can use Multicore Par2 yet?

I am using Ubuntu 19.04 and just testing git clone version of SABnzbd (python3) from command line
I have Multicore version of Par2 (par2-tbb) installed and working perfectly with SABnzbd 2.3.8
Python3 3.0.0 finds par2 binary but then on main config page it says Mulitcore Par2 "Not available"

Being a new user it will not let me insert my log...
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: SABnzbd Python3 - 3.0.0-develop

Post by sander »

Great that you're testing it.

I use Ubuntu too, so here we go:

$ par2 -V
par2cmdline version 0.8.0


after install par2-tbb:

$ par2 -V | head -4
Not enough command line arguments.
par2cmdline version 0.4, Copyright (C) 2003 Peter Brian Clements.
Modifications for concurrent processing, Unicode support, and hierarchial
directory support are Copyright (c) 2007-2015 Vincent Tan.
Concurrent processing utilises Intel Thread Building Blocks 4.3 Update 1,

OK, installed


With SAB-py2: on the main config page "Multicore Par2" has a check mark.
With SAB-py3: ... it says "Not available Speed up repairs by installing multicore Par2, it is available for many platforms." ...

Ouch.

Relevant code

Code: Select all

sabnzbd.newsunpack.PAR2_MT = par2_mt_check(sabnzbd.newsunpack.PAR2_COMMAND)


ah, an exception;

'in <string>' requires string as left operand, not bytes

Code: Select all

2019-05-01 20:17:22,752::DEBUG::[newsunpack:2221] SJ0:
'in <string>' requires string as left operand, not bytes
2019-05-01 20:17:22,752::INFO::[SABnzbd:378] SABYenc module (v4.0.0)... found!

Code: Select all

def par2_mt_check(par2_path):
    """ Detect if we have multicore par2 variants """
    try:
        par2_version = run_simple([par2_path, '-h'])
        logging.debug("SJ: %s", par2_version)
        # Look for a threads option
        logging.debug("SJ0:")
        found = b'-t<' in par2_version
        logging.debug("SJ2: %s:", found)
        found = '-t<' in par2_version
        logging.debug("SJ3: %s:", found)
        logging.debug("SJ4")
        if b'-t<' in par2_version:
            return True

    except Exception as ex:
        print(ex)
        pass
    return False
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: SABnzbd Python3 - 3.0.0-develop: Multicore Par2

Post by sander »

OK,

It's this line:

https://github.com/sabnzbd/sabnzbd/blob ... k.py#L2220

If I remove the "b", it works for me.

BUT: @shypike has introduced that "b" in the python3 version (it's not there in the python2 version), so I wonder why? Or was it introduced by an overactive automatic 2to3 mechanism?
thegreatnorth
Newbie
Newbie
Posts: 2
Joined: May 1st, 2019, 10:27 am

Re: SABnzbd Python3 - 3.0.0-develop: Multicore Par2

Post by thegreatnorth »

Ok great thanks!
I've removed the "b" and it's now giving me the big checkmark. I will continue to test and report back if anything strange occurs
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: SABnzbd Python3 - 3.0.0-develop: Multicore Par2

Post by sander »

thegreatnorth wrote: May 1st, 2019, 1:32 pm Ok great thanks!
I've removed the "b" and it's now giving me the big checkmark. I will continue to test and report back if anything strange occurs
Cool & cool. Best place for bug reports is https://github.com/sabnzbd/sabnzbd/issues , with [py3] in the subject.

Please continue testing!
User avatar
safihre
Administrator
Administrator
Posts: 5524
Joined: April 30th, 2015, 7:35 am
Contact:

Re: SABnzbd Python3 - 3.0.0-develop: Multicore Par2

Post by safihre »

Thanks for testing! Good find and indeed a bug :)
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: SABnzbd Python3 - 3.0.0-develop: Multicore Par2

Post by sander »

User avatar
safihre
Administrator
Administrator
Posts: 5524
Joined: April 30th, 2015, 7:35 am
Contact:

Re: SABnzbd Python3 - 3.0.0-develop: Multicore Par2

Post by safihre »

Merged, should now work again if you do a `git pull`.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply