From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 09:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 57854@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166332120426294 (code B ref -1); Fri, 16 Sep 2022 09:41:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Sep 2022 09:40:04 +0000 Received: from localhost ([127.0.0.1]:41672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ7pL-0006q0-08 for submit@debbugs.gnu.org; Fri, 16 Sep 2022 05:40:03 -0400 Received: from lists.gnu.org ([209.51.188.17]:48008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ7pI-0006pU-FV for submit@debbugs.gnu.org; Fri, 16 Sep 2022 05:40:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ7pC-00051J-Pp for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 05:40:00 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:36358) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZ7oy-00056l-Og for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 05:39:50 -0400 Received: by mail-ej1-x630.google.com with SMTP id 13so19153442ejn.3 for ; Fri, 16 Sep 2022 02:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=7Bsv3RaT4Vu6y7F5akiHKqFlX65F+p+FrvHRzChGpkE=; b=RJHr1NjyS3pH8sdqlmxrB5UGlZaR4blbHMlmGM5MgVoed0lZcNTMfmpBhCDHJQb5HK FD4RGo73Eo6OSKcasWsfZK1VgEnta2gzsYniCMgRreY9/5I1aEpw+HALScSNL9OCpezt 7nSSJ1bxpec+8ivOrxfQUOwajyN2lBC1p2XemoWSDKEVoFx9XjyUBd94vcWzUDAwM7on AGrXuYlAxE4FYKPlvnc8C3HlSzfFEqTFYYv0EuKOXXIHYg84Ifz/3hqlUFvmG/R5TWEB qCzNmLEaBuxqQXg1XXsuNHMhD+Qd7xw4vAoTYdhsSHgnJjK/NV+eL7ZR0Y/cTEoyoYVx kG/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=7Bsv3RaT4Vu6y7F5akiHKqFlX65F+p+FrvHRzChGpkE=; b=dgjKl+xjhWSa7TiaBhEdodEClXbHF7ImkL/9BzVslQJ0Zc7kabRfhqAY/kaFBGq3hq bnreXYOB9Qf3QxWCIcAfCmcP0GTjZ8LV6k4J4Z3Zb2zr91Eg3KQRX/Lokbil+7PcpV6C pk1734wcCdFDdCDGCSeu7Eflr3zq+mRSP0R3sL+1Gbwf5J2ntsao5UHJiuMGnsLo7kRE Fagy1Ysc4wihs4eorY05aJMqz0MY0zXKqwbDQpoHznZM/oshx+q/M3YBfyNnnK+ZuO6s Mw8zFjV/cby2iCN5UaeDZ4HR4hJGg7N+iFBogPFWAJCMZnRRTHBBFzqrQI7wNjMl/30y WZhA== X-Gm-Message-State: ACrzQf0PRV9VS0iwSFRZ/J4bWHT+dTSvY9zoV/xkHdc+2L6+hnbzokBV wdX1/EAxt/th02koQUh2RKFTz2EOF3kVLdBuRS30W0wAY7k= X-Google-Smtp-Source: AMsMyM7V0TS7aPLpgriQe/RpPFu8kRSTRRVNfjD7WJclcEZ+7t66i12eLCcQzPDO85tG+b9I/SxLJ7PA/sjd3qbPQI4= X-Received: by 2002:a17:907:6ea2:b0:779:8fc1:e5d8 with SMTP id sh34-20020a1709076ea200b007798fc1e5d8mr2904685ejc.731.1663321176863; Fri, 16 Sep 2022 02:39:36 -0700 (PDT) MIME-Version: 1.0 From: dalanicolai Date: Fri, 16 Sep 2022 11:39:25 +0200 Message-ID: Content-Type: multipart/alternative; boundary="000000000000e4fffc05e8c8232b" Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=dalanicolai@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000e4fffc05e8c8232b Content-Type: text/plain; charset="UTF-8" Execute in the terminal the command pdftocio (see https://github.com/Krasjet/pdf.tocgen#pdftocio, the command is easily available via PyPI ) on a pdf file that does not contain a Table of Contents. The command produces an error and subsequently executing `echo $?` shows exit code 1. Subsequently, executing the same command from Emacs on the same file, then `call-process` returns a 0, and indeed `shell-command-to-string` produces an empty string. However, I would expect an error like in the terminal (with call-process returning exit code 1). The PDF in the following link could be used for testing: https://www.orimi.com/pdf-test.pdf In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) of 2022-09-10 built on fedora Repository revision: 4cf9c92e27d20da9453f9abe89d84bee5d776329 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12014000 System Description: Fedora Linux 36 (Workstation Edition) Configured using: 'configure --with-modules --with-cairo --with-native-compilation --with-json' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: DocView Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils doc-view filenotify jka-compr image-mode exif dired dired-loaddefs time-date comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode cl-loaddefs cl-lib bytecomp byte-compile cconv rmc iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 108025 17657) (symbols 48 7602 0) (strings 32 30705 1814) (string-bytes 1 939199) (vectors 16 23470) (vector-slots 8 390912 21366) (floats 8 71 19) (intervals 56 222 0) (buffers 1000 13)) --000000000000e4fffc05e8c8232b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Execute in the terminal the command pdftocio (see
=C2=A0easily available via PyPI) on= a pdf file that does
not contain a Table of Contents. The command pro= duces an error and
subsequently executing `echo $?` shows exit code 1.
Subsequently, executing the same command from Emacs on the same file,=
then `call-process` returns a 0, and indeed `shell-command-to-string`produces an empty string. However, I would expect an error like in theterminal (with call-process returning exit code 1).

The PDF in the = following link could be used for testing:
https://www.orimi.com/pdf-test.pdf


In GNU E= macs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
=C2=A03.24.34, = cairo version 1.17.6) of 2022-09-10 built on fedora
Repository revision:= 4cf9c92e27d20da9453f9abe89d84bee5d776329
Repository branch: master
W= indowing system distributor 'The X.Org Foundation', version 11.0.12= 014000
System Description: Fedora Linux 36 (Workstation Edition)

= Configured using:
=C2=A0'configure --with-modules --with-cairo --wit= h-native-compilation
=C2=A0--with-json'

Configured features:<= br>ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON=
LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG<= br>SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM
X= INPUT2 XPM GTK3 ZLIB

Important settings:
=C2=A0 value of $LANG: e= n_US.UTF-8
=C2=A0 value of $XMODIFIERS: @im=3Dibus
=C2=A0 locale-codi= ng-system: utf-8-unix

Major mode: DocView

Minor modes in effe= ct:
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 show= -paren-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode= : t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-na= me-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mo= de: t
=C2=A0 blink-cursor-mode: t
=C2=A0 buffer-read-only: t
=C2= =A0 line-number-mode: t
=C2=A0 indent-tabs-mode: t
=C2=A0 transient-m= ark-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mo= de: t
=C2=A0 auto-compression-mode: t

Load-path shadows:
None = found.

Features:
(shadow sort mail-extr emacsbug message mailcap = yank-media puny rfc822
mml mml-sec password-cache epa derived epg rfc606= 8 epg-config gnus-util
text-property-search mm-decode mm-bodies mm-encod= e mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rf= c2045 ietf-drums
mm-util mail-prsvr mail-utils doc-view filenotify jka-c= ompr image-mode
exif dired dired-loaddefs time-date comp comp-cstr warni= ngs icons subr-x
rx cl-seq cl-macs gv cl-extra help-mode cl-loaddefs cl-= lib bytecomp
byte-compile cconv rmc iso-transl tooltip eldoc paren elect= ric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/= x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt = fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode r= egister
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select<= br>scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
= frame minibuffer nadvice seq simple cl-generic indonesian philippine
cha= m georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
kor= ean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
europea= n ethiopic indian cyrillic chinese composite emoji-zwj charscript
charpr= op case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-pre= loaded button loaddefs faces cus-face macroexp files window
text-propert= ies overlay sha1 md5 base64 format env code-pages mule
custom widget key= map hashtable-print-readable backquote threads dbusbind
inotify dynamic-= setting system-font-setting font-render-setting cairo
move-toolbar gtk x= -toolkit xinput2 x multi-tty make-network-process
native-compile emacs)<= br>
Memory information:
((conses 16 108025 17657)
=C2=A0(symbols 4= 8 7602 0)
=C2=A0(strings 32 30705 1814)
=C2=A0(string-bytes 1 939199)=
=C2=A0(vectors 16 23470)
=C2=A0(vector-slots 8 390912 21366)
=C2= =A0(floats 8 71 19)
=C2=A0(intervals 56 222 0)
=C2=A0(buffers 1000 13= ))


