From unknown Sun Sep 07 12:44:41 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18118 <18118@debbugs.gnu.org> To: bug#18118 <18118@debbugs.gnu.org> Subject: Status: Support for Python3 in TRAMP's `tramp-get-remote-uid-with-python' Reply-To: bug#18118 <18118@debbugs.gnu.org> Date: Sun, 07 Sep 2025 19:44:41 +0000 retitle 18118 Support for Python3 in TRAMP's `tramp-get-remote-uid-with-pyt= hon' reassign 18118 emacs submitter 18118 eclig@gmx.net severity 18118 normal tag 18118 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 27 10:29:01 2014 Received: (at submit) by debbugs.gnu.org; 27 Jul 2014 14:29:01 +0000 Received: from localhost ([127.0.0.1]:39474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBPRc-0007FL-24 for submit@debbugs.gnu.org; Sun, 27 Jul 2014 10:29:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51822) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBPRZ-0007F4-0a for submit@debbugs.gnu.org; Sun, 27 Jul 2014 10:28:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBPRN-0005AD-3B for submit@debbugs.gnu.org; Sun, 27 Jul 2014 10:28:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBPRN-0005A6-0C for submit@debbugs.gnu.org; Sun, 27 Jul 2014 10:28:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBPRH-0000WW-Db for bug-gnu-emacs@gnu.org; Sun, 27 Jul 2014 10:28:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBPRB-00057l-Tx for bug-gnu-emacs@gnu.org; Sun, 27 Jul 2014 10:28:39 -0400 Received: from mail-we0-x234.google.com ([2a00:1450:400c:c03::234]:39281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBPRB-00057W-Jt for bug-gnu-emacs@gnu.org; Sun, 27 Jul 2014 10:28:33 -0400 Received: by mail-we0-f180.google.com with SMTP id w61so6278095wes.39 for ; Sun, 27 Jul 2014 07:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:reply-to:date:message-id:mime-version :content-type:content-transfer-encoding; bh=OyvQFY07+z7EE6S7VP8mAKNMoJ9og2vhpRACM94yH80=; b=ilwfh08pcQT7wJY3/e1LMdFFNtf4cgo2m7GaApP1kGeXsZimgmCxjQ+pQB704oLVXm o+HbFxY4v018vITPHgeNBaxazrWhi7PqrXu0BDHwCb6iNlWN1/MG8zCFiNLAT6KLGVdr K1V/NsE2DTMAPsfucvt15o3ek6DYUGdBAlbNO0WRburMVxB4ye09Ad1vZ4gYiuBjVjnt gpveZfdkTJB5taV7c2t0BpiMT6ppr+v+ZiPHqBIUPW6wQ8Ttzz6fFlkeWI4rrTGTURSD 4ZXxJeMfctlsDpSDGyYnQDFFx2LAC7E8IbJYfkaUDZxX1+FRp6RF0hSGXIg8WLoyKe5e gzCQ== X-Received: by 10.180.106.138 with SMTP id gu10mr21529390wib.21.1406471311198; Sun, 27 Jul 2014 07:28:31 -0700 (PDT) Received: from bessa.local (p4FFB9429.dip0.t-ipconnect.de. [79.251.148.41]) by mx.google.com with ESMTPSA id gq4sm19888599wib.8.2014.07.27.07.28.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 27 Jul 2014 07:28:30 -0700 (PDT) From: eclig@gmx.net To: bug-gnu-emacs@gnu.org Subject: Support for Python3 in TRAMP's `tramp-get-remote-uid-with-python' Date: Sun, 27 Jul 2014 16:32:31 +0200 Message-ID: <87ppgqan40.fsf@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: eclig@gmx.net 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: -4.0 (----) Dear Emacs maintainers, the following patch makes possible to use TRAMP to connect to systems where both `perl' and `id' are missing and where the Python program is called `python3'. Note that the syntax `print foo' is invalid in Python3 since there `print' is a function, whereas in Python2 it is/was a statement. The syntax `print(foo)' works in both cases and it's what I used bellow. Regards Em=C3=ADlio # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: eclig@gmx.net-20140725151222-n88affhi3m98xkqr # target_branch: http://bzr.savannah.gnu.org/r/emacs/trunk/ # testament_sha1: cbaad612600a8166a622e1019484b64d24afeae9 # timestamp: 2014-07-25 17:17:36 +0200 # base_revision_id: eliz@gnu.org-20140725115836-axkqeojeljgzzef1 # # Begin patch =3D=3D=3D modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-25 09:37:07 +0000 +++ lisp/ChangeLog 2014-07-25 15:12:22 +0000 @@ -1,3 +1,11 @@ +2014-07-25 Emilio C. Lopes + + * net/tramp-sh.el (tramp-get-remote-python): Also search for + executables named "python2" or "python3". + (tramp-get-remote-uid-with-python): Use parentheses around arguments to + `print' to make it compatible with Python 3. + (tramp-get-remote-gid-with-python): Ditto. + 2014-07-25 Glenn Morris =20 * vc/ediff-init.el (ediff-toggle-read-only-function): =3D=3D=3D modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2014-07-03 09:27:02 +0000 +++ lisp/net/tramp-sh.el 2014-07-25 15:12:22 +0000 @@ -5256,7 +5256,9 @@ (defun tramp-get-remote-python (vec) (with-tramp-connection-property vec "python" (tramp-message vec 5 "Finding a suitable `python' command") - (tramp-find-executable vec "python" (tramp-get-remote-path vec)))) + (or (tramp-find-executable vec "python" (tramp-get-remote-path vec)) + (tramp-find-executable vec "python2" (tramp-get-remote-path vec)) + (tramp-find-executable vec "python3" (tramp-get-remote-path vec)))= )) =20 (defun tramp-get-remote-uid-with-python (vec id-format) (tramp-send-command-and-read @@ -5264,8 +5266,8 @@ (format "%s -c \"%s\"" (tramp-get-remote-python vec) (if (equal id-format 'integer) - "import os; print os.getuid()" - "import os, pwd; print '\\\"' + pwd.getpwuid(os.getuid())[0] + '\= \\"'")))) + "import os; print (os.getuid())" + "import os, pwd; print ('\\\"' + pwd.getpwuid(os.getuid())[0] + '= \\\"')")))) =20 (defun tramp-get-remote-uid (vec id-format) (with-tramp-connection-property vec (format "uid-%s" id-format) @@ -5305,8 +5307,8 @@ (format "%s -c \"%s\"" (tramp-get-remote-python vec) (if (equal id-format 'integer) - "import os; print os.getgid()" - "import os, grp; print '\\\"' + grp.getgrgid(os.getgid())[0] + '\= \\"'")))) + "import os; print (os.getgid())" + "import os, grp; print ('\\\"' + grp.getgrgid(os.getgid())[0] + '= \\\"')")))) =20 (defun tramp-get-remote-gid (vec id-format) (with-tramp-connection-property vec (format "gid-%s" id-format) # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWfkFh8UAAqlfgGwwUP///34E Qk7////wUAWWW8u7ptYW4C1oapoSUQJG9AmmEGjIaAk9J6gADQDQ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TJdIXEddcx24Yut pxOBRjmYNhmGI40YCuJ0wn8j1hHO4J75QmwfZBkXbZcFmEO5kfk0yLzWYiSK1Q0PYtRfPl0YJmrD XjKkEiTEwUaOq8caIcC3LSmeDcwarT0DSqHT3KAee9YgMnA3nmOovWEFmOCwCQiqhoZkS3i3FIbs SUWkcqjFlmHdd8MCHE3zY4pzAZIwSZiBmNdk49tmPWMbefwQ8mtcRyiMoqjGg6QwIF1RRMj44rao HGZE3JDzuwTft+NixDMyYt+k2VWIr9aRuQVIlAKN5oBg6hEDU4qLV+2B3S15QMeK9VKWqwfyNOFy WRCgRVATHdWkTRbBbAGrFRXECfPzgUMnoXsKcNQRRck2jptCYObfvmIFLy1Bo/uo7S1bl0CrGhrs dJSW6Oi5HEE67ETKJMGMksbNMAnZpZMmDUpIomCzjoHbUmQXZWAwwDkXENLqdukZjBEU5kSEuaM9 SUALea1Zg3ynbw1Cor4idSYUYGCjgan2S7brozlxCe82IZJdT7eWMikWnAM8dYTUIGwJ2QPSGcM/ lSmotzhbJVxTVXOkTSZZcSVViKVVuW5i9+LcSpgSEQ1u8GhTjHq7tGSXFgHfvDIJ9Ro6RWkDlJeH kCO1IkGlbgIIvpZbw8ZJNmZSZ6E5aF/xdyRThQkPkFh8UA=3D=3D From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 15:11:56 2014 Received: (at 18118-done) by debbugs.gnu.org; 28 Jul 2014 19:11:56 +0000 Received: from localhost ([127.0.0.1]:41263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBqKt-0003Eh-Qt for submit@debbugs.gnu.org; Mon, 28 Jul 2014 15:11:56 -0400 Received: from mout.gmx.net ([212.227.15.19]:52039) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBqKn-0003EQ-6l for 18118-done@debbugs.gnu.org; Mon, 28 Jul 2014 15:11:50 -0400 Received: from detlef.gmx.de ([87.146.56.2]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MQiVh-1X4Sz10Jfp-00U4Zm; Mon, 28 Jul 2014 21:11:38 +0200 From: Michael Albinus To: eclig@gmx.net Subject: Re: bug#18118: Support for Python3 in TRAMP's `tramp-get-remote-uid-with-python' References: <87ppgqan40.fsf@gmx.net> Date: Mon, 28 Jul 2014 21:11:36 +0200 In-Reply-To: <87ppgqan40.fsf@gmx.net> (eclig@gmx.net's message of "Sun, 27 Jul 2014 16:32:31 +0200") Message-ID: <8761ihti1j.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:RkyZNa+xIIK5gzdTDW1MsWSs8LbFO4hEMZd2hDyEWe1n3nOb9w9 KRhwVohPKV3Dzbb7mpLBRERg9A8zKmAEY7sfi61UqfSq+xY0zd7m+GEUycVo00xt9BdWjzS wZpT/BOpE54SSbU9wQjD8gW2PTHGxtguolmzvbWD+sAOv+qnf0t7xrsPV+NaSl5K/AUnO5B ycl8Q5jg+GEO+vQZLsR1g== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18118-done Cc: 18118-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.0 (/) eclig@gmx.net writes: > Dear Emacs maintainers, Hi Em=C3=ADlio, > the following patch makes possible to use TRAMP to connect to systems > where both `perl' and `id' are missing and where the Python program is > called `python3'. Note that the syntax `print foo' is invalid in > Python3 since there `print' is a function, whereas in Python2 it is/was > a statement. The syntax `print(foo)' works in both cases and it's what > I used bellow. I don't use Python. However, your patch looks reasonable to me, so I've applied it to the trunk. Closing the bug. > Regards > > Em=C3=ADlio Thanks for your report, and best regards, Michael. From unknown Sun Sep 07 12:44:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 26 Aug 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator