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

defusedxml deprecation warning #6

Open
carlwgeorge opened this issue May 12, 2019 · 4 comments
Open

defusedxml deprecation warning #6

carlwgeorge opened this issue May 12, 2019 · 4 comments

Comments

@carlwgeorge
Copy link
Owner

Running the tests currently results in a deprecation warning that wasn't there with previous versions of the dependencies.

source/repomd.py:4
  /home/carl/development/repomd/source/repomd.py:4: DeprecationWarning: defusedxml.lxml is no longer supported and will be removed in a future release.
    import defusedxml.lxml

This looks to be caused by tiran/defusedxml#38.

tobias-urdin added a commit to tobias-urdin/repomd that referenced this issue Mar 13, 2020
This patch removes the defusedxml usage
and uses lxml istead.

Closes carlwgeorge#6
@Kuba314
Copy link

Kuba314 commented Dec 6, 2023

Hi, are there any updates on this? We could just do this, right?:

- import defusedxml.lxml
+ from defusedxml import ElementTree

and replace defusedxml.lxml.fromstring() with ElementTree.fromstring()

@carlwgeorge
Copy link
Owner Author

Sorry, no update on this so far. I'm long overdue to do some maintenance work on this module, I just haven't gotten around to it yet. When I do I plan to just remove the defusedxml dependency entirely, as that upstream now believes that lxml is mostly safe. When I first wrote this module lxml was significantly faster than other methods, so I'd prefer to stick with it.

@Kuba314
Copy link

Kuba314 commented Dec 8, 2023

@carlwgeorge Thank you for the quick reply. Would you accept a PR to use lxml instead of defusedxml? Or even use the standard xml module itself since all this project is doing is running fromstring which the xml module is capable of? I don't know anything about speed though so lxml might be a better choice here but then again, it's 1 more dependency.

@carlwgeorge
Copy link
Owner Author

I appreciate the offer of a PR, but it's not necessary as I just need to revert this commit, which will be easy to do once I find time to work on this again. I do intend to keep using the lxml module because of the speed benefits, which are really needed for larger repositories.

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

2 participants