--000000000000e4fffc05e8c8232b-- From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: some extra info from inspecting the `pdftocio` package References: In-Reply-To: Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 10:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166332242810179 (code B ref 57854); Fri, 16 Sep 2022 10:01:02 +0000 Received: (at 57854) by debbugs.gnu.org; 16 Sep 2022 10:00:28 +0000 Received: from localhost ([127.0.0.1]:41730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ896-0002dT-9c for submit@debbugs.gnu.org; Fri, 16 Sep 2022 06:00:28 -0400 Received: from mail-ej1-f41.google.com ([209.85.218.41]:40865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ894-0002Gs-5C for 57854@debbugs.gnu.org; Fri, 16 Sep 2022 06:00:26 -0400 Received: by mail-ej1-f41.google.com with SMTP id l14so48270539eja.7 for <57854@debbugs.gnu.org>; Fri, 16 Sep 2022 03:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=mvI9S1EHSiOXxLftawz/QWcHstTQwJKVGvzziziaPwU=; b=LPaOWTLqtMqFSisvPJBnX7eSweEvCRXDVJ3mnowtouN+Zm2sENbUkl3X0bOUOdkeYz GuUwFsr6a79BE8bUEji67n+bxnZcV/Vjtqvhbd7BAYPk8WDVhfTri5OI3mFSqi1HUQNR +wD3ekp3doOK9K/gza9pm0RsNdnXh9TWVohccePhnCkmL5hEtQsP9ujBR8b+cb8bk8QD nZcvmjVGOiXWwA7mxIdrbXSqA2580C1/V0iaLd1EfiyIzzkZcWz93HE7vogj/rhHA6hH x3oW3vgup+PJgFVQ+BEXznG/te6oBfrwQK9T2HrZl6sbotlb8Tvab2VBi+kFKYggJiSd X9cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=mvI9S1EHSiOXxLftawz/QWcHstTQwJKVGvzziziaPwU=; b=zPet4X2Jsqp0eWb4aU3msAJ0mg+z0Ia759C5Mq/Bldo7XtDw20aPwoOcTzeagYM3Sv kGsmd1x9fjjeIQo7hdEcS7dE5T0TMVduIfaWbB3bPec4wGp2d/snWPtNLA/LWMj5JgPa vEz6NAa7MOsc/vNk29WbiepsIffvAhlEXlplUoa1bm8hylKTjZVP88rLGBdhzTY5E1Fc wDIG0S9TpS12F2S95DLmJqs0Q/Gdnk7t5QJXKLzMHAsOOpAif6M4ISbGYciks6ctCmMe ffi9ayyM/KYP+M+rd1PcWTeqJZs1oBxuTYzHgeALdOkLH2zct52p2LBq6jLHE6CKFPq2 WEgQ== X-Gm-Message-State: ACrzQf3sm8yFSkPI4y8Y5Le6N/7m5y9m+90g0WUtDz9V7cxXpAH1jBZZ X2LfQ8yeckld8pXIIc1azxH8cPYZnJd86W8pWFsmI3un//g= X-Google-Smtp-Source: AMsMyM6VUU6jqRljQQ1DlfPwZVINdH07K99XFC87DmsT5+A3+ZvpXwiBw2hb0WaQuOsrxPFAZMfv4Ybm46Gv6dTICT4= X-Received: by 2002:a17:906:7945:b0:73b:e605:f31 with SMTP id l5-20020a170906794500b0073be6050f31mr3077202ejo.129.1663322420329; Fri, 16 Sep 2022 03:00:20 -0700 (PDT) MIME-Version: 1.0 From: dalanicolai Date: Fri, 16 Sep 2022 12:00:09 +0200 Message-ID: Content-Type: multipart/alternative; boundary="00000000000002c07105e8c86e94" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000002c07105e8c86e94 Content-Type: text/plain; charset="UTF-8" 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. --00000000000002c07105e8c86e94 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When looking into the `pdftocio` package I find the f= ollowing piece of code

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

=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if readable:
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print(pprint_to= c(toc))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 prin= t(dump_toc(toc), end=3D"")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 sys.exit(0)

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

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

So m= aybe, even though in the `call-process` the INFILE command is set to `nil`,= still python might
determine that some kind of input is given.

--00000000000002c07105e8c86e94-- From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: Test result to previous suggestion References: In-Reply-To: Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 10:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166332277613557 (code B ref 57854); Fri, 16 Sep 2022 10:07:02 +0000 Received: (at 57854) by debbugs.gnu.org; 16 Sep 2022 10:06:16 +0000 Received: from localhost ([127.0.0.1]:41761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8Ei-0003Wb-Jh for submit@debbugs.gnu.org; Fri, 16 Sep 2022 06:06:16 -0400 Received: from mail-ej1-f42.google.com ([209.85.218.42]:42564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8Eh-0003WP-Ib for 57854@debbugs.gnu.org; Fri, 16 Sep 2022 06:06:15 -0400 Received: by mail-ej1-f42.google.com with SMTP id sb3so18651709ejb.9 for <57854@debbugs.gnu.org>; Fri, 16 Sep 2022 03:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=YH0OUZGnbyoA+nzjel29z8Z5WNjwmgTG6U7PnJVmQgw=; b=PGNxlL50+YsoOoXjauSxJH5EjCNdzWmVB9SdtSkFJUs2NkYkLrgHwtNOobyQuIldd2 Q2w/94nxZhNcfgX26NICfR1YTrHRu1HRA8a/47gQAb+QjFPFVBUD3m5XVVqZbB9hk0Q1 x2Veaes5+vkK+tYpeqMjOCDwgR4PwkIpsPzgyUMGr658pYd8aZbZ5sbZ9DdFa/vymPmc Bo6Cg1hitFVuy3UyRB2NdFzwBr8a29E6065Fmv/AGdM5TvmH//DsytacQxw41ky2XQHc 4RGy39GUxnOOsE+5gogNYo5PBoHqql5rqs4K2371Ma3tcCKqSY8Uwnv4BZP84zXYH3Qo wjew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=YH0OUZGnbyoA+nzjel29z8Z5WNjwmgTG6U7PnJVmQgw=; b=p8WcLhkYMWVZwJZ26Qhb4TMrtMSf+MbqTgcd2vvcpB8nhCFFO2cakDOOro1NmncnvM O6KKhJqgs8lPLdQcUJIfpM9bxnmawfGoe5ztqbsenJPNbGzLtv/Ca0mtSkBH1O5Ag+XW pmNI64v3Wf14jLoTGiWLDhUc4wDTA8bdfVArwqVnghWyQ5ZirQaaMC1C/QKUddqmn1WS Ona5vwLKQS4kvnpdRRBNSwtf9YWcdvu9dyXy1E6+sXmX3/rMlaCXQvlMoAT4wNaoWa7k UD2qbfb17IeXiAcoo2LMU8l/p2K11NTwK6RwP0+G+jaPkRRl8SS413TcCVnnQsVxLAj9 z93Q== X-Gm-Message-State: ACrzQf2F4RXER0i0T7AgtCKYYwGlQoV8HbK7Y0FswgpiGAFErXKJ5FCe krtUdaJmS1Fg5pdY6XV83ipiu9nxQgd4D/XDOs7XMjpqCyk= X-Google-Smtp-Source: AMsMyM6KIQe0ZDVn9GvDkUQZBcr6REZf8nzQiY/BiU2AtE10n+T95P/Lx1AohlTpWbpMkaol6h3odEbVQvtPv41sV68= X-Received: by 2002:a17:906:5d11:b0:780:bf2d:6d14 with SMTP id g17-20020a1709065d1100b00780bf2d6d14mr152572ejt.543.1663322769441; Fri, 16 Sep 2022 03:06:09 -0700 (PDT) MIME-Version: 1.0 From: dalanicolai Date: Fri, 16 Sep 2022 12:05:58 +0200 Message-ID: Content-Type: multipart/alternative; boundary="000000000000d1c7cc05e8c882fc" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000d1c7cc05e8c882fc Content-Type: text/plain; charset="UTF-8" In my previous message, I suggested that python might determine that some input was given. I have tested it now by letting the command print a message in case input was determined, and indeed, while the terminal still produces the error, using `shell-command-to-string` now returns the printed message. So I guess the 'hypothesis' was correct. --000000000000d1c7cc05e8c882fc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In my previous message, I suggested that python might= determine that some input was given.

I have teste= d it now by letting the command print a message in case input was determine= d,
and indeed, while the terminal still produces the error, using= `shell-command-to-string` now
returns the printed message. So I = guess the 'hypothesis' was correct.
--000000000000d1c7cc05e8c882fc-- From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: good to know References: In-Reply-To: Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 10:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166332313914161 (code B ref 57854); Fri, 16 Sep 2022 10:13:01 +0000 Received: (at 57854) by debbugs.gnu.org; 16 Sep 2022 10:12:19 +0000 Received: from localhost ([127.0.0.1]:41778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8KZ-0003gL-46 for submit@debbugs.gnu.org; Fri, 16 Sep 2022 06:12:19 -0400 Received: from mail-ed1-f53.google.com ([209.85.208.53]:44717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8KX-0003g7-E0 for 57854@debbugs.gnu.org; Fri, 16 Sep 2022 06:12:17 -0400 Received: by mail-ed1-f53.google.com with SMTP id x94so13476098ede.11 for <57854@debbugs.gnu.org>; Fri, 16 Sep 2022 03:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=1ptpFB5QK6Q96x7W/tX91lvSKVr9ZVQs+daPw+g1B9Q=; b=ppJUkClyfFD9t5gghSIzmb8yx8VALThSXLWrEDrMogPbVndEZqYXILRjqgz7Gy6fH+ o02znukkeLZKeJZnOppR9ZwOvg1plU8LiTzt7YolNYzNoulIa3cY1/2b6oGHiYNEH6Gb GOF21QCnzsTSRyZYcD/9GnB0Ktv/mnTaiomFFHX8mSDQeKGyOYiYCl4GsEey2sY7rCzR n/n98mi8lDZ3WrsrqdYZXXORR3TQrjQ/2FeicMilsXh0nqIQ7U0L96D82/mlKfciZyQM uVVSzU4yqgrZmdznX7SG4m8LEvYRQDZSubEv5tDtzF9iYGcCpBasu5VsTNM3cmmI1Qkq KbbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=1ptpFB5QK6Q96x7W/tX91lvSKVr9ZVQs+daPw+g1B9Q=; b=QlQaL9EmBsDjrFN5JLjsMGS3Ao6tpxq/ExLji2BqVWBvKUNN9kzUfa1+7tfIdbHrT8 dybELR9M1tXVE9S3APfEFyvnl7PDklm6uKEeyNMgVmSrEUUa6yv46hduaULmkzfnhG5V 6odRuTAHZFEMsOxKN/4RA2lqolYzE/wSR327Z4K2f5k2+qBK3VjsU+4a4TDqk6FtzhAB Xe+P/HQDJX5dffbS3Qd4ucM7Y9LVYT3YOmbQLH89PoPImuAPltOnehB0MTTKvfSAwmXc ajh/5CWeYIS0gjpC5u8DLnXax2JEzdCujrVlBCOIngck9CSdZLuVyPwYwQRjGp+tKhZy NLLA== X-Gm-Message-State: ACrzQf0f/VuBrhywcScSOxQ8EqzEKNvOunTck3hI+1Zt9HW5mdP55rgj e9eh/D/LXkjzal1XNnF54cBgL7lg7qx8yHMmPEXORm6hZUw= X-Google-Smtp-Source: AMsMyM5Gyt8ftuHuJ9PPktt6hNzAf8kY7XeqVa8GmQj/gNT4PWp0fnExz7XTCEDmXpO1TIwOZPbW7YrmQeM/l3sTf/U= X-Received: by 2002:a05:6402:3508:b0:451:db83:b2a7 with SMTP id b8-20020a056402350800b00451db83b2a7mr3431462edd.266.1663323131601; Fri, 16 Sep 2022 03:12:11 -0700 (PDT) MIME-Version: 1.0 From: dalanicolai Date: Fri, 16 Sep 2022 12:12:00 +0200 Message-ID: Content-Type: multipart/alternative; boundary="00000000000067e7a705e8c898d2" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000067e7a705e8c898d2 Content-Type: text/plain; charset="UTF-8" Just to make it clear the command should work as follows: if the command is called with only 1 argument (a filepath) then the command should print the table of contents however when some 'table of contents' data file is given as 'INFILE' as follows pdftocio [options] in.pdf < toc then the command should add the TOC to the pdf file. So what seems to happen is that, even when INFILE in `call-process` is nil, still python determines that some (empty) `TOC` file is given as input. --00000000000067e7a705e8c898d2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Just to make it clear the command should work as foll= ows:

if the command is called with only 1 argument= (a filepath) then the command should print the
table of contents=

however when some 'table of contents' dat= a file is given as 'INFILE' as follows

pdf= tocio [options] in.pdf < toc

then the command s= hould add the TOC to the pdf file.

So what seems t= o happen is that, even when INFILE in `call-process` is nil, still python
determines that some (empty) `TOC` file is given as input.
--00000000000067e7a705e8c898d2-- From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 10:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: dalanicolai Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166332455625423 (code B ref 57854); Fri, 16 Sep 2022 10:36:01 +0000 Received: (at 57854) by debbugs.gnu.org; 16 Sep 2022 10:35:56 +0000 Received: from localhost ([127.0.0.1]:41809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8hQ-0006bz-Iw for submit@debbugs.gnu.org; Fri, 16 Sep 2022 06:35:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8hM-0006bk-SS for 57854@debbugs.gnu.org; Fri, 16 Sep 2022 06:35:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57342) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ8hH-00038e-Kn; Fri, 16 Sep 2022 06:35:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=eQnepB4ri/w18v07K6bVXI3TQ5y5CdlzBTCWKN9v3H4=; b=fyRfqCWXTGXv wjiVGheRXc9vaVev+IieBPScWj3fKmeP4exPzJw40Sdrsbh5GiEbN87XjjM/dMxTiO+4MVh5e6UW0 PkwTgEvltf7Qaub4f3iQAOgLqoxePemSYt+DvD986e+hWbohEIVIOVNuVZWcFFRf4RbfbKGhkbqoX b88zKALGjpY17UqwaJSCLotl5VICMh04N3nmEsiILaenCkTu0xfQhlDmjC9UimNYZU7ZiapjNGwhb BeOR41n537qQGBtXVXIzutC8HaSO5mn3wBZiNfp5O4DnNIgVW+lnJl+lW7zU0MHMKqQLlnmGtSJ4e tLJRy4gDn/VbE6lbX+CUOw==; Received: from [87.69.77.57] (port=3555 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ8hG-0006DS-TV; Fri, 16 Sep 2022 06:35:47 -0400 Date: Fri, 16 Sep 2022 13:35:40 +0300 Message-Id: <83h7174ner.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from dalanicolai on Fri, 16 Sep 2022 11:39:25 +0200) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: dalanicolai > Date: Fri, 16 Sep 2022 11:39:25 +0200 > > Execute in the terminal the command pdftocio (see > https://github.com/Krasjet/pdf.tocgen#pdftocio, the command is > easily available via PyPI) on a pdf file that does > not contain a Table of Contents. The command produces an error and > subsequently executing `echo $?` shows exit code 1. > > Subsequently, executing the same command from Emacs on the same file, > then `call-process` returns a 0, and indeed `shell-command-to-string` > produces an empty string. However, I would expect an error like in the > terminal (with call-process returning exit code 1). Please show the Lisp code you used to invoke call-process in this case. Thanks. From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: some extra info from inspecting the `pdftocio` package Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 10:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: dalanicolai Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166332479625791 (code B ref 57854); Fri, 16 Sep 2022 10:40:01 +0000 Received: (at 57854) by debbugs.gnu.org; 16 Sep 2022 10:39:56 +0000 Received: from localhost ([127.0.0.1]:41820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8lH-0006hu-L7 for submit@debbugs.gnu.org; Fri, 16 Sep 2022 06:39:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8lE-0006he-K9 for 57854@debbugs.gnu.org; Fri, 16 Sep 2022 06:39:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ8l7-0003um-UV; Fri, 16 Sep 2022 06:39:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=4wrBYkl/sFGBH5+AW5PQVvIliyucmTQq/rVS4z6bm8A=; b=gT+vgeTfW0LF U10i4CPrPa69kjssbdWYF2O2tVtu43PUEAWv7na9QvpreI6TXereo9e76urqdPmnsojcq7goQ8BbL K+mj5RjAkXWvM7lg15ZtmSwnrIVK0nGDUzhJM2CJKHI7DPiHUXiDahIwydYZR5sZbn8haPAnpVOQB UmYeWy+SijndZJIlMwlHrK2XYgr4ah/ipAyiWCGDDP3edbQaX3ENAcG/eWbey8PACbNR0uUZPXkPY N+WcIr2Z06AzN4Wee2E/Ty8c3h7gDTcWJi6LIbVUhPvSUQZXk4vbOPTUJUvjySeqL0EzwPKlC5BaC sJWAnxk6tSBVa2jLbhq5Aw==; Received: from [87.69.77.57] (port=3798 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ8l7-0002IL-1v; Fri, 16 Sep 2022 06:39:45 -0400 Date: Fri, 16 Sep 2022 13:39:38 +0300 Message-Id: <83fsgr4n85.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from dalanicolai on Fri, 16 Sep 2022 12:00:09 +0200) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) When responding to a bug report, please NEVER ever change the Subject line. If you do that, it makes it harder to follow the discussion, and can even start a new bug report in some cases. Please always use the original Subject line. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 16 06:40:51 2022 Received: (at control) by debbugs.gnu.org; 16 Sep 2022 10:40:51 +0000 Received: from localhost ([127.0.0.1]:41824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8mA-0006jz-Vj for submit@debbugs.gnu.org; Fri, 16 Sep 2022 06:40:51 -0400 Received: from quimby.gnus.org ([95.216.78.240]:44486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8m8-0006ji-Dj for control@debbugs.gnu.org; Fri, 16 Sep 2022 06:40:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+mYvG8LqRwgTxRcohy/k5vE9FN7T5/lX1pbk2lRdBZM=; b=o/IUtgPEpFTLgEBzYjge19QUTB xzdxE0truKslacmqUEU8rUoOK1Ng9KKIQnevh2nMXkxSgRJ7dX0tQPlsnJTSb1b7rCBgXt+zykqjs FeEUTTw+NKndqKmUV9MlUVAnDZkYqjmSAZ82+Vbg03ugqEhOpjr9z7xGCCMZuhRiVpZ8=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oZ8lz-0003BX-Tw for control@debbugs.gnu.org; Fri, 16 Sep 2022 12:40:41 +0200 Date: Fri, 16 Sep 2022 12:40:39 +0200 Message-Id: <875yhnwqjc.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #57854 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 57854 + moreinfo quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 57854 + moreinfo quit From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 10:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: dalanicolai Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.16633252062666 (code B ref 57854); Fri, 16 Sep 2022 10:47:02 +0000 Received: (at 57854) by debbugs.gnu.org; 16 Sep 2022 10:46:46 +0000 Received: from localhost ([127.0.0.1]:41876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8ru-0000gw-8P for submit@debbugs.gnu.org; Fri, 16 Sep 2022 06:46:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8rs-0000gj-Ol for 57854@debbugs.gnu.org; Fri, 16 Sep 2022 06:46:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ8rn-0005XK-Is; Fri, 16 Sep 2022 06:46:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=LjxN6CDaQJzN2YwdKJK3hqQefAlgXkjBAsnB3j+InY4=; b=cHaZLKx33GKL r8Kq10qhRg64qaUeuP+IMDwgIZBpfEH9j7ms2K8oGksG+VvNE8HX7qFvDpcYM6WB7cE3HDe6p/gq0 htwg+/q6L5LQ61IIixnVprPfW91fQ3VhWIk2DzM7OhXXwHWPjluZHKCz8bBut0BKkDFwp5kaKrCpm 9sW2uYrH0ArDtArHXE61TIybwiJrshmE8/3qvIBcVL3geOoCix8FtzYcai+mq2pjH49nSx1IqOz+U RcdXkruVSNSPhJWfcFXx5lfkpYkOL5i17jXm2FDEBXHkGk4GH6S5JyKitXff1Dg63/LLxo4LWIXAT 902lEoyN+qra3ZE/mStjBA==; Received: from [87.69.77.57] (port=4220 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ8rm-0001ha-MH; Fri, 16 Sep 2022 06:46:39 -0400 Date: Fri, 16 Sep 2022 13:46:32 +0300 Message-Id: <83bkrf4mwn.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from dalanicolai on Fri, 16 Sep 2022 12:12:00 +0200) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [Note that I resurrected the origina Subject of your bug report.] > From: dalanicolai > Date: Fri, 16 Sep 2022 12:12:00 +0200 > > So what seems to happen is that, even when INFILE in `call-process` is nil, still python > determines that some (empty) `TOC` file is given as input. Emacs connects standard input to the null device in such a case. From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 11:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: dalanicolai Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.16633260364158 (code B ref 57854); Fri, 16 Sep 2022 11:01:02 +0000 Received: (at 57854) by debbugs.gnu.org; 16 Sep 2022 11:00:36 +0000 Received: from localhost ([127.0.0.1]:41896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ95H-000150-R2 for submit@debbugs.gnu.org; Fri, 16 Sep 2022 07:00:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ95F-00014e-4i for 57854@debbugs.gnu.org; Fri, 16 Sep 2022 07:00:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ958-0002Ou-Qc; Fri, 16 Sep 2022 07:00:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=eCavIAB4Ff6lMZSgmJQLTpK9QO7mpnDnsmhxvmnUFEM=; b=amemJljjlm2N JKaCo60UEJMlAvWmYO/gV66E7zAFjW20k9Eta8uZLhlGxY1c5k839HfZdA4OVrpJeXpE9YYtzwOAk VaDWUrKwsigojIoL3i/3nAhyvX2dLL4m0Zr+eTGkJKI6KZVrrzNKgTAsyxDZYHWH72BkPHCJzgKTT fK9JT8yujsHZCTVR35cCFZDb1ZlYY9IvvF5VmB+6gCWY6O9/+dgsm3dp5ryGlr1iacyzxTN7hdrR7 DM1i0w9gYWtO1lEW4ZC7ENJWBIGkkeDB22rnPXFJwlFKjhVo90oCvNWJYzoqxbQAtM8wYb53Rhk9A eSaK7WZxrwA7GOnygDySmQ==; Received: from [87.69.77.57] (port=1181 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ957-00036z-9L; Fri, 16 Sep 2022 07:00:26 -0400 Date: Fri, 16 Sep 2022 14:00:19 +0300 Message-Id: <83a66z4m9o.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from dalanicolai on Fri, 16 Sep 2022 12:00:09 +0200) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: dalanicolai > Date: Fri, 16 Sep 2022 12:00:09 +0200 > > 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) > ``` Note that the above distinguishes between TTY and non-TTY input, and call-process works via the non-TTY case, AFAIU. So maybe what you see is entirely expected? From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: some extra info from inspecting the `pdftocio` package Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 19:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: Eli Zaretskii Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166335581116179 (code B ref 57854); Fri, 16 Sep 2022 19:17:02 +0000 Received: (at 57854) by debbugs.gnu.org; 16 Sep 2022 19:16:51 +0000 Received: from localhost ([127.0.0.1]:44376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZGpX-0004Ct-I5 for submit@debbugs.gnu.org; Fri, 16 Sep 2022 15:16:51 -0400 Received: from mail-ej1-f41.google.com ([209.85.218.41]:41795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZGpR-0004Cb-VF for 57854@debbugs.gnu.org; Fri, 16 Sep 2022 15:16:50 -0400 Received: by mail-ej1-f41.google.com with SMTP id kr11so5516564ejc.8 for <57854@debbugs.gnu.org>; Fri, 16 Sep 2022 12:16:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=1MITxMWYBi/4xckMYA2MtUtYsSlsmmb1J+yL1XnVT54=; b=folIIeaJrymTCCJwEauR3qrba/qjCkrir4xE844NL/sRcAMoZNEvXCQGUB1tOJuGSL haKpGiW5uEjIODlZr9cnkhfO7kWMdtvbFZiTApGfFW/SQxxwk9LFIkSjDyTqBxyS5fDj Ou2PdO3YY2gGvUO6yD3XpcIOgOyb1gN9f1TEBXXzHw5Y0N0WCH8bb2jEymOcW0L5olX6 AfzdYFJSw+w83L79jwWrOrbGabNddJtlxhLQieUBCMryPbgPDTcIGrRle+Y6UEw89dqt Z5dLqWcimc5ir9cKtA9aEhYogDNsigqwXreq4QZxqSQDmRsLa4Iy0ui1aWY7Toj99DrF +4rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=1MITxMWYBi/4xckMYA2MtUtYsSlsmmb1J+yL1XnVT54=; b=lriQU7vTTy2whKMz+gTMQLkCUuvIxod2qqGvNQwhU8je7Rc4Wsph1rKrE8iz5pMz30 lhTF/LueqAuRUY3Tmi9goA8TKUsta7XysBfEsPyls1t5EAw1eWjRbfAqqrD5CzgdU+Sh +HMz70Fh2nR4AkuMbGORR/m19Bz/idZY/7Lopl77qp8rIErLDoHzvXGZwPyXiabkqktY wHY6cidOtasOOjkDCpjAljdRPdaOCVC7+uxHF99aFR4YgI2h9JPN36v/xlVHUSFak1Sg HK+RwtA1Ct30fERn9X/DwYbrkJLAMyY2LJl3kzXswI7ajtsU9fnUZKKjuzjCOsfGvHSl bORg== X-Gm-Message-State: ACrzQf2V0A+t2NV6yPD2ARok7zGcI8ZK/w/Q/s+NV4mMqzaERVTIqJGY sbCj2OQLT/lZXWrvV8PspjyFswJvbUALS4yzE9s= X-Google-Smtp-Source: AMsMyM7PPct3zeOWONbuvUwQomrUvJPfbLAnbpf9btPHd9y99JO3MketDNxKvmwG/ywrwsqsQ89Jrl4nKWJOHYvNPig= X-Received: by 2002:a17:907:6ea2:b0:779:8fc1:e5d8 with SMTP id sh34-20020a1709076ea200b007798fc1e5d8mr4452442ejc.731.1663355799148; Fri, 16 Sep 2022 12:16:39 -0700 (PDT) MIME-Version: 1.0 References: <83fsgr4n85.fsf@gnu.org> In-Reply-To: <83fsgr4n85.fsf@gnu.org> From: dalanicolai Date: Fri, 16 Sep 2022 21:16:28 +0200 Message-ID: Content-Type: multipart/alternative; boundary="0000000000008b26e005e8d033bf" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000008b26e005e8d033bf Content-Type: text/plain; charset="UTF-8" Thanks! Will do that... On Fri, 16 Sept 2022 at 12:39, Eli Zaretskii wrote: > When responding to a bug report, please NEVER ever change the Subject > line. > > If you do that, it makes it harder to follow the discussion, and can > even start a new bug report in some cases. > > Please always use the original Subject line. > --0000000000008b26e005e8d033bf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks! Will do that...

On Fri, 16 Sept 2022 at 12:39, = Eli Zaretskii <eliz@gnu.org> wrot= e:
When respondi= ng to a bug report, please NEVER ever change the Subject
line.

If you do that, it makes it harder to follow the discussion, and can
even start a new bug report in some cases.

Please always use the original Subject line.
--0000000000008b26e005e8d033bf-- From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: Eli Zaretskii Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166335657517286 (code B ref 57854); Fri, 16 Sep 2022 19:30:02 +0000 Received: (at 57854) by debbugs.gnu.org; 16 Sep 2022 19:29:35 +0000 Received: from localhost ([127.0.0.1]:44381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZH1q-0004Uk-RR for submit@debbugs.gnu.org; Fri, 16 Sep 2022 15:29:35 -0400 Received: from mail-ed1-f43.google.com ([209.85.208.43]:43969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZH1o-0004UW-Es for 57854@debbugs.gnu.org; Fri, 16 Sep 2022 15:29:33 -0400 Received: by mail-ed1-f43.google.com with SMTP id y8so26040483edc.10 for <57854@debbugs.gnu.org>; Fri, 16 Sep 2022 12:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=fuz6UmDaI1k5nco8yXb+rP6+zbAKeQwHLCfR+R6ynBc=; b=oDLL7Zd498NH2QpFPNV47A1k6hBaKIqWGJQa4cDwiFda4zNDCt99mKaaZ2lIVlTyr1 SiVJblB5R+6tsFmMFjsbeffe+q5mY2XJadW7dhDZ/OpQE7hw1X6yoQZsf5uH8YqgNWNS r8cnjElaCz5VfPNMhdSIXXNtidcvUa83wIP6gyvcg/ea+rfqnVr6LhA/uClb9MWcaFUK xT1WcvqiglSoNFzcrApX1NTi6D2YL9O9kozcLcQ7WufH1xagQYWwcgbMP8Y37yRefYR5 IMtQ2q1sOMcTkM+sSxYy8zFFsfEZxqfnMKQ0mCt8+VnbPzPKrcUKBWUTALGWF9gkV70e ZAWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=fuz6UmDaI1k5nco8yXb+rP6+zbAKeQwHLCfR+R6ynBc=; b=5Jgla/cl0LrbQJJSih9bKE/eclsU0NnX2xQID7FTr0yQYSXjRfNbPsSLJX82K/+cpi qnnJYuVp01hgEaMlsHM0MzeSRvym0d0R+veqeBpB7nEtbRsBamr5CO24h5p3zzz5c3L2 f5Ewt+zJzdewbqmS9Vcag72LM5GOflCloKiVDIZn/MUuFf0X1cBQEzrItmMUt0RFif+7 TlQKadmwXqBD9CS39ZRsjnpQBA8h7U2QCB//xFNY6LPC4gwSUkBjWj19NAZdQTTr0AJ3 njOF0OI3CNx8YhqHYJ4l7EpJjab2Xks2dSrnHrS8WXAIUhIwNw4goGVUHhbw7/QkfXsq WxLA== X-Gm-Message-State: ACrzQf3hEedS0EzO2v0fiX4DYFHIsIckEZR9IkLBy3q7+6SfbkYh/ncw s5pJpmjMGNtqcJx/wVpbOjrdu5ZcYto+o42Rw6MQKP7h X-Google-Smtp-Source: AMsMyM7Z+G9dDhdbYnXd1bF/HBjBk2QqNvNQpPdlZctW1dUIqdY2VB5ffC7hMSI2LYWkG1nagQYVkabhSDlwG2NLk4M= X-Received: by 2002:a05:6402:350a:b0:452:8c84:8b with SMTP id b10-20020a056402350a00b004528c84008bmr5297163edd.93.1663356566443; Fri, 16 Sep 2022 12:29:26 -0700 (PDT) MIME-Version: 1.0 References: <83a66z4m9o.fsf@gnu.org> In-Reply-To: <83a66z4m9o.fsf@gnu.org> From: dalanicolai Date: Fri, 16 Sep 2022 21:29:15 +0200 Message-ID: Content-Type: multipart/alternative; boundary="000000000000471c6905e8d0610b" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000471c6905e8d0610b Content-Type: text/plain; charset="UTF-8" I don't understand the answer well (my knowledge about computers is very limited), i.e. I do not immediately understand what it means for a file to be a tty. But also, I think the isatty() is about the TOC file, i.e. the file given as INFILE (after the `<`) But I am not giving any INFILE (which would make the command add the TOC to the file given as argument), Instead I simply provide a single filepath as argument so that the command simply prints the TOC. (I hope this answer makes sense, I might be misunderstanding something) On Fri, 16 Sept 2022 at 13:00, Eli Zaretskii wrote: > > From: dalanicolai > > Date: Fri, 16 Sep 2022 12:00:09 +0200 > > > > 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) > > ``` > > Note that the above distinguishes between TTY and non-TTY input, and > call-process works via the non-TTY case, AFAIU. So maybe what you see > is entirely expected? > --000000000000471c6905e8d0610b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I don't understand the answer well (my knowledge = about computers is very limited),
i.e. I do not immediately under= stand what it means for a file to be a tty.

But al= so, I think the isatty() is about the TOC file, i.e. the file given as INFI= LE (after the `<`)
But I am not giving any INFILE (which w= ould make the command add the TOC to the file given as argument),
Instead I simply provide a single filepath as argument so that the command= simply prints the TOC.

(I hope this answer makes = sense, I might be misunderstanding something)

On Fri, 16 Sept 2022= at 13:00, Eli Zaretskii <eliz@gnu.org> wrote:
&g= t; From: dalanicolai <dalanicolai@gmail.com>
> Date: Fri, 16 Sep 2022 12:00:09 +0200
>
> When looking into the `pdftocio` package I find the following piece of= code
>
> ```
>=C2=A0 =C2=A0 =C2=A0try:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0with open_pdf(path_in) as doc:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if toc_file.isatty() or= print_toc:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# no inpu= t from user, switch to output mode and extract the toc
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# of pdf<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0toc =3D r= ead_toc(doc)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if len(to= c) =3D=3D 0:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0print("error: no table of contents found", file=3Dsys.stder= r)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0sys.exit(1)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if readab= le:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0print(pprint_toc(toc))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0print(dump_toc(toc), end=3D"")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sys.exit(= 0)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# an input is given, so= switch to input mode
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0toc =3D parse_toc(toc_f= ile)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0write_toc(doc, toc)
> ```

Note that the above distinguishes between TTY and non-TTY input, and
call-process works via the non-TTY case, AFAIU.=C2=A0 So maybe what you see=
is entirely expected?
--000000000000471c6905e8d0610b-- From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 19:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: Eli Zaretskii Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166335751318863 (code B ref 57854); Fri, 16 Sep 2022 19:46:02 +0000 Received: (at 57854) by debbugs.gnu.org; 16 Sep 2022 19:45:13 +0000 Received: from localhost ([127.0.0.1]:44413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZHGy-0004uA-C3 for submit@debbugs.gnu.org; Fri, 16 Sep 2022 15:45:12 -0400 Received: from mail-ej1-f50.google.com ([209.85.218.50]:36513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZHGw-0004tv-9t for 57854@debbugs.gnu.org; Fri, 16 Sep 2022 15:45:11 -0400 Received: by mail-ej1-f50.google.com with SMTP id 13so22763274ejn.3 for <57854@debbugs.gnu.org>; Fri, 16 Sep 2022 12:45:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=+8fKIymEw3XO5QYFSpWXKRzShi9CERgQyUNLirVKL1A=; b=psF1q6SRKkgn4hHgwr3dNPwncTAWfC0yCD+4pWeKFTlVL499O1zMNS9dnyBVmh42kE 1sgbp3AQimMZvDew7j3+7DdMwUNfuP3g/WE9bplaUT7qkZbdQInqnlzHvcykEvj/EPZN NTXn96+4ypB2ttZGtootLmuxL/RXdiZoYEmMb2ukdw1i/Jn0s7Vcw1NUHY+hehrlJi44 8QUa6NdEyyyXxCHlnebAgfy26KEwgapCFvcl1pHoXkkOf+80y+xS3gXYgArlVn34XDW6 doHYymEZBd+043veUvrT4o5dOFFw++ZZ4VYPkVK508GhaTI2rlaVP1J8DYGbtu2Y+0YH DUvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=+8fKIymEw3XO5QYFSpWXKRzShi9CERgQyUNLirVKL1A=; b=GmaBb1K7JFUpIco9mYE+sTeFR0767qsj3K4GzuQxpYPpA+DoAhaOuxeqtazuiZBbs5 6DuvOT1Wl50PK2KRog7kYmWsR2N5ek7V8VpXhjWF10uAOHFfVXMKdJGgVgF3l5ad9QmE Je7Fh3kLkOcDhOxWzQ3AMScrwveG5KjkEO1Rag4SXRQgV6ot0h8KvgQ3gOT3myAwsQAv zkcBkN5Tt50gWIQNKEGo+S54HUSiyIne43X6SQFb5BPWjcJAnUFdlht2u4tFVTr2n3Ri bTEd2jxVNh4ZA6ZjgjyH1JeCvi96c11vZWYyk6/xzJKaVVFL1UIXlKwev65XMhAm1lLd 8pug== X-Gm-Message-State: ACrzQf2vcuCH4Cu9HwsKXowuqOuV0ntXrP9GbmDPrpJMvDCQVxNhl5d2 ChchpjPaB3PGQyut1RYq2l0pXgRvh9HqpenicBc= X-Google-Smtp-Source: AMsMyM7ThjIBYy8JtGyDoSiuqLtIu/Xm27ySuqFy+izOwoybGJSZNb9kCNEQh+2i85R97x6vYSN2Jd5bMMbLI3yci88= X-Received: by 2002:a17:906:7945:b0:73b:e605:f31 with SMTP id l5-20020a170906794500b0073be6050f31mr4680750ejo.129.1663357504390; Fri, 16 Sep 2022 12:45:04 -0700 (PDT) MIME-Version: 1.0 References: <83a66z4m9o.fsf@gnu.org> In-Reply-To: From: dalanicolai Date: Fri, 16 Sep 2022 21:44:53 +0200 Message-ID: Content-Type: multipart/alternative; boundary="0000000000002f09a305e8d09963" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000002f09a305e8d09963 Content-Type: text/plain; charset="UTF-8" B.t.w. I am using this command in `toc-mode`, which is available on MELPA. It is a quite awesome package to add TOC to pdf/djvu files that do not contain one (it can optionally do OCR via tesseract). The command is used in the function `toc--pdftocgen-add-to-pdf`, where I use the contents of the TOC buffer as infile, to add it to the PDF (which is passes as an argument). Maybe this explanation makes even more clear what the command is used for (in any case too much explanation will probably do no harm) On Fri, 16 Sept 2022 at 21:29, dalanicolai wrote: > I don't understand the answer well (my knowledge about computers is very > limited), > i.e. I do not immediately understand what it means for a file to be a tty. > > But also, I think the isatty() is about the TOC file, i.e. the file given > as INFILE (after the `<`) > But I am not giving any INFILE (which would make the command add the TOC > to the file given as argument), > Instead I simply provide a single filepath as argument so that the command > simply prints the TOC. > > (I hope this answer makes sense, I might be misunderstanding something) > > On Fri, 16 Sept 2022 at 13:00, Eli Zaretskii wrote: > >> > From: dalanicolai >> > Date: Fri, 16 Sep 2022 12:00:09 +0200 >> > >> > 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) >> > ``` >> >> Note that the above distinguishes between TTY and non-TTY input, and >> call-process works via the non-TTY case, AFAIU. So maybe what you see >> is entirely expected? >> > --0000000000002f09a305e8d09963 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
B.t.w. I am using this command in `toc-mode`, which i= s available on MELPA.
It is a quite awesome package to add TOC to= pdf/djvu files that do not contain one
(it can optionally do OCR= via tesseract). The command is used in the function
`toc--pdftoc= gen-add-to-pdf`, where I use the contents of the TOC buffer as infile,
to add it to the PDF (which is passes as an argument). Maybe this exp= lanation
makes even more clear what the command is used for (in a= ny case too much
explanation will probably do no harm)
<= /div>
O= n Fri, 16 Sept 2022 at 21:29, dalanicolai <dalanicolai@gmail.com> wrote:
I don't understa= nd the answer well (my knowledge about computers is very limited),
i.e. I do not immediately understand what it means for a file to be a tty= .

But also, I think the isatty() is about the TOC = file, i.e. the file given as INFILE (after the `<`)
But I = am not giving any INFILE (which would make the command add the TOC to the f= ile given as argument),
Instead I simply provide a single filepat= h as argument so that the command simply prints the TOC.

(I hope this answer makes sense, I might be misunderstanding somethi= ng)

On Fri, 16 Sept 2022 at 13:00, Eli Zaretskii <eliz@gnu.org> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">> From: dalanicolai <= ;dalanicolai@gma= il.com>
> Date: Fri, 16 Sep 2022 12:00:09 +0200
>
> When looking into the `pdftocio` package I find the following piece of= code
>
> ```
>=C2=A0 =C2=A0 =C2=A0try:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0with open_pdf(path_in) as doc:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if toc_file.isatty() or= print_toc:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# no inpu= t from user, switch to output mode and extract the toc
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# of pdf<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0toc =3D r= ead_toc(doc)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if len(to= c) =3D=3D 0:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0print("error: no table of contents found", file=3Dsys.stder= r)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0sys.exit(1)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if readab= le:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0print(pprint_toc(toc))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0print(dump_toc(toc), end=3D"")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sys.exit(= 0)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# an input is given, so= switch to input mode
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0toc =3D parse_toc(toc_f= ile)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0write_toc(doc, toc)
> ```

Note that the above distinguishes between TTY and non-TTY input, and
call-process works via the non-TTY case, AFAIU.=C2=A0 So maybe what you see=
is entirely expected?
--0000000000002f09a305e8d09963-- From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Sep 2022 06:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: dalanicolai Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166339475922717 (code B ref 57854); Sat, 17 Sep 2022 06:06:02 +0000 Received: (at 57854) by debbugs.gnu.org; 17 Sep 2022 06:05:59 +0000 Received: from localhost ([127.0.0.1]:44960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZQxi-0005uL-T5 for submit@debbugs.gnu.org; Sat, 17 Sep 2022 02:05:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZQxi-0005u6-02 for 57854@debbugs.gnu.org; Sat, 17 Sep 2022 02:05:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZQxc-0006aB-BN; Sat, 17 Sep 2022 02:05:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wzdU/SwNd3BtMw1KKojAg0HMu158C4KziWcV2Lsdvuw=; b=jrU43xQxvu59 /TNQBA6SoMAxS6VpoPyfaoVhMtFHNu4uHPC/eNyJjbmkDH8ZQjkNFAxjBE/DPBo68vG84NTxBDruj sY3ePUvPC4bpJiJFLaejVKgldZocjJ7SLe2OWUJ5CsZtGGZ48vOKgMiALO2Qox9n3jn1cU9FvP9yX FZWa9Z8o12s5uMDCqFE8Vj8amnkfPgZtO5TwZRIOIWXWCaJzAbxPpv4s9R6e/P4y4/Z9EfOXw9E7X +ulreZw6Glwn5VBVZIyweDY7YdlVaocVkjpBA8S0fLZUAex9BaPYGCAT5ItKgck/vnH9ASWI0HQwv T4afF1DPXb3aVZ8c+w5PGA==; Received: from [87.69.77.57] (port=3703 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZQxb-00043p-PW; Sat, 17 Sep 2022 02:05:52 -0400 Date: Sat, 17 Sep 2022 09:05:51 +0300 Message-Id: <83h716358g.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from dalanicolai on Fri, 16 Sep 2022 21:20:17 +0200) References: <83h7174ner.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [Please use "Reply All" to reply, to keep the bug tracker on the CC.] > From: dalanicolai > Date: Fri, 16 Sep 2022 21:20:17 +0200 > > The code I was using is `(call-process "pdftocio" nil nil nil buffer-file-name)` (from the buffer visiting the file) This makes the null device the standard input of the program. What happens if you invoke pdftocio from the shell prompt with a similar redirection: $ pdftocio ... < /dev/null (replace "..." with whatever command-line arguments you need, probably just the file name). What exit code does the program return then? From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Sep 2022 06:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: dalanicolai Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166339502123136 (code B ref 57854); Sat, 17 Sep 2022 06:11:02 +0000 Received: (at 57854) by debbugs.gnu.org; 17 Sep 2022 06:10:21 +0000 Received: from localhost ([127.0.0.1]:44966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZR1x-000616-Hx for submit@debbugs.gnu.org; Sat, 17 Sep 2022 02:10:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZR1v-00060l-PC for 57854@debbugs.gnu.org; Sat, 17 Sep 2022 02:10:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZR1q-00078K-JK; Sat, 17 Sep 2022 02:10:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=sroqx7X/dgmvSEFxus/uaBrSgaNGQvN/BcMjdXA37/c=; b=DMdQrfI3fS4V pdbhLlllPCyNrKUhbclrw+pfmjyDGxhnjmsOHiPESci8NC0bsQJpL7DtoNaO8xamDWbTqIGTeeyJu whlBxiwf8xZCez8SWsaOBM72Y/ko9dM1qmVLB1mbmRtnoFHcREjlpc8HLU74srJAKLXPQ0SpHm+i5 abSNv3bc/712M6+RceP8b+DGxhSNlgRNF4ZTf9sPLDU2ujT7AtUImdoQclYtCO2s9y612bjvqaVqF p8Dk1jMJQucudxGtHGSWH24TsefUhDWbvZBirUmFMg9hXpJUBJcMFE/F6KcYe8itWNwv4egpcHYhi nNLE5KTtSrqdibzZamXnsA==; Received: from [87.69.77.57] (port=3970 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZR1p-0004RU-TB; Sat, 17 Sep 2022 02:10:14 -0400 Date: Sat, 17 Sep 2022 09:10:12 +0300 Message-Id: <83fsgq3517.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from dalanicolai on Fri, 16 Sep 2022 21:29:15 +0200) References: <83a66z4m9o.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: dalanicolai > Date: Fri, 16 Sep 2022 21:29:15 +0200 > Cc: 57854@debbugs.gnu.org > > I don't understand the answer well (my knowledge about computers is very limited), > i.e. I do not immediately understand what it means for a file to be a tty. > > But also, I think the isatty() is about the TOC file, i.e. the file given as INFILE (after the `<`) > But I am not giving any INFILE (which would make the command add the TOC to the file given as > argument), > Instead I simply provide a single filepath as argument so that the command simply prints the TOC. I mentioned that aspect because it could be different between invocation from shell prompt and from call-process. I didn't examine the Python code of the program more than look at the snipped you posted. Basically, I don't think this is an Emacs problem, because call-process faithfully reports the exit code of the program it runs. The reason for the different behavior is almost certainly in the program itself or in some factor that is different between how you invoke it from shell and how you invoked it from Lisp. From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Sep 2022 13:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: Eli Zaretskii Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166342184820943 (code B ref 57854); Sat, 17 Sep 2022 13:38:02 +0000 Received: (at 57854) by debbugs.gnu.org; 17 Sep 2022 13:37:28 +0000 Received: from localhost ([127.0.0.1]:45385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZY0d-0005Rj-B1 for submit@debbugs.gnu.org; Sat, 17 Sep 2022 09:37:27 -0400 Received: from mail-ej1-f49.google.com ([209.85.218.49]:46813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZY0b-0005RW-NC for 57854@debbugs.gnu.org; Sat, 17 Sep 2022 09:37:26 -0400 Received: by mail-ej1-f49.google.com with SMTP id bj12so55054437ejb.13 for <57854@debbugs.gnu.org>; Sat, 17 Sep 2022 06:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=RvT+JCgWm8IgReHmYUseViYMPaRQtIrGa8+41KOlPqQ=; b=o/ZlG39szjXsaNIWNd145huwNihoGpzKRdZ3Sj/8qmnpsFewAV7hpiRPqD0nphL0/p Rr8ITqVZuBTsRsdJAU9kw74CXJa+Mt4Qk/vVm8vxUkS3zfWn30RBC4KqaQ5NlZO0N+IQ G0aog2S63Lr5MrvdrwZObnfUU0r7LHb224odDoEpNSoxL0qaSEc82UvSd30fhY/RPfBb M602Ylb6maRbFDOKCsjBnvvqHed+yD7QVO5eyN6rS/4wgbtOTYG1+XTEHGTl+NNow9vx SDM2WtIEk1GKPJJzVRrVsunkH4pN5swUGS9IhgEUJxEPCoGfm6uIumeSGVJxCdDcI/Xv 98iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=RvT+JCgWm8IgReHmYUseViYMPaRQtIrGa8+41KOlPqQ=; b=U71LvFpZokdqYkhK6o9YfdFbIJynnhQYJcLWG7Mk33nswkgMhnK72DrQAYT+kxIhWw 4WBp1KcNTRLdO/g1hhn5kBv5Ds+8HFeZwOvfpjxyhp6md1YABLDtiEfZkhQUW0R0LDIy k/oNU9PUZYlyHm4uUxbTEL4+9X1RDurjadzG+POVsF26xU9xlzxrIquH5WktcT6nirlB nf9aoSG+i/iMuMUIxOHICQbRSFtxDaGrHV94pA1jDTUX4SF7Wyilq4HlfgJrqbXz4nAp b4BbyCxPfnEMDdqCMYPjwyIyCPmRfTwAVp3S45Xub2Xt5w0NDx/Sjc/PTWn2heh+qogc fKGQ== X-Gm-Message-State: ACrzQf1ZUn3qNHwcP2t2LWX64GaBpsmAs93HReN/3T3liAsvY5CFGrcy +h+EK6RCIQDF3F21jeSuHRwRnEiQPCGwUqZaB+4tzOfd X-Google-Smtp-Source: AMsMyM4GkW0RFmXoUanlhgrvCMeDmT1dIBtFY/KV73i+83HJc14AVxhrZq3ik4fTHm5auGbkBSXT0Y1OFJP8jKuAQoU= X-Received: by 2002:a17:906:fd85:b0:77b:b538:6472 with SMTP id xa5-20020a170906fd8500b0077bb5386472mr6786442ejb.48.1663421839969; Sat, 17 Sep 2022 06:37:19 -0700 (PDT) MIME-Version: 1.0 References: <83a66z4m9o.fsf@gnu.org> <83fsgq3517.fsf@gnu.org> In-Reply-To: <83fsgq3517.fsf@gnu.org> From: dalanicolai Date: Sat, 17 Sep 2022 15:37:08 +0200 Message-ID: Content-Type: multipart/alternative; boundary="000000000000e211dc05e8df9339" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000e211dc05e8df9339 Content-Type: text/plain; charset="UTF-8" Indeed, when invoking the command from the shell prompt using /dev/null as input (pdftocio ... < /dev/null), then the command does not return an error (i.e. exit code is 0). So, indeed there is a difference between invoking it from Emacs and invoking it from the shell prompt (without the /dev/null input). This might not be considered a bug, but it is not trivial to me, that using call-process implies sending the null-device as input. Is there a way to call a process from elisp, without sending the input? Otherwise, I would probably change this into a 'documentation bug' report, in the sense that it would be nice if this detail was mentioned in the docs (I think it is not currently). I am not sure, if this is a case of a 'bad/wrongly designed' pdftocio command (I would say that the command might be well designed, but just it assumes that it is being used from the shell prompt. However, I am no expert on unix(/posix?) 'protocols'). On Sat, 17 Sept 2022 at 08:10, Eli Zaretskii wrote: > > From: dalanicolai > > Date: Fri, 16 Sep 2022 21:29:15 +0200 > > Cc: 57854@debbugs.gnu.org > > > > I don't understand the answer well (my knowledge about computers is very > limited), > > i.e. I do not immediately understand what it means for a file to be a > tty. > > > > But also, I think the isatty() is about the TOC file, i.e. the file > given as INFILE (after the `<`) > > But I am not giving any INFILE (which would make the command add the TOC > to the file given as > > argument), > > Instead I simply provide a single filepath as argument so that the > command simply prints the TOC. > > I mentioned that aspect because it could be different between > invocation from shell prompt and from call-process. I didn't examine > the Python code of the program more than look at the snipped you > posted. > > Basically, I don't think this is an Emacs problem, because > call-process faithfully reports the exit code of the program it runs. > The reason for the different behavior is almost certainly in the > program itself or in some factor that is different between how you > invoke it from shell and how you invoked it from Lisp. > --000000000000e211dc05e8df9339 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Indeed, when invoking the command from the shell prom= pt using /dev/null as input
=C2=A0(pdftocio ... < /dev/null), = then the command does not return an error (i.e. exit code is 0).
=
So, indeed there is a difference between invoking it from Em= acs and invoking it from the
shell prompt (without the /dev/null = input). This might not be considered a bug, but it is not
trivial= to me, that using call-process implies sending the null-device as input.

Is there a way to call a process from elisp, withou= t sending the input? Otherwise, I would
probably change this into= a 'documentation bug' report, in the sense that it would be nice
if this detail was mentioned in the docs (I think it is not curren= tly). I am not sure, if this is a
case of a 'bad/wrongly desi= gned' pdftocio command (I would say that the command might
be well designed, but just it assumes that it is being used from the shel= l prompt. However,
I am no expert on unix(/posix?) 'protocols= ').

On Sat, 17 Sept 2022 at 08:10, Eli Zaretskii <eliz@gnu.org> wrote:
> From: dalanicolai <dalanicolai@gmail.com&g= t;
> Date: Fri, 16 Sep 2022 21:29:15 +0200
> Cc: 57854@d= ebbugs.gnu.org
>
> I don't understand the answer well (my knowledge about computers i= s very limited),
> i.e. I do not immediately understand what it means for a file to be a = tty.
>
> But also, I think the isatty() is about the TOC file, i.e. the file gi= ven as INFILE (after the `<`)
> But I am not giving any INFILE (which would make the command add the T= OC to the file given as
> argument),
> Instead I simply provide a single filepath as argument so that the com= mand simply prints the TOC.

I mentioned that aspect because it could be different between
invocation from shell prompt and from call-process.=C2=A0 I didn't exam= ine
the Python code of the program more than look at the snipped you
posted.

Basically, I don't think this is an Emacs problem, because
call-process faithfully reports the exit code of the program it runs.
The reason for the different behavior is almost certainly in the
program itself or in some factor that is different between how you
invoke it from shell and how you invoked it from Lisp.
--000000000000e211dc05e8df9339-- From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Sep 2022 13:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: dalanicolai Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.166342299032508 (code B ref 57854); Sat, 17 Sep 2022 13:57:02 +0000 Received: (at 57854) by debbugs.gnu.org; 17 Sep 2022 13:56:30 +0000 Received: from localhost ([127.0.0.1]:46892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZYJ4-0008SG-6M for submit@debbugs.gnu.org; Sat, 17 Sep 2022 09:56:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZYJ1-0008S9-R0 for 57854@debbugs.gnu.org; Sat, 17 Sep 2022 09:56:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZYIw-0005mf-LC; Sat, 17 Sep 2022 09:56:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ZSwvfH7ufXKsama3Conr7Xr2K1wcqETDmIrTIte56/Y=; b=MIBbQtrgYs11AEuWUkJi IxHcJgGBzT9jvWDKY6Bj0tp6f4GuzOQCkhzfQ/fRjH4y0g3XLK6/NPFFu6a19JfweDs96O0y92pRk s31LM2MHisoLb4rRhhaQAmd0UwmQRrBoBVu0kTficpfTpvlP8MveglJQnl2dz9SVkvmqoLnGGL54H A/KQDue4Y+sQrifqLaX2LetJzu/AHxiB2BGRRWpBzIjkqnMeeU9tKNdedLiQLfQtEuhTLD+3j/5iU JK15R//rKX+xyN/R+HREdh3TIhiddPP3Rn6l6ql3Ydt2Lr3GAqOhoeKohS59A+OCLnGHOVPPjEag/ xZT3KfWw0RZPAA==; Received: from [87.69.77.57] (port=4838 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZYIw-0001jM-0U; Sat, 17 Sep 2022 09:56:22 -0400 Date: Sat, 17 Sep 2022 16:56:22 +0300 Message-Id: <83illm14vt.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from dalanicolai on Sat, 17 Sep 2022 15:37:08 +0200) References: <83a66z4m9o.fsf@gnu.org> <83fsgq3517.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: dalanicolai > Date: Sat, 17 Sep 2022 15:37:08 +0200 > Cc: 57854@debbugs.gnu.org > > Indeed, when invoking the command from the shell prompt using /dev/null as input > (pdftocio ... < /dev/null), then the command does not return an error (i.e. exit code is 0). > > So, indeed there is a difference between invoking it from Emacs and invoking it from the > shell prompt (without the /dev/null input). This might not be considered a bug, but it is not > trivial to me, that using call-process implies sending the null-device as input. > > Is there a way to call a process from elisp, without sending the input? You could use start-process instead, and then wait for the process to finish. It would complicate the Lisp program, though. > Otherwise, I would > probably change this into a 'documentation bug' report, in the sense that it would be nice > if this detail was mentioned in the docs (I think it is not currently). The doc string of call-process already says that: The program’s input comes from file INFILE (nil means ‘null-device’). From unknown Tue Jun 17 22:26:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Sep 2022 14:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: Eli Zaretskii Cc: 57854@debbugs.gnu.org Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.16634242252014 (code B ref 57854); Sat, 17 Sep 2022 14:18:02 +0000 Received: (at 57854) by debbugs.gnu.org; 17 Sep 2022 14:17:05 +0000 Received: from localhost ([127.0.0.1]:46906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZYcy-0000WQ-Pe for submit@debbugs.gnu.org; Sat, 17 Sep 2022 10:17:05 -0400 Received: from mail-ed1-f52.google.com ([209.85.208.52]:40887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZYct-0000Vp-F0 for 57854@debbugs.gnu.org; Sat, 17 Sep 2022 10:17:03 -0400 Received: by mail-ed1-f52.google.com with SMTP id w28so11356441edi.7 for <57854@debbugs.gnu.org>; Sat, 17 Sep 2022 07:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=04zbojRiiS+X0eoNFsrciRmmSPXiOuGRBw/r1+ZTOjc=; b=BABGYGv7qy1hVpRvDZuMa1ibH6/5MgnHmCB12lkPBWMJB6nvJ3fezNQUqS1VEZA8HY DX4EclRKpKAjIgZv4VzEv7kUDp9cwwAxXurj9F/EM7WleAf7E8rOaUsbDUUihwz4hYv1 wpAdhikORj/0K+dATdu8tyd//VtDlx3++yDr4pELRsc4f5yHFBZsxKHhov7mvSNjv5KL Mv9efNs32TQjrn8UauKbC0DTEN+PHIbw2GN0BcoAwHd3IAtA4sQ7OUlIZXEz2K55tnj1 2CaqSjzx2SYCwQDKxfonbF6AUFB3HXdYEF/jZXeeoUOTNsAuZFDVwpQ8hHHKF6ght3hN BQeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=04zbojRiiS+X0eoNFsrciRmmSPXiOuGRBw/r1+ZTOjc=; b=aZChKwtMSKP1s6hsqU60gAqn6Ma5k8YfMuvntmNNYuzHh5tUbKJDJtpecVPiZQ2EFO 2U3zZ7M3rZPkNnJyyRTprsC18doKObR4RaV7AtRUQNTIcCQ16YAWDyaKXUaPw/zU84vO OBK2IGzAMzLpqs4B3Gvth+sJhh7yKWXGnZ3chg00Tss1MZd2k17tgkQ7wAnBNDlOl2iq BHw9jjE5qQpQVw5tRrno6Lo3fpmohe555w91NpwIbwb532O2GiM4SY2W52w0dGx1hUyi 3DRvWS3aI5GOqwKJmDW1gceViJp7XVzDiK+nZpZME/ew2rwwk96qDcOUTPnb+BbLqLJO Dpjw== X-Gm-Message-State: ACrzQf2etfJP8TBjcmefW3CCvTKudHHy0UdPNQKzMhif+LdnYZXUsbSf 6v7KY1EOiqovw1S52PwPXK+OYE50I6W4XFy25veszG58 X-Google-Smtp-Source: AMsMyM7Ub0KkH5h+tJdpB4iwa+x35mqkU1cm1MIwjS1iNxRwvopZvbY5pPI+UXSwE8RRwzFyKjLkqKCDYhdTcM4waNo= X-Received: by 2002:a05:6402:e98:b0:44d:c2e0:d8b0 with SMTP id h24-20020a0564020e9800b0044dc2e0d8b0mr7836038eda.165.1663424213378; Sat, 17 Sep 2022 07:16:53 -0700 (PDT) MIME-Version: 1.0 References: <83a66z4m9o.fsf@gnu.org> <83fsgq3517.fsf@gnu.org> <83illm14vt.fsf@gnu.org> In-Reply-To: <83illm14vt.fsf@gnu.org> From: dalanicolai Date: Sat, 17 Sep 2022 16:16:42 +0200 Message-ID: Content-Type: multipart/alternative; boundary="000000000000596d0105e8e021c1" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000596d0105e8e021c1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ah yes, you are totally right (I probably looked over it because I, previously, did not understand its meaning/consequences). Using start-process will be fine (setting a sentinel is not too complicated). Thanks (again) for your help! On Sat, 17 Sept 2022 at 15:56, Eli Zaretskii wrote: > > From: dalanicolai > > Date: Sat, 17 Sep 2022 15:37:08 +0200 > > Cc: 57854@debbugs.gnu.org > > > > Indeed, when invoking the command from the shell prompt using /dev/null > as input > > (pdftocio ... < /dev/null), then the command does not return an error > (i.e. exit code is 0). > > > > So, indeed there is a difference between invoking it from Emacs and > invoking it from the > > shell prompt (without the /dev/null input). This might not be considere= d > a bug, but it is not > > trivial to me, that using call-process implies sending the null-device > as input. > > > > Is there a way to call a process from elisp, without sending the input? > > You could use start-process instead, and then wait for the process to > finish. It would complicate the Lisp program, though. > > > Otherwise, I would > > probably change this into a 'documentation bug' report, in the sense > that it would be nice > > if this detail was mentioned in the docs (I think it is not currently). > > The doc string of call-process already says that: > > The program=E2=80=99s input comes from file INFILE (nil means =E2=80=98n= ull-device=E2=80=99). > --000000000000596d0105e8e021c1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ah yes, you are totally right (I probably looked over= it because I,
previously, did not understand its meaning/consequ= ences).

Using start-process will be fine (setting = a sentinel is not too complicated).

Thanks (again)= for your help!



On Sat, 17 Sept 2022= at 15:56, Eli Zaretskii <eliz@gnu.org> wrote:
&g= t; From: dalanicolai <dalanicolai@gmail.com>
> Date: Sat, 17 Sep 2022 15:37:08 +0200
> Cc: 57854@d= ebbugs.gnu.org
>
> Indeed, when invoking the command from the shell prompt using /dev/nul= l as input
>=C2=A0 (pdftocio ... < /dev/null), then the command does not return = an error (i.e. exit code is 0).
>
> So, indeed there is a difference between invoking it from Emacs and in= voking it from the
> shell prompt (without the /dev/null input). This might not be consider= ed a bug, but it is not
> trivial to me, that using call-process implies sending the null-device= as input.
>
> Is there a way to call a process from elisp, without sending the input= ?

You could use start-process instead, and then wait for the process to
finish.=C2=A0 It would complicate the Lisp program, though.

> Otherwise, I would
> probably change this into a 'documentation bug' report, in the= sense that it would be nice
> if this detail was mentioned in the docs (I think it is not currently)= .

The doc string of call-process already says that:

=C2=A0The program=E2=80=99s input comes from file INFILE (nil means =E2=80= =98null-device=E2=80=99).
--000000000000596d0105e8e021c1-- From unknown Tue Jun 17 22:26:34 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: dalanicolai Subject: bug#57854: closed (Re: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process) Message-ID: References: <83fsgq12rh.fsf@gnu.org> X-Gnu-PR-Message: they-closed 57854 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: moreinfo Reply-To: 57854@debbugs.gnu.org Date: Sat, 17 Sep 2022 14:43:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1663425782-4469-1" This is a multi-part message in MIME format... ------------=_1663425782-4469-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #57854: 29.0.50; Different exit code in Emacs and terminal for identical pr= ocess which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 57854@debbugs.gnu.org. --=20 57854: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D57854 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1663425782-4469-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 57854-done) by debbugs.gnu.org; 17 Sep 2022 14:42:20 +0000 Received: from localhost ([127.0.0.1]:46949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZZ1P-00019C-N6 for submit@debbugs.gnu.org; Sat, 17 Sep 2022 10:42:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZZ1N-000190-CX for 57854-done@debbugs.gnu.org; Sat, 17 Sep 2022 10:42:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZZ1I-00040W-6t; Sat, 17 Sep 2022 10:42:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=YaWSxo3VmWgedMi+sGTjJcetEW/S3NN1NoS+ZX5F3Z4=; b=WINbfkHgzW8g 9cbVBtoODnHAafkIYBMsfW+E3nSguPtxf9WmeTS5ykqn+aepMN5YImf9zTOLEal39kg5Dky01mFR6 L/F8ZHD2SY+ZupkljCK161ySiEqdHdhjR0dMVXK+EzBgYZC3swt+o5yC4CfGDIo6LO8U4Kp6wTHKE eXFsh78SYFuYJbW3J15SJ1M5N238967F/qKTxbbx7MEtBmXN3wM2IUjuotVrlYQ1CQBm5WySy6t9J PztL30L7+YQERhQehZ2c+zfc8ayV4Xz2uZVhsexwXHtgUA9lmt/jXUA9AmPtdRLT827PaPQHmv1C2 DOoeQb7UbFXiEeI6uZRrCQ==; Received: from [87.69.77.57] (port=3708 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZZ1H-0002XQ-LN; Sat, 17 Sep 2022 10:42:11 -0400 Date: Sat, 17 Sep 2022 17:42:10 +0300 Message-Id: <83fsgq12rh.fsf@gnu.org> From: Eli Zaretskii To: dalanicolai In-Reply-To: (message from dalanicolai on Sat, 17 Sep 2022 16:16:42 +0200) Subject: Re: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process References: <83a66z4m9o.fsf@gnu.org> <83fsgq3517.fsf@gnu.org> <83illm14vt.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57854-done Cc: 57854-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: dalanicolai > Date: Sat, 17 Sep 2022 16:16:42 +0200 > Cc: 57854@debbugs.gnu.org > > Ah yes, you are totally right (I probably looked over it because I, > previously, did not understand its meaning/consequences). > > Using start-process will be fine (setting a sentinel is not too complicated). > > Thanks (again) for your help! Glad I could help, and closing the bug. ------------=_1663425782-4469-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Sep 2022 09:40:04 +0000 Received: from localhost ([127.0.0.1]:41672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ7pL-0006q0-08 for submit@debbugs.gnu.org; Fri, 16 Sep 2022 05:40:03 -0400 Received: from lists.gnu.org ([209.51.188.17]:48008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ7pI-0006pU-FV for submit@debbugs.gnu.org; Fri, 16 Sep 2022 05:40:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ7pC-00051J-Pp for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 05:40:00 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:36358) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZ7oy-00056l-Og for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 05:39:50 -0400 Received: by mail-ej1-x630.google.com with SMTP id 13so19153442ejn.3 for ; Fri, 16 Sep 2022 02:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=7Bsv3RaT4Vu6y7F5akiHKqFlX65F+p+FrvHRzChGpkE=; b=RJHr1NjyS3pH8sdqlmxrB5UGlZaR4blbHMlmGM5MgVoed0lZcNTMfmpBhCDHJQb5HK FD4RGo73Eo6OSKcasWsfZK1VgEnta2gzsYniCMgRreY9/5I1aEpw+HALScSNL9OCpezt 7nSSJ1bxpec+8ivOrxfQUOwajyN2lBC1p2XemoWSDKEVoFx9XjyUBd94vcWzUDAwM7on AGrXuYlAxE4FYKPlvnc8C3HlSzfFEqTFYYv0EuKOXXIHYg84Ifz/3hqlUFvmG/R5TWEB qCzNmLEaBuxqQXg1XXsuNHMhD+Qd7xw4vAoTYdhsSHgnJjK/NV+eL7ZR0Y/cTEoyoYVx kG/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=7Bsv3RaT4Vu6y7F5akiHKqFlX65F+p+FrvHRzChGpkE=; b=dgjKl+xjhWSa7TiaBhEdodEClXbHF7ImkL/9BzVslQJ0Zc7kabRfhqAY/kaFBGq3hq bnreXYOB9Qf3QxWCIcAfCmcP0GTjZ8LV6k4J4Z3Zb2zr91Eg3KQRX/Lokbil+7PcpV6C pk1734wcCdFDdCDGCSeu7Eflr3zq+mRSP0R3sL+1Gbwf5J2ntsao5UHJiuMGnsLo7kRE Fagy1Ysc4wihs4eorY05aJMqz0MY0zXKqwbDQpoHznZM/oshx+q/M3YBfyNnnK+ZuO6s Mw8zFjV/cby2iCN5UaeDZ4HR4hJGg7N+iFBogPFWAJCMZnRRTHBBFzqrQI7wNjMl/30y WZhA== X-Gm-Message-State: ACrzQf0PRV9VS0iwSFRZ/J4bWHT+dTSvY9zoV/xkHdc+2L6+hnbzokBV wdX1/EAxt/th02koQUh2RKFTz2EOF3kVLdBuRS30W0wAY7k= X-Google-Smtp-Source: AMsMyM7V0TS7aPLpgriQe/RpPFu8kRSTRRVNfjD7WJclcEZ+7t66i12eLCcQzPDO85tG+b9I/SxLJ7PA/sjd3qbPQI4= X-Received: by 2002:a17:907:6ea2:b0:779:8fc1:e5d8 with SMTP id sh34-20020a1709076ea200b007798fc1e5d8mr2904685ejc.731.1663321176863; Fri, 16 Sep 2022 02:39:36 -0700 (PDT) MIME-Version: 1.0 From: dalanicolai Date: Fri, 16 Sep 2022 11:39:25 +0200 Message-ID: Subject: 29.0.50; Different exit code in Emacs and terminal for identical process To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000e4fffc05e8c8232b" Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=dalanicolai@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000e4fffc05e8c8232b Content-Type: text/plain; charset="UTF-8" Execute in the terminal the command pdftocio (see https://github.com/Krasjet/pdf.tocgen#pdftocio, the command is easily available via PyPI ) on a pdf file that does not contain a Table of Contents. The command produces an error and subsequently executing `echo $?` shows exit code 1. Subsequently, executing the same command from Emacs on the same file, then `call-process` returns a 0, and indeed `shell-command-to-string` produces an empty string. However, I would expect an error like in the terminal (with call-process returning exit code 1). The PDF in the following link could be used for testing: https://www.orimi.com/pdf-test.pdf In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) of 2022-09-10 built on fedora Repository revision: 4cf9c92e27d20da9453f9abe89d84bee5d776329 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12014000 System Description: Fedora Linux 36 (Workstation Edition) Configured using: 'configure --with-modules --with-cairo --with-native-compilation --with-json' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: DocView Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils doc-view filenotify jka-compr image-mode exif dired dired-loaddefs time-date comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode cl-loaddefs cl-lib bytecomp byte-compile cconv rmc iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 108025 17657) (symbols 48 7602 0) (strings 32 30705 1814) (string-bytes 1 939199) (vectors 16 23470) (vector-slots 8 390912 21366) (floats 8 71 19) (intervals 56 222 0) (buffers 1000 13)) --000000000000e4fffc05e8c8232b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Execute in the terminal the command pdftocio (see
=C2=A0easily available via PyPI) on= a pdf file that does
not contain a Table of Contents. The command pro= duces an error and
subsequently executing `echo $?` shows exit code 1.
Subsequently, executing the same command from Emacs on the same file,=
then `call-process` returns a 0, and indeed `shell-command-to-string`produces an empty string. However, I would expect an error like in theterminal (with call-process returning exit code 1).

The PDF in the = following link could be used for testing:
https://www.orimi.com/pdf-test.pdf


In GNU E= macs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
=C2=A03.24.34, = cairo version 1.17.6) of 2022-09-10 built on fedora
Repository revision:= 4cf9c92e27d20da9453f9abe89d84bee5d776329
Repository branch: master
W= indowing system distributor 'The X.Org Foundation', version 11.0.12= 014000
System Description: Fedora Linux 36 (Workstation Edition)

= Configured using:
=C2=A0'configure --with-modules --with-cairo --wit= h-native-compilation
=C2=A0--with-json'

Configured features:<= br>ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON=
LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG<= br>SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM
X= INPUT2 XPM GTK3 ZLIB

Important settings:
=C2=A0 value of $LANG: e= n_US.UTF-8
=C2=A0 value of $XMODIFIERS: @im=3Dibus
=C2=A0 locale-codi= ng-system: utf-8-unix

Major mode: DocView

Minor modes in effe= ct:
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 show= -paren-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode= : t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-na= me-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mo= de: t
=C2=A0 blink-cursor-mode: t
=C2=A0 buffer-read-only: t
=C2= =A0 line-number-mode: t
=C2=A0 indent-tabs-mode: t
=C2=A0 transient-m= ark-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mo= de: t
=C2=A0 auto-compression-mode: t

Load-path shadows:
None = found.

Features:
(shadow sort mail-extr emacsbug message mailcap = yank-media puny rfc822
mml mml-sec password-cache epa derived epg rfc606= 8 epg-config gnus-util
text-property-search mm-decode mm-bodies mm-encod= e mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rf= c2045 ietf-drums
mm-util mail-prsvr mail-utils doc-view filenotify jka-c= ompr image-mode
exif dired dired-loaddefs time-date comp comp-cstr warni= ngs icons subr-x
rx cl-seq cl-macs gv cl-extra help-mode cl-loaddefs cl-= lib bytecomp
byte-compile cconv rmc iso-transl tooltip eldoc paren elect= ric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/= x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt = fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode r= egister
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select<= br>scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
= frame minibuffer nadvice seq simple cl-generic indonesian philippine
cha= m georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
kor= ean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
europea= n ethiopic indian cyrillic chinese composite emoji-zwj charscript
charpr= op case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-pre= loaded button loaddefs faces cus-face macroexp files window
text-propert= ies overlay sha1 md5 base64 format env code-pages mule
custom widget key= map hashtable-print-readable backquote threads dbusbind
inotify dynamic-= setting system-font-setting font-render-setting cairo
move-toolbar gtk x= -toolkit xinput2 x multi-tty make-network-process
native-compile emacs)<= br>
Memory information:
((conses 16 108025 17657)
=C2=A0(symbols 4= 8 7602 0)
=C2=A0(strings 32 30705 1814)
=C2=A0(string-bytes 1 939199)=
=C2=A0(vectors 16 23470)
=C2=A0(vector-slots 8 390912 21366)
=C2= =A0(floats 8 71 19)
=C2=A0(intervals 56 222 0)
=C2=A0(buffers 1000 13= ))


--000000000000e4fffc05e8c8232b-- ------------=_1663425782-4469-1--