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

DepractionWarning from implicitly required module imp #38

Closed
kidmose opened this issue Apr 15, 2020 · 4 comments
Closed

DepractionWarning from implicitly required module imp #38

kidmose opened this issue Apr 15, 2020 · 4 comments

Comments

@kidmose
Copy link
Contributor

kidmose commented Apr 15, 2020

The from future import standard_library, that is widely used here in pywhois, hits an import imp in the future module here, which in my test setup results in a DeprecationWarning (my setup: pytest, Python 3.7.0, pytest-5.3.5, py-1.8.1, pluggy-0.13.1). I would like to use pywhois in my project, but the warning is undesirable...

I don't see a simple fix for this (If there is, I'd like pointers on how to contribute with it!) so I'm instead raising the question; Is it about time to drop support for py2 and thereby make it possibly to remove future as a dependency of pywhois?

From my point of view, py2 is dead and gone, so those who cling to it should not expect to get updates in libraries like pywhois.

kidmose added a commit to aau-network-security/pywhois-backup-before-forking that referenced this issue Apr 16, 2020
kidmose added a commit to aau-network-security/pywhois that referenced this issue Apr 16, 2020
kidmose added a commit to aau-network-security/pywhois that referenced this issue Apr 16, 2020
kidmose added a commit to aau-network-security/richkit that referenced this issue Apr 16, 2020
kidmose added a commit to aau-network-security/richkit that referenced this issue Apr 21, 2020
* Going from whois to python-whois

* Use a py2-less python-whois, until upstream python-whois is fixed

Cf. Fixes richardpenman/whois#38

* Use pywhois fork what also has 'SyntaxWarning`s fixed

Solves #110
@richardpenman
Copy link
Owner

sorry I would like to keep python2 - some people aren't able to upgrade

@elderlabs
Copy link

Python 3.12 is coming. It will drop all support for imp, thus I must suggest a compromise.

Many packages maintain support for the long-deprecated Python2 without the use of imp. While I myself do not, there are alternative means to maintaining support for both sides, otherwise python-whois will end with the release of Python 3.12. As I and many others would not like to see that, I'd like to correct this issue somewhere in the pipeline.

Packages like six might offer some amount of support, though I have not checked. I'll look into correcting the issue in python-future directly, though testing the patch would be fairly impossible as I do not use it myself.

@elderlabs
Copy link

elderlabs commented Mar 31, 2023

I reached out to the python-future team when I originally replied to this issue. Years later, they still haven't updated their project, which projects like this one depend upon. Python 3.12 is approaching very soon. There's been an open PR in python-future to fix the issue since 2019.

We have two options, it would appear. Either python-whois migrates to a fork of python-future, or python-whois ends with Python 3.12, in favor of supporting the long deprecated and unsupported Python 2.

There's nothing stopping development here. We can gracefully break step from Python 2 with a version number increase. Releases for Python 2 can remain on an older version number (mostly for security patching), while development for Python 3 can continue.

If it were me, and dropping Python 2 years after its retirement wasn't an option, I'd do as I've done before. Grab a fork of python-future that's not dead, or fork python-future yourself and merge that PR, no additional work needed. It will keep python-whois alive exponentially longer, and maintain unbreaking support for both Python 2 and Python 3.

I do not want to see this project die, as I do still depend on it. I hope that I can still depend upon it when Python 3.12 is released. @richardpenman perhaps one of the few options I've noted here would work for you, particularly my final note about forking.

Thanks.

EDIT: so I looked into python-future. It looks like a patch might have been pushed in version 0.18.3, but the PR left open. Perhaps my Python virtual-env is outdated. Will report back if it's patched. Surprised that didn't occur to me sooner. Thing is, I install package updates frequently, so I'm not certain why future would still be an old version.

EDIT 2: So I rebuilt my venv with the latest of everything. The imp deprecation is still present. It would seem this issue still goes unfixed.

@AngellusMortis
Copy link

Just another bump on this. Python 3.12 comes out in less then 3 months. This package and everything that uses it will stop working unless this deprecation is fixed.

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 a pull request may close this issue.

4 participants