Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 2.6 compatibility #47

Open
dbzoo opened this issue Dec 23, 2016 · 4 comments
Open

Python 2.6 compatibility #47

dbzoo opened this issue Dec 23, 2016 · 4 comments

Comments

@dbzoo
Copy link

dbzoo commented Dec 23, 2016

Not so much a problem as an observation.
I was setting this up on a couple of CentOS 6 servers which by default install with py2.6
There is 1 line that prevents it working with this older OS.

def setup_logging():
    my_logger = logging.getLogger()
    my_logger.setLevel(logging.DEBUG)
    handler = logging.handlers.RotatingFileHandler("/tmp/prt.log", maxBytes=100*1024, backupCount=5)
    my_logger.addHandler(handler)

    # This only available in py2.7
    config = get_config()
    #logging.config.dictConfig(config["logging"])

config.dictConfig is cool agreed but this one line wipes out older OS'. Not all of us use Ubuntu and the latest and greatest python. As I said not a problem, if you can code, just an observation as it limits what versions of OS's this will work with out of the box. Feel free to close it. I just wanted it tracked for posterity.

@Stealthii
Copy link

It seems ludicrous to track bugs for an unsupported version of Python. I'd suggest using IUS for newer versions of languages you need, such as Python 2.7.

Improving support for outdated languages will only reduce compatibility, or increase workarounds for Python 3.

@liviynz
Copy link
Collaborator

liviynz commented Mar 10, 2017

Out of professional curiosity...I have to ask...why centos 6?? I get that not everyone uses Ubuntu, I have 4 different distros on various systems in my home network by I'm really confused why anyone would go with centos 6 today...all the code n packages are pretty long in the tooth. 7 years old and currently being phased out so you've peeked my curiosity with that one...please do share :) In regards to your actual point, I hear you...so close for Python 2.6 but there's only so much backwards compatibility that can be built into the code when trying to cover so many distros and the newer versions Python (not even bleeding edge either) have so many bug fixes and easier ways of doing things. You can get 2.7 on centos 6 from memory...it's a bit of a painful install but if I remember correctly it does work...just.

@dbzoo
Copy link
Author

dbzoo commented Mar 10, 2017

Well this server was setup a long time ago and as it still working and doing everything that is required of it I see no reason to upgrade just because I want a shiny and new OS. My general philosophy is "if it ain't broke don't touch it". Arguably py2.6 does break it so perhaps its time to upgrade, but I have an issue with CentOS 7 and the whole systemd ideology which is why I have resisted the upgrade too. Which means I would need to move to an OS that supports init.d and ZFS so my filesystems mount up (that isn't Ubuntu or any variant there of, another pet peeve that is not meant to incite). Now its sounding like more work than its worth. Which brings me to "I'll just hack your py2.7 code to work with py2.6 and save myself the effort.". Now we are full circle. Like I said not a biggy I just wanted to note this in case others run into the same. Thanks for asking.

@liviynz
Copy link
Collaborator

liviynz commented Mar 10, 2017

Systemd is the way of the future, embrace it or be left behind! ;) it's actually not that bad of a learning curve and fixes some core issues with the 20 year old system 5. I'd recommend against centos 7 though...redhat make their cuts for their os's so conservative and behind, fedora 25 is a better option IMHO but you could do worse than centos 7. Just be wary of tuned with 6/7 as it's got some interesting/nasty "quirks" but at least you have a relatively painless upgrade option available which was never around before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants