suds-community / suds

Suds is a lightweight SOAP python client for consuming Web Services. A community fork of the jurko fork.
https://suds.readthedocs.io/
GNU Lesser General Public License v3.0
173 stars 56 forks source link

ResourceWarning: unclosed file in reader.py #63

Closed jonatasrs closed 2 years ago

jonatasrs commented 2 years ago

This warning is showing when run whith python -Wa

python3.7/site-packages/suds/reader.py:72: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/suds/suds-***-document.px'>

jonatasrs commented 2 years ago

I was investigating the problem, and found it to be a conflict if you have both suds-jurko and suds-community installed. Then suds-jurko should automatically be removed when installing suds-community.

phillbaker commented 2 years ago

Hi @jonatasrs, thanks for opening the issue. We'll have to investigate the reported warning. Did it include a longer stracktrace that you can share?

Regarding the package conflict, setuptools doesn't have a way to specify conflicts that I'm aware of, so specifying conflicting packages isn't possible today.

phillbaker commented 2 years ago

Hello - can you please include a reproduction for this and include the version of suds that you're using? I'm not able to reproduce this.

phillbaker commented 2 years ago

I'm going to close this issue out as a dupe of https://github.com/suds-community/suds/pull/28.

Looking at the code, the last time that the line number you're referencing didn't point to a comment was back in the 0.6 release: https://github.com/suds-community/suds/blob/release-0.6/suds/reader.py#L72. Since this has been fixed in more recent versions, please update.

jonatasrs commented 2 years ago

Yes, the problem is that suds-jurko is not automatically removed when installing suds-community. I am manually removing suds-jurko before installing suds-community. I saw that now "suds-communty" is "suds" so I already adjusted it in my code, https://pypi.org/project/suds/ Thanks for the answer.