-
Notifications
You must be signed in to change notification settings - Fork 862
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
DeprecationWarning: Testing an XML element's truth value will raise an exception in future versions #1355
Comments
I may pull the latest and run the tests on 3.12 and fix related issues. I'll assign this to me for now. |
We do have some issues which I've fixed locally: diff --git a/markdown/extensions/admonition.py b/markdown/extensions/admonition.py
index 6d395f3..ce8492f 100644
--- a/markdown/extensions/admonition.py
+++ b/markdown/extensions/admonition.py
@@ -78,14 +78,14 @@ class AdmonitionProcessor(BlockProcessor):
indent = 0
while last_child is not None:
if (
- sibling and block.startswith(' ' * self.tab_length * 2) and
- last_child and last_child.tag in ('ul', 'ol', 'dl')
+ sibling is not None and block.startswith(' ' * self.tab_length * 2) and
+ last_child is not None and last_child.tag in ('ul', 'ol', 'dl')
):
# The expectation is that we'll find an `<li>` or `<dt>`.
# We should get its last child as well.
sibling = self.lastChild(last_child)
- last_child = self.lastChild(sibling) if sibling else None
+ last_child = self.lastChild(sibling) if sibling is not None else None
# Context has been lost at this point, so we must adjust the
# text's indentation level so it will be evaluated correctly But we are also getting: Traceback (most recent call last):
File "/Users/facelessuser/Code/github/markdown/tests/test_meta.py", line 20, in test__version__IsValid
import packaging.version
ModuleNotFoundError: No module named 'packaging'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/facelessuser/Code/github/markdown/tests/test_meta.py", line 22, in test__version__IsValid
from pkg_resources.extern import packaging
ModuleNotFoundError: No module named 'pkg_resources' I'll have to dig into that issue separately. |
https://docs.python.org/3.12/whatsnew/3.12.html#removed:
It seems |
I've created the separate issue here: #1357 for the packaging issue. |
From a pytest run:
From https://docs.python.org/3.12/whatsnew/3.12.html#deprecated:
Also from https://docs.python.org/3.12/whatsnew/3.12.html#pending-removal-in-python-3-14:
Python Markdown version: 3.3.7.
Not sure if this is fixed in later versions.
The text was updated successfully, but these errors were encountered: