From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Philip K." Newsgroups: gmane.emacs.bugs Subject: bug#41619: [PATCH] Mark python-shell-virtualenv-root as safe local variable Date: Sat, 30 May 2020 22:31:09 +0200 Message-ID: <87367htbaq.fsf@warpmail.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="68382"; mail-complaints-to="usenet@ciao.gmane.io" To: 41619@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 30 22:32:55 2020 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 1jf8A2-000HlD-T3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 May 2020 22:32:55 +0200 Original-Received: from localhost ([::1]:45664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jf8A1-0003H7-Lu for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 May 2020 16:32:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jf89D-0003Gv-0i for bug-gnu-emacs@gnu.org; Sat, 30 May 2020 16:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jf89C-0008ES-N6 for bug-gnu-emacs@gnu.org; Sat, 30 May 2020 16:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jf89C-000833-JQ for bug-gnu-emacs@gnu.org; Sat, 30 May 2020 16:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Philip K." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 May 2020 20:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41619 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159087069130885 (code B ref -1); Sat, 30 May 2020 20:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 May 2020 20:31:31 +0000 Original-Received: from localhost ([127.0.0.1]:59269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jf88g-000825-Pp for submit@debbugs.gnu.org; Sat, 30 May 2020 16:31:31 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:47886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jf88e-00081x-KD for submit@debbugs.gnu.org; Sat, 30 May 2020 16:31:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jf88e-0003Bs-CM for bug-gnu-emacs@gnu.org; Sat, 30 May 2020 16:31:28 -0400 Original-Received: from mx-rz-2.rrze.uni-erlangen.de ([2001:638:a000:1025::15]:41591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jf88b-00086W-Ib for bug-gnu-emacs@gnu.org; Sat, 30 May 2020 16:31:27 -0400 Original-Received: from mx-rz-smart.rrze.uni-erlangen.de (mx-rz-smart.rrze.uni-erlangen.de [IPv6:2001:638:a000:1025::1e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mx-rz-2.rrze.uni-erlangen.de (Postfix) with ESMTPS id 49ZCkm4FCgzPkBD for ; Sat, 30 May 2020 22:31:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fau.de; s=fau-2013; t=1590870672; bh=+rcjzUma6DiwuAVLs6Gv55ygt28jS5dO3fyLz3LSYzU=; h=From:To:Subject:Date:From:To:CC:Subject; b=DUFuerZ1adgiPjTN6Mn0IRvYGpMCdGEoZgwM2rWt6nrB+SXyjMdrQbvrk0mzMt7zC lAF1kfTBpKKLUHZKeBSuXUMb5++x4B74qZcXQxBKlzROGkt3KyRHJPMmWv8bsPwSVR lJn/D6zkeO/r+rl5pxIfbuRT0YOxd2WdwC88Y1eif2XWYoSiTJt3MYB+EfZqyx5vhZ lo1HKkArjXOjzlPrqpy7OOQ0NU/SNDzCexepdICF8CvTK+VsZmbS+THXxI41dE3FnS 7Mo90cKhzEFt0/M0sCvKZN4TSeGXWf5SsVoLOgcqGP2Nr+uHUJPSLpPVh3BPa2ZRiG nXklEXJVSgsVg== X-Virus-Scanned: amavisd-new at boeck1.rrze.uni-erlangen.de (RRZE) X-RRZE-Flag: Not-Spam X-RRZE-Submit-IP: 79.219.206.245 Original-Received: from localhost (p4fdbcef5.dip0.t-ipconnect.de [79.219.206.245]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: U2FsdGVkX19gYlNFsbjaXgx8GC1FBUKZsq5Ip32bJEs=) by smtp-auth.uni-erlangen.de (Postfix) with ESMTPSA id 49ZCkk2nHzzPjsT for ; Sat, 30 May 2020 22:31:10 +0200 (CEST) Received-SPF: pass client-ip=2001:638:a000:1025::15; envelope-from=philip.kaludercic@fau.de; helo=mx-rz-2.rrze.uni-erlangen.de X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:181261 Archived-At: --=-=-= Content-Type: text/plain Hi, I was trying to work with python today and it required me to use a virtual environment. I noticed that python-mode already had some basic virtualenv facilites, and it all worked. The only thing that annoyed me was that I couldn't configure the setup to be properly persistent, since python-shell-virtualenv-root couldn't be set as a directory local variable. The commentary section mentions > ;; (setq python-shell-virtualenv-root "/path/to/env/") but I couldn't find any other details on how the mode expects me to set the variable. Therefore I patched the few lines, and it works great. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Mark-python-shell-virtualenv-root-as-safe-for-direct.patch >From 31beb4931ae7800e719ac470ba8bd14a977f765c Mon Sep 17 00:00:00 2001 From: Philip K Date: Sat, 30 May 2020 21:47:51 +0200 Subject: [PATCH] Mark python-shell-virtualenv-root as safe for directories --- lisp/progmodes/python.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 1ca9f01963..f9537b4079 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2090,7 +2090,8 @@ python-shell-virtualenv-root This variable, when set to a string, makes the environment to be modified such that shells are started within the specified virtualenv." - :type '(choice (const nil) string) + :type '(choice (const nil) directory) + :safe #'file-directory-p :group 'python) (defcustom python-shell-setup-codes nil -- 2.26.2 --=-=-=--