GNU bug report logs - #57854
29.0.50; Different exit code in Emacs and terminal for identical process

Previous Next

Package: emacs;

Reported by: dalanicolai <dalanicolai <at> gmail.com>

Date: Fri, 16 Sep 2022 09:41:02 UTC

Severity: normal

Tags: moreinfo

Found in version 29.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 57854 <at> debbugs.gnu.org (full text, mbox):

From: dalanicolai <dalanicolai <at> gmail.com>
To: 57854 <at> debbugs.gnu.org
Subject: some extra info from inspecting the `pdftocio` package
Date: Fri, 16 Sep 2022 12:00:09 +0200
[Message part 1 (text/plain, inline)]
When looking into the `pdftocio` package I find the following piece of code

```
    try:
        with open_pdf(path_in) as doc:
            if toc_file.isatty() or print_toc:
                # no input from user, switch to output mode and extract the
toc
                # of pdf
                toc = read_toc(doc)
                if len(toc) == 0:
                    print("error: no table of contents found",
file=sys.stderr)
                    sys.exit(1)

                if readable:
                    print(pprint_toc(toc))
                else:
                    print(dump_toc(toc), end="")
                sys.exit(0)

            # an input is given, so switch to input mode
            toc = parse_toc(toc_file)
            write_toc(doc, toc)
```

As from using `shell-command-to-string` we find that `len(toc)` must be 0
(it returns an empty string), so then it is probably the case that python
determines that some input has been given.

So maybe, even though in the `call-process` the INFILE command is set to
`nil`, still python might
determine that some kind of input is given.
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.