nbxml.py 870 B

123456789101112131415161718192021222324252627282930313233
  1. """REMOVED: Read and write notebook files as XML."""
  2. from __future__ import annotations
  3. REMOVED_MSG = """\
  4. Reading notebooks as XML has been removed to harden security and avoid
  5. possible denial-of-service attacks.
  6. The XML notebook format was deprecated before the Jupyter (previously IPython)
  7. Notebook was ever released. We are not aware of anyone using it, so we have
  8. removed it.
  9. If you were using this code, and you need to continue using it, feel free to
  10. fork an earlier version of the nbformat package and maintain it yourself.
  11. The issue which prompted this removal is:
  12. https://github.com/jupyter/nbformat/issues/132
  13. """
  14. def reads(s, **kwargs):
  15. """REMOVED"""
  16. raise Exception(REMOVED_MSG)
  17. def read(fp, **kwargs):
  18. """REMOVED"""
  19. raise Exception(REMOVED_MSG)
  20. def to_notebook(root, **kwargs):
  21. """REMOVED"""
  22. raise Exception(REMOVED_MSG)