Summary
When trying to debug pdftocio (or pdftocio) using pdb and reading the TOC from a file, pdb crashes with "ValueError: I/O operation on closed file".
Steps to reproduce
- create a TOC file "test.toc" (contents don't matter) and have a PDF
- run:
python -m pdb ${bindir}/pdftocio -t test.toc in.pdf
- from pdb, type
c
Cause
By default, the toc file is opened from sys.stdin.buffer. If a file is set with -t, stdin gets closed. pdb then tries to read from stdin to get the next command, causing the exception.
Summary
When trying to debug pdftocio (or pdftocio) using pdb and reading the TOC from a file, pdb crashes with "ValueError: I/O operation on closed file".
Steps to reproduce
python -m pdb ${bindir}/pdftocio -t test.toc in.pdfcCause
By default, the toc file is opened from
sys.stdin.buffer. If a file is set with-t, stdin gets closed. pdb then tries to read from stdin to get the next command, causing the exception.