GithubHelp home page GithubHelp logo

Comments (3)

noembryo avatar noembryo commented on May 28, 2024

.. and the only way to silence it is to set it True like this: epub.read_epub(filename, {"ignore_ncx": True})

I think that the intention was to explicitly select whether you want it or not, and not use the default, which is False.
But, as I said it forces you to select True, otherwise you got a warning that looks really bad in a CLI.

This is because in the code, there is an
if not self.options.get('ignore_ncx'):
where it should be
if self.options.get('ignore_ncx') is None:

from ebooklib.

paotsaq avatar paotsaq commented on May 28, 2024

Huh. Thanks. This was pesky. Is this something that could be solved with a PR? At least to make the comment more clear in how to suppress the warning.

from ebooklib.

noembryo avatar noembryo commented on May 28, 2024

Huh. Thanks. This was pesky. Is this something that could be solved with a PR?

Yes, this is what the proposed change in the code does.
It's really a very simple change and that's why I just post it here instead of creating a PR.
epub.py line 1393 change
if not self.options.get('ignore_ncx'):
to
if self.options.get('ignore_ncx') is None:

At least to make the comment more clear in how to suppress the warning.

You can't suppress the warning from your app in any other way.
Only by changing the original code.

from ebooklib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.