From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.bugs Subject: bug#49822: [PATCH] python-shell-send functions show no output Date: Fri, 03 Sep 2021 10:02:18 +0200 Message-ID: <87fsumjddh.fsf_-_@gmail.com> References: <855f9eaf1b1d39bb9325d0a88e7f66c0ba0b45d0.camel@gmail.com> <87r1f9fzj4.fsf@gnus.org> <87im0a6789.fsf@gmail.com> <8735rdha6y.fsf@gnus.org> <69e713da-5186-780a-f0b7-8099ce6cde3d@easy-emacs.de> <87h7fsnzmo.fsf@gmail.com> <51fa5c12-53b4-ad92-505f-1896d955b68c@easy-emacs.de> <87k0k8wqyo.fsf@gmail.com> <87h7fc1enm.fsf@gnus.org> <87sfytex5b.fsf_-_@gmail.com> <87o89hinkv.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4053"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 49822@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 03 10:03:20 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mM4AS-0000qR-0U for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Sep 2021 10:03:20 +0200 Original-Received: from localhost ([::1]:35362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mM4AQ-0007aW-UX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Sep 2021 04:03:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mM4AB-0007Zf-D5 for bug-gnu-emacs@gnu.org; Fri, 03 Sep 2021 04:03:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59512) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mM4AB-0004BA-5A for bug-gnu-emacs@gnu.org; Fri, 03 Sep 2021 04:03:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mM4AA-0005ZL-Pz for bug-gnu-emacs@gnu.org; Fri, 03 Sep 2021 04:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Sep 2021 08:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49822 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49822-submit@debbugs.gnu.org id=B49822.163065615020644 (code B ref 49822); Fri, 03 Sep 2021 08:03:02 +0000 Original-Received: (at 49822) by debbugs.gnu.org; 3 Sep 2021 08:02:30 +0000 Original-Received: from localhost ([127.0.0.1]:42818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mM49e-0005Mf-DV for submit@debbugs.gnu.org; Fri, 03 Sep 2021 04:02:30 -0400 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:50719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mM49a-0005Fm-KD for 49822@debbugs.gnu.org; Fri, 03 Sep 2021 04:02:28 -0400 Original-Received: by mail-wm1-f44.google.com with SMTP id m2so2935358wmm.0 for <49822@debbugs.gnu.org>; Fri, 03 Sep 2021 01:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=rjpJ++rL6mkSgbR2IHkKQjuFeWI8D+XcMtfOZ7MTkqs=; b=Zjfe/OKYNiroHMyduA3iZEXzTj3VCeVBK9DnOjiD/0v3Nq+KjbhJCJi0IqnKbkw24f 1MCSMNYRzYx4PbXfD7odg2X9/En3iLE6mnhSfB/WoJCvPVG9lUNJT0aTMW4t6lfox4eR njTa7ktTw0l9QKNW6LZxlWvK9QJszrokX+mtxrVaoOPt8hyPWb/I1ZFfT9GpfbYAcNgy 11NQjf01NJc4h0aQMiO0wXkY9CduM1g/YrM1h7IgB8KckCsUXH3Lrn5tjB/x3VmXSlkx mg3OaKCiegy5MkK0ai7SGapA4PN6CJ9CGW233hyb/O3RAKRdOwyiimHAGapwZgHget5j GG0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=rjpJ++rL6mkSgbR2IHkKQjuFeWI8D+XcMtfOZ7MTkqs=; b=WpJJ2detiAP9UzzlibHJSW9EAIXCq17MX0LzKkZGrkpQ2upmgj6i7VGuYJR/bIw7ox d3+l1nXJnN/yKSGYTrswStWfEepyLjrJ00+Ch5tNqa2oERcw72mgdy9b31stVnkbtYSN tjtaCQSTl64pxJU8yFF1mki9xMLMsbF/vCpZZDlFMsrUa6ytLbjsk8SXQI3+XlWDyhpz nI6+SAvjMo3H3HAiUl5vLfh8NYxnFITRVKiSB9rJr92SKu06mPITfGUY+WaenzBWpmST RwWbDnK7ABRsiH5+INqI5BwUA3azlD4TCYTCEDsQlOUpjAvpgEnkpgSqJA/y92nonORg fPwQ== X-Gm-Message-State: AOAM531Gc4RZeuz/hTMBRaNV1+1YXixkC+1qzBtIQPs09NozwQwuFmDL YYRPKTsASIJ5HcXhFSzQr5fkZ79t8X7tjw== X-Google-Smtp-Source: ABdhPJwT2qILvMBZ+3oavFy0em9LLU8vGLM/6XKako7y9CGdMrDKQQJnxquN85SECqtvQuTq5H7rXg== X-Received: by 2002:a7b:cbc2:: with SMTP id n2mr6952202wmi.155.1630656140248; Fri, 03 Sep 2021 01:02:20 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::8aaf]) by smtp.gmail.com with ESMTPSA id f3sm3582189wmj.28.2021.09.03.01.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 01:02:19 -0700 (PDT) In-Reply-To: <87o89hinkv.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 28 Aug 2021 17:41:20 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:213332 Archived-At: On Sat, 28 Aug 2021 at 17:41, Lars Ingebrigtsen wrote: > Yes, it might be a good idea to raise this topic on emacs-devel and see > if there's any feedback. Okay, nobody chimed in on this thread (and I think I forgot to mention it in emacs-devel), but this patch works well for me so far. So I would suggest to merge it. > > Some minor comments on the patch: > >> +(defvar python-shell-eval-setup-code >> + "\ >> +def __PYTHON_EL_eval(source, filename): >> + import ast, sys >> + if sys.version_info[0] == 2: >> + from __builtin__ import compile, eval, globals > > I think it might be a better long-term maintenance solution to put the > Python code here (and from `python-shell-completion-native-setup') into > a .py file under etc (for instance in a new "python-mode" > sub-directory), and then read it in run-time (accessed via > `data-directory', which points to etc), and cache it in an internal > variable. > > Editing Python that's inside a Lisp string is awkward. Yes, that makes sense. On the other hand, it would make the entire setup a bit more complicated, and I'm unsure about some of the details. I do want to refactor `python-shell-send-file', though, so that at least it doesn't generate Python code strings on the fly (and at the same time solve the remaining part of Bug#32042).