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

Replace lxml with standard library xml #1257

Closed
vkbo opened this issue Nov 24, 2022 · 0 comments · Fixed by #1452
Closed

Replace lxml with standard library xml #1257

vkbo opened this issue Nov 24, 2022 · 0 comments · Fixed by #1452
Assignees
Labels
minor issue Issue: Mostly harmless refactoring Request: Code refactoring needed

Comments

@vkbo
Copy link
Owner

vkbo commented Nov 24, 2022

When Python 3.7 is dropped some time after mid 2023, see PEP 537, the lxml package can potentially be replaced by the standard library xml module. It would get rid of one more dependency.

There are some known issues with the implementation of the standard library xml compared to lxml:

  • Prior to 3.8, the attribute order is not preserved by the write method. This is not an issue for novelWriter at runtime, but it breaks all tests that compare written XML files.
  • Prior to 3.9, there is no function for indenting the XML file. The function itself is trivial, and can be copied from the standard library source, so this is not really a blocker.
  • In general, the implementation of namespaces is a lot clunkier in the standard library xml module. It is much easier to handle in lxml.

Edit: Python 3.7 end of life set to 2023-06-27. See devguide.python.org.

@vkbo vkbo added minor issue Issue: Mostly harmless refactoring Request: Code refactoring needed labels Nov 24, 2022
@vkbo vkbo added this to the Future Release milestone Nov 24, 2022
@vkbo vkbo self-assigned this Nov 24, 2022
@vkbo vkbo mentioned this issue May 29, 2023
6 tasks
@vkbo vkbo linked a pull request May 29, 2023 that will close this issue
6 tasks
@vkbo vkbo closed this as completed May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor issue Issue: Mostly harmless refactoring Request: Code refactoring needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant