Anorov/PySocks

DeprecationWarning in socks.py "Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working"

yuji38kwmt opened this issue · 7 comments

Environment

  • pytest 4.0.0
  • Python 3.7.1
  • Annaconda
  • Windows10
> pytest --version
This is pytest version 4.0.0, imported from c:\programdata\anaconda3\lib\site-packages\pytest.py
setuptools registered plugins:
  pytest-remotedata-0.3.0 at c:\programdata\anaconda3\lib\site-packages\pytest_remotedata\plugin.py
  pytest-openfiles-0.3.0 at c:\programdata\anaconda3\lib\site-packages\pytest_openfiles\plugin.py
  pytest-doctestplus-0.1.3 at c:\programdata\anaconda3\lib\site-packages\pytest_doctestplus\plugin.py
  pytest-arraydiff-0.2 at c:\programdata\anaconda3\lib\site-packages\pytest_arraydiff\plugin.py

Warning

DeprecationWarning causes in socks.py when pytest command is executed.

pytest-dev/pytest#4769

> pytest tests/
============================= test session starts =============================
platform win32 -- Python 3.7.1, pytest-4.0.0, py-1.6.0, pluggy-0.7.1 -- c:\programdata\anaconda3\python.exe
cachedir: .pytest_cache
rootdir: C:\vagrant\synced_folder\annofab-api-access-python-commons, inifile: pytest.ini
plugins: remotedata-0.3.0, openfiles-0.3.0, doctestplus-0.1.3, arraydiff-0.2
collected 1 items

tests/test_annofab.py::test_account PASSED

============================== warnings summary ===============================
c:\programdata\anaconda3\lib\site-packages\socks.py:58
  c:\programdata\anaconda3\lib\site-packages\socks.py:58: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    from collections import Callable

Hi.
I have the same Isssue Arch is Python 3.7. This is all i have to do to get rid of it. But i think python before 3.3 have a problem. I am not an expert especially how to handle backwards compatibility. maybe try catch?


--- socks.py    2019-02-15 00:08:12.562118403 +0100
+++ socks.py        2019-02-16 18:46:36.000000000 +0100
@@ -55,7 +55,7 @@
 """
 
 from base64 import b64encode
-from collections import Callable
+from collections.abc import Callable
 from errno import EOPNOTSUPP, EINVAL, EAGAIN
 import functools
 from io import BytesIO


https://docs.python.org/3/library/collections.abc.html#module-collections.abc
New in version 3.3: Formerly, this module was part of the collections module.

Sorry, i should have checked the source code before posting. Why is this project not uptodate on the pip repo?
btw. Thank you!

hayd commented

It seems like a new version has not been released yet since this change.

Any plans to release a new version with this fix?

Moreover version information in file says it's still 1.3.7.

This change has been pushed to PyPI.

Corrected at version 1.7.0, right?