SeleniumLibrary icon indicating copy to clipboard operation
SeleniumLibrary copied to clipboard

support robot 5.0

Open DetachHead opened this issue 3 years ago • 2 comments

import SeleniumLibrary
(.venv) C:\Users\user\project>c:/Users/user/project/.venv/Scripts/python.exe c:/Users/user/project/Sandpit/test.py
Traceback (most recent call last):
  File "c:\Users\user\project\Sandpit\test.py", line 52, in <module>
    import SeleniumLibrary
  File "c:\Users\user\project\.venv\lib\site-packages\SeleniumLibrary\__init__.py", line 33, in <module>
    from SeleniumLibrary.keywords import (
  File "c:\Users\user\project\.venv\lib\site-packages\SeleniumLibrary\keywords\__init__.py", line 18, in <module>
    from .browsermanagement import BrowserManagementKeywords  # noqa
  File "c:\Users\user\project\.venv\lib\site-packages\SeleniumLibrary\keywords\browsermanagement.py", line 30, in <module>
    from .webdrivertools import WebDriverCreator
  File "c:\Users\user\project\.venv\lib\site-packages\SeleniumLibrary\keywords\webdrivertools\__init__.py", line 17, in <module>
    from .webdrivertools import WebDriverCreator  # noqa
  File "c:\Users\user\project\.venv\lib\site-packages\SeleniumLibrary\keywords\webdrivertools\webdrivertools.py", line 25, in <module>
    from robot.utils import ConnectionCache, StringIO
ImportError: cannot import name 'StringIO' from 'robot.utils' (c:\Users\user\project\.venv\lib\site-packages\robot\utils\__init__.py)

my understanding is that StringIO has been removed in 5.0 https://github.com/robotframework/robotframework/issues/4150

DetachHead avatar Dec 05 '21 23:12 DetachHead

Good catch! I now added robot.utils.StringIO back to avoid breaking old SL versions, but that usage should definitely be removed.

pekkaklarck avatar Dec 07 '21 11:12 pekkaklarck

Ping @emanlove! SL should stop using robot.utils.StringIO and use io.StrinIO instead. The former is effectively deprecated and will be removed in the future.

pekkaklarck avatar Jan 27 '22 09:01 pekkaklarck