Skip to content

enable older ipaddr module, for compatibility with older versions of python #69

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

Closed
wants to merge 1 commit into from

Conversation

dkg
Copy link

@dkg dkg commented Jan 29, 2014

Python only added the ipaddress module to its standard library in
3.3, but some older systems will still be using older versions of
python3 for some time. (e.g. debian wheezy, which will probably be
supported into 2016, has python 3.1).

For these older systems, the simplest route is to install the ipaddr
module, which has slightly different naming schemes for some
functions.

For systems already running python 3.3, this patch won't change their
behavior, but it will make it possible to run py-postgresql against
python 3.1, as long as the external ipaddr module is also installed
separately.

…python

Python only added the ipaddress module to its standard library in
3.3, but some older systems will still be using older versions of
python3 for some time. (e.g. debian wheezy, which will probably be
supported into 2016, has python 3.1).

For these older systems, the simplest route is to install the ipaddr
module, which has slightly different naming schemes for some
functions.

For systems already running python 3.3, this patch won't change their
behavior, but it will make it possible to run py-postgresql against
python 3.1, as long as the external ipaddr module is also installed
separately.
@jwp
Copy link
Contributor

jwp commented Jan 31, 2014

I think it would be wiser to just make a backport of the ipaddress module from Python3.3. Guarantees a consistent interface moving forward to Python3.3 in the future. If you're not actually using the IP address structure, you can also cast the ip or cidr columns to strings in the query. No dependency needed in that case.

@jwp jwp closed this Jan 31, 2014
@elprans
Copy link
Contributor

elprans commented Jan 31, 2014

Actually, such a backport already exists: https://pypi.python.org/pypi/ipaddress

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

Successfully merging this pull request may close these issues.

3 participants