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
Closed

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

vEpiphyte opened this issue Nov 5, 2017 · 3 comments

Comments

@vEpiphyte
Copy link

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
Copy link
Member

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!

@vardhmanandroid2015
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
Copy link
Author

@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.

openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Jan 22, 2020
* Update cinder from branch 'master'
  - Merge "Bump paramiko requirement"
  - Bump paramiko requirement
    
    Paramiko 2.0 appears to not support Python 3.7
    due to
    
    paramiko/paramiko#1108
    
    Move to a more recent version.
    
    Change-Id: Ie0407138596ffccd3bd4909b5ea071042daad8fd
openstack-gerrit pushed a commit to openstack/cinder that referenced this issue Jan 22, 2020
Paramiko 2.0 appears to not support Python 3.7
due to

paramiko/paramiko#1108

Move to a more recent version.

Change-Id: Ie0407138596ffccd3bd4909b5ea071042daad8fd
openstack-mirroring pushed a commit to openstack/tacker that referenced this issue Nov 17, 2020
Need to update paramiko to fix the following.
paramiko/paramiko#1108

Change-Id: If40c0674273df6b76a9bcd88f216f6aa68625fa3
Closes-Bug: #1886298
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Nov 17, 2020
* Update tacker from branch 'master'
  - Fix paramiko version for py37 and upper
    
    Need to update paramiko to fix the following.
    paramiko/paramiko#1108
    
    Change-Id: If40c0674273df6b76a9bcd88f216f6aa68625fa3
    Closes-Bug: #1886298
geissonator pushed a commit to openbmc/openbmc-test-automation that referenced this issue Mar 8, 2021
Versions below 2.1.0 fail with the error
"Incompatible ssh peer (no acceptable kex algorithm)".

And versions below 2.3.2 fail with the Python versions above 3.7
because of the 'async' variable bug:
paramiko/paramiko#1108

Therefore constrain minimal paramiko version to 2.3.2

Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Change-Id: Ia47dd0d82a916fc5e5fc440cd2b79607c892265a
openstack-mirroring pushed a commit to openstack/networking-baremetal that referenced this issue Aug 17, 2022
Add the initial part of a device driver using Netconf and
OpenConfig models. Implements network create/delete/update
and port create/delete/update.

Also bump paramiko lower-constrain to 2.3.2, see:
  paramiko/paramiko#1108

Story: 2009961
Task: 44996

Depends-On: https://review.opendev.org//837105
Change-Id: Ifc89923d7f6bbfba25feb2218b80fea9e27b9c4a
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Aug 17, 2022
* Update networking-baremetal from branch 'master'
  to 3b99ee3bc720d2e56487439ee52e5fceb45f6bcd
  - Add netconf-openconfig device driver
    
    Add the initial part of a device driver using Netconf and
    OpenConfig models. Implements network create/delete/update
    and port create/delete/update.
    
    Also bump paramiko lower-constrain to 2.3.2, see:
      paramiko/paramiko#1108
    
    Story: 2009961
    Task: 44996
    
    Depends-On: https://review.opendev.org//837105
    Change-Id: Ifc89923d7f6bbfba25feb2218b80fea9e27b9c4a
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