From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: python.el: why remove '' from sys.path? Date: Sun, 15 Mar 2009 21:07:04 -0400 Message-ID: <871vsy8edj.fsf@cyd.mit.edu> References: <36366a980903131140p7a66c5a2ncabec4df11edcce1@mail.gmail.com> <36366a980903131158m33544fa8u4083c036aca55720@mail.gmail.com> <87eiwy7atr.fsf@ashbery.wjsullivan.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1237165564 13484 80.91.229.12 (16 Mar 2009 01:06:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Mar 2009 01:06:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: John Sullivan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 16 02:07:19 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lj1IU-0007cd-Uv for ged-emacs-devel@m.gmane.org; Mon, 16 Mar 2009 02:07:19 +0100 Original-Received: from localhost ([127.0.0.1]:53539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lj1H8-0001sH-Th for ged-emacs-devel@m.gmane.org; Sun, 15 Mar 2009 21:05:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lj1H4-0001sC-BU for emacs-devel@gnu.org; Sun, 15 Mar 2009 21:05:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lj1Gz-0001s0-Eb for emacs-devel@gnu.org; Sun, 15 Mar 2009 21:05:49 -0400 Original-Received: from [199.232.76.173] (port=54913 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lj1Gz-0001rx-AL for emacs-devel@gnu.org; Sun, 15 Mar 2009 21:05:45 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:38977) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lj1Gy-00071F-Vk for emacs-devel@gnu.org; Sun, 15 Mar 2009 21:05:45 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 3767157E21C; Sun, 15 Mar 2009 21:07:04 -0400 (EDT) In-Reply-To: <87eiwy7atr.fsf@ashbery.wjsullivan.net> (John Sullivan's message of "Sun, 15 Mar 2009 17:09:04 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109646 Archived-At: John Sullivan writes: > Why wouldn't the answer be to move '' to the end of sys.path, so that > overloading the emacs module with something malicious in the current > directory wouldn't be possible? Or how about checking the permissions of > the current directory before removing '' from the path? Or checking an > expected hash of the emacs and other imported-by-default modules? > > Having the current working directory be in the python path is pretty > important to me and I think to other people as well. Moreover having the > emacs python shell behave too differently from the standard python shell > is a hassle. I'm open to revisiting this. IIRC, the issue with checking permissions before removing '' from sys.path is that we weren't sure this would DTRT on platforms like Windows. As for moving '' to the end of sys.path, that would itself be an incompatibility. One thing to keep in mind here is that it may not be obvious to the user that she is executing python code---if I understand correctly, the python shell can be launched automatically when eldoc mode is on.