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

Use of async as a variable name breaks Paramiko in Python 3.7 #1108

Closed
vEpiphyte opened this Issue Nov 5, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@vEpiphyte
Copy link

vEpiphyte commented Nov 5, 2017

After installing Paramiko 2.3.1 into a Python 3.7-rc docker container, attempting to import Paramiko fails.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/paramiko/__init__.py", line 31, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/usr/local/lib/python3.7/site-packages/paramiko/transport.py", line 70, in <module>
    from paramiko.sftp_client import SFTPClient
  File "/usr/local/lib/python3.7/site-packages/paramiko/sftp_client.py", line 43, in <module>
    from paramiko.sftp_file import SFTPFile
  File "/usr/local/lib/python3.7/site-packages/paramiko/sftp_file.py", line 68
    self._close(async=True)
                    ^
SyntaxError: invalid syntax

According to https://www.python.org/dev/peps/pep-0492/#deprecation-plans async becomes a Python language keyword starting in Python 3.7.

Relates to vertexproject/synapse-docker-testimages#37

Similar issue encountered in neovim/pynvim#274

@bitprophet

This comment has been minimized.

Copy link
Member

bitprophet commented Nov 7, 2017

Well that makes me grumpy. Where's Python 4.0 when you need it? 🙃

Thank goodness, the only spots I see [^_]async[^_] are right around where you found it, and it's technically in a private API, so I can't feel too bad about renaming it. Will fix in a sec. Thank you for the report!

@bitprophet bitprophet closed this in 0e0b2b8 Nov 7, 2017

bitprophet added a commit that referenced this issue Nov 7, 2017

Changelog re #1108
[ci skip]

bitprophet added a commit that referenced this issue Nov 7, 2017

bitprophet added a commit that referenced this issue Nov 7, 2017

Changelog re #1108
[ci skip]

bitprophet added a commit that referenced this issue Nov 7, 2017

bitprophet added a commit that referenced this issue Nov 7, 2017

dkhapun pushed a commit to cyberx-labs/paramiko that referenced this issue Jun 7, 2018

dkhapun pushed a commit to cyberx-labs/paramiko that referenced this issue Jun 7, 2018

@vardhmanandroid2015

This comment has been minimized.

Copy link

vardhmanandroid2015 commented Jan 11, 2019

Faced the same issue when upgraded docker client to latest one docker-3.7.0 on WIndow10
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker_init_.py", line 2, in
from .api import APIClient
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\api_init_.py", line 2, in
from .client import APIClient
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\api\client.py", line 10, in
from .build import BuildApiMixin
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\api\build.py", line 6, in
from .. import auth
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\auth.py", line 9, in
from .utils import config
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\utils_init_.py", line 3, in
from .decorators import check_resource, minimum_version, update_headers
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\utils\decorators.py", line 4, in
from . import utils
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\utils\utils.py", line 13, in
from .. import tls
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\tls.py", line 5, in
from .transport import SSLAdapter
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\transport_init_.py", line 11, in
from .sshconn import SSHAdapter
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\transport\sshconn.py", line 1, in
import paramiko
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\paramiko_init_.py", line 30, in
from paramiko.transport import SecurityOptions, Transport
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\paramiko\transport.py", line 66, in
from paramiko.sftp_client import SFTPClient
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\paramiko\sftp_client.py", line 41, in
from paramiko.sftp_file import SFTPFile
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\paramiko\sftp_file.py", line 66
self._close(async=True)
^
SyntaxError: invalid syntax

@vEpiphyte

This comment has been minimized.

Copy link
Author

vEpiphyte commented Jan 11, 2019

@vardhmanandroid2015 The https://github.com/docker/docker-py library 3.7.0 release only includes paramiko if you do a extras install specifying ssh. This is a problem with how you installed the library; not a problem with paramiko or docker-py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.