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

SSHLibrary not working with RF#5.0a1 #401

Closed
fcolak opened this issue Feb 1, 2022 · 7 comments
Closed

SSHLibrary not working with RF#5.0a1 #401

fcolak opened this issue Feb 1, 2022 · 7 comments

Comments

@fcolak
Copy link

fcolak commented Feb 1, 2022

Performing a simple suite with SSHLibrary.

**Settings
Library  SSHLibrary
**Test Cases
T1
  Open Connection And Log In
  ${output}=         Execute Command    echo Hello SSHLibrary!
  Should Be Equal    ${output}          Hello SSHLibrary!
**Keywords
Open Connection And Log In
   Open Connection     ${hostname}
   Login               ${username}        ${password}

The error I've got:
Importing library 'SSHLibrary' failed: AttributeError: module 'robot.utils.platform' has no attribute 'PY2'

linux# pip freeze | egrep 'robot|six'
robotframework==5.0a1
robotframework-debuglibrary==2.2.2
robotframework-ftplibrary==1.9
robotframework-pabot==2.1.0
robotframework-pythonlibcore==3.0.0
robotframework-seleniumlibrary==6.0.0
robotframework-snmplibrary==0.2.1
robotframework-sshlibrary==3.8.0
robotframework-stacktrace==0.4.1
robotframework-tftplibrary==1.1
six==1.16.0
@pekkaklarck
Copy link
Contributor

This issue is due to SSHLibrary using Robot's Python 2/3 compatibility layer. RF 5.0 doesn't need it anymore itself, but we have preserved it to avoid breaking libraries and tools using it (robotframework/robotframework#4150).

The problem is that SSHLibrary imports the PY2 constant from robot.utils.platform, but we have preserved it only in robot.utils. It was there also earlier, all utils that are part of the public API are exposed via robot.utils, so to fix this in a way that's compatible also with older RF versions you just need to change

from robot.utils.platform import PY2

to

from robot.utils import PY2

It would be great if you could do that soon and test how SSHLibrary in general works with RF 5. If there's something we have broken, let as know ASAP and we hopefully can still fix it before the final RF 5.0 release.

Ping @mihaiparvu.

@mihaiparvu
Copy link
Contributor

So far it seems the only problem was the old Python 2/3 compatibility layer. After making the fix and testing everything works as expected.

@pekkaklarck
Copy link
Contributor

Great, thanks for testing! I checked the PR and noted that also WINDOWS could be imported directly from robot.utils.

@fcolak
Copy link
Author

fcolak commented Feb 10, 2022

I also tested this in my environment and didn't see any problem other than reported one here.

thanks!

pekkaklarck added a commit to robotframework/robotframework that referenced this issue Feb 16, 2022
Add `robot.utils.platform.PY2` back to avoid breaking SSHLibrary.
MarketSquare/SSHLibrary#401
@pekkaklarck
Copy link
Contributor

robot.utils.platform.PY2 was added back. The next RF 5.0 preview release ought to thus work with the current SSHLibrary version.

@hugovk
Copy link

hugovk commented Feb 16, 2022

What's the schedule for dropping Python 2.7 (and indeed EOL 3.4-3.6) in SSHLibrary?

@hugovk
Copy link

hugovk commented Feb 16, 2022

Please see PR #407 for an alternate compatibility fix.

@rticau rticau added this to the v3.8.1 milestone Mar 29, 2022
@rticau rticau closed this as completed Mar 29, 2022
@Noordsestern Noordsestern modified the milestones: v3.8.1, v4.0 Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants