0

I tried to upgrade a few packages with pip and also my python from 3.9 to 3.9.13. so now i use RIDE v2.0b1 running on Python 3.9.13. i use robotframework-sudslibrary-aljcalandra 1.1.4. instead of 1.1 and urllib3 1.26.12 instead of 1.26.9 for calls to webservices I get an error when running a keyword of sudslibrary (Create Soap Client)

FAIL : AttributeError: module 'urllib' has no attribute 'pathname2url'

Since i don't have any knowledge of python and all solutions on google are about python, i'm stuck with this error. could anybody please help me? In python 3.4.2 urlib no attribute 'pathname2url' it says that pathname2url function of urllib is now in another library which is urllib.request.pathname2url.

Should i install this python library independently by pip? it's strange because with my older installations (ython 3.9) i didn't have urllib.request.pathname2url library when i pip(ed) list it. Thank you for your precious help i'm badly stucked

2
  • What Python version were you using before? What exact code are you running that's causing this error? Looks like something very similar was posted in this GitHub issue on their repo. Unfortunately it doesn't have any responses, but looks like you're trying to upgrade from Python 2 to 3. Commented Nov 10, 2022 at 15:46
  • i was using python 3.9 before with robotframework-sudslibrary-aljcalandra 1.1 and urllib3 1.26.9 and calling webservices keywoards like Create Soap Client abc.wsdl Commented Nov 10, 2022 at 16:26

1 Answer 1

1

This seems a problem on the sudslibrary you are using. A possible workaround is to fix the offending code by replacing with the new module reference.

You could (should?) find all references to the import or use of pathname2urlin that module library and replace with fixing code. For example:

import urllib.request.pathname2url as pathname2url

or if you have from urllib import pathname2url

from urllib.request import pathname2url

The best would be, after identifying the fix, to propose a Pull Request for the sudslibrary, with something like:

try:
   from urllib import pathname2url
except ImportError:
   from urllib.request import pathname2url

And similar for the absolut imports.

Sign up to request clarification or add additional context in comments.

10 Comments

Thank you Helio. I'm not a developer.So, very basic questions:
Thank you, Helio, I'm not a developer so my understanding is 1-I go to the source code of robotframework-sudslibrary-aljcalandra 1.1.4. (which is not on my PC but on pypi, i download it) 2-I search inside all files of this library, all the occurences of pathname2url 3-if it's written like urllib.pathname2url, instead of changing it to urllib.request.pathname2url, i either add at top of the file where pathname2url was used, import urllib.request.pathname2url as pathname2url or from urllib.request import pathname2url Now i should compile this python source code, and
and somewhere ? i use try: from urllib import pathname2url except ImportError: from urllib.request import pathname2url
No, the files are installed on your system. Usually in C:\Python\Lib\site-packages\robotframework-sudslibrary-aljcalandra (if on windows, and not sure about the module name). You can edit them directly. Or, you can use the downloaded source, modify the files, and then install (pip install -U . if you are in the root of the source code.
Thank you i found sudslibrary and the only file and only line that call pathname2url function. but it uses the correct class(module)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.