Sabnzbd: Python 3 conversion status

Created on 25 Dec 2018  路  11Comments  路  Source: sabnzbd/sabnzbd

It seems I will need to process every single file function by function.. So just here to keep track.

  • [x] cherrypy - Replace by requirements.txt
  • [x] gntp - Replace by requirements.txt
  • [ ] interfaces

    • [x] Removed smpl, references in other files still remain.

  • [ ] licenses (needs to be updated after all this is done)
  • [ ] sabnzbd

    • [ ] utils

    • [x] __init__.py (deleted for now)

    • [x] certgen.py

    • [ ] checkdir.py

    • [x] diskspeed.py

    • [x] getperformance.py

    • [ ] happyeyeballs.py

    • [x] kronos.py

    • [x] pathbrowser.py

    • [x] pybonjour.py

    • [x] pystone.py

    • [x] rarfile.py

    • [x] rsslib.py - Removed RSS-output capabilities in 2.3.x

    • [x] servertests.py

    • [x] systrayiconthread.py

    • [x] upload.py

    • [ ] __init__.py

    • [ ] api.py

    • [x] articlecache.py

    • [ ] assembler.py

    • [x] bpsmeter.py

    • [x] cfg.py

    • [x] config.py

    • [ ] constants.py

    • [ ] database.py

    • [ ] decoder.py

    • [ ] decorators.py

    • [ ] directunpacker.py

    • [ ] dirscanner.py

    • [ ] downloader.py

    • [ ] emailer.py

    • [ ] encoding.py

    • [ ] filesystem.py - New

    • [ ] getipaddress.py

    • [ ] interface.py

    • [x] lang.py

    • [ ] misc.py

    • [ ] newsunpack.py

    • [ ] newswrapper.py

    • [ ] notifier.py

    • [x] nzbparser.py - New

    • [ ] nzbqueue.py

    • [ ] nzbstuff.py

    • [ ] osxmenu.py

    • [ ] panic.py

    • [x] par2file.py

    • [ ] postproc.py

    • [ ] powersup.py

    • [ ] rating.py

    • [ ] rss.py

    • [ ] sabtraylinux.py

    • [x] sabtray.py

    • [x] scheduler.py

    • [x] skintext.py

    • [ ] sorting.py

    • [x] urlgrabber.py

    • [x] version.py

    • [x] zconfig.py

  • [ ] scripts
  • [x] six - No longer needed
  • [ ] tests

    • [ ] test_functional.py

    • [ ] testhelper.py

  • [x] tools

    • [x] extract_pot.py

    • [x] make_mo.py

    • [x] msgfmt.py

  • [ ] util

    • [ ] apireg.py

    • [ ] __init__.py

    • [ ] mailslot.py

  • [ ] ISSUES.txt (needs to be updated after all this is done)
  • [ ] SABHelper.py
  • [ ] SABnzbd.py
Help Wanted Work in progress

Most helpful comment

Well. Now it's broken ;)
I get "Python 2.7 is no longer supported" when running the post-processing script

All 11 comments

Major pointers for future reference (will probably add more as I go):

  • We have to use platform_btou with Popen because we cannot use encoding parameter, which was only added in Python 3.6 and we also want to support Python 3.5
  • One could also suggest to use the universal_newlines/text (parameter was renamed) and set it to True, but this doesn't work for unicode downloads. For some reason it breaks on special outputs.
  • Have to set bufsize=0 in Direct Unpack, otherwise Python 3 tries to be smart and buffer the Popen output.

do we really want to support python 3.5?

Python 2.0 - October 16, 2000

    Python 2.1 - April 15, 2001
    Python 2.2 - December 21, 2001
    Python 2.3 - July 29, 2003
    Python 2.4 - November 30, 2004
    Python 2.5 - September 19, 2006
    Python 2.6 - October 1, 2008
    Python 2.7 - July 3, 2010

Python 3.0 - December 3, 2008

    Python 3.1 - June 27, 2009
    Python 3.2 - February 20, 2011
    Python 3.3 - September 29, 2012
    Python 3.4 - March 16, 2014
    Python 3.5 - September 13, 2015
    Python 3.6 - December 23, 2016
    Python 3.7 - June 27, 2018

from python 3.6 change log ( https://docs.python.org/3/whatsnew/3.6.html ):

The dict type has been reimplemented to use a more compact representation based on a proposal by Raymond Hettinger and similar to the PyPy dict implementation. This resulted in dictionaries using 20% to 25% less memory when compared to Python 3.5.

The hashlib and ssl modules now support OpenSSL 1.1.0.

https://docs.python.org/3/whatsnew/3.6.html#pep-529-change-windows-filesystem-encoding-to-utf-8

there is plenty of other things.. but also python 3.5 performance was not great.. 3.6+ is when it finally started to overtake python 2.x

It's because we want to support Ubuntu 16 (LTS), which ships with 3.5.

Hello, is there any update on this effort? Debian is trying to remove Python 2 from the next stable release (a couple of years ahead, but better start early :)

Python 2 end of life is 2020 -- https://pythonclock.org/

So we still have a few more months. but it's not like python2 is just going to stop working.
Just there wont be any more updates... which may or maynot matter to most.

Now when the next hot comes around python2 will start to really show its age. Nothing is stopping those that are dating to test the py3 version today to help provide feedback.

Well. Now it's broken ;)
I get "Python 2.7 is no longer supported" when running the post-processing script

I get "Python 2.7 is no longer supported" when running the post-processing script

SABnzbd nor Python say that.

I guess you're using nzbToMedia, as that post-processing script says that. See https://github.com/clinton-hall/nzbToMedia/blob/2e7d4a58633b4b7924496ba849636bd5bb3b98cc/eol.py#L143 for the code.
So ... discuss or register an issue there?

PS: if you run SABnzbd from source (probably: on Linux), you could start using the python3 version of SABnzbd. It works for me!

Sure. It's still related to Sabnzbd since it's the reason an outdated version of python is used for nzbToMedia

since it's the reason an outdated version of python is used for nzbToMedia

Could be (but I doubt it: see https://github.com/clinton-hall/nzbToMedia/issues/1533#issuecomment-570089243 ), but the real reason is someone decided to code that warning into nzbToMedia: https://github.com/clinton-hall/nzbToMedia/issues/1533

Well. Now it's broken ;)
I get "Python 2.7 is no longer supported" when running the post-processing script

Using Ubuntu and have sabnzbd running on a headless server. Got round this issue by changing the python default to Python 3, but in the sabnzbd daemon use /bin/phython2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pinn73 picture pinn73  路  5Comments

hl2guide picture hl2guide  路  4Comments

Timexx picture Timexx  路  5Comments

OneCDOnly picture OneCDOnly  路  7Comments

nosmokingbandit picture nosmokingbandit  路  5Comments