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

Silence future warning #320

Open
uwardlaw opened this issue Aug 19, 2024 · 3 comments
Open

Silence future warning #320

uwardlaw opened this issue Aug 19, 2024 · 3 comments

Comments

@uwardlaw
Copy link

When I execute book = epub.read_epub("valid.epub", {"ignore_ncx": True})

I get a future warning:

\Lib\site-packages\ebooklib\epub.py:1423: FutureWarning: This search incorrectly ignores the root element, and will be fixed in a future version.  If you rely on the current behaviour, change it to './/xmlns:rootfile[@media-type]'
  for root_file in tree.findall('//xmlns:rootfile[@media-type]', namespaces={'xmlns': NAMESPACES['CONTAINERNS']}):

Is there a way to silence this warning without altering the code, like with the ignore_ncx? Thanks.

@therb1
Copy link

therb1 commented Oct 6, 2024

I'm creating a PR to solve this problem, if I understand correctly what the warrning creator wanted, then my PR should solve the problem
#323

@haydonryan
Copy link

Also having this issue. Can we merge this before the rewrite?

@hrhktkbzyy
Copy link

I got the same warning here.

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

4 participants