From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0I7+BmulvGFuggEAgWs5BA (envelope-from ) for ; Fri, 17 Dec 2021 15:57:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 4P2NAmulvGEWfQAAbx9fmQ (envelope-from ) for ; Fri, 17 Dec 2021 14:57:47 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D1FC6EE71 for ; Fri, 17 Dec 2021 15:57:46 +0100 (CET) Received: from localhost ([::1]:41796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myEg5-0003cj-Q1 for larch@yhetil.org; Fri, 17 Dec 2021 09:57:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myEQs-00028w-UI for bug-guix@gnu.org; Fri, 17 Dec 2021 09:42:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55038) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1myEQs-0001gi-LG for bug-guix@gnu.org; Fri, 17 Dec 2021 09:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1myEQs-0005fz-IX for bug-guix@gnu.org; Fri, 17 Dec 2021 09:42:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#52269: [core-updates-frozen] sitecustomize.py does not honor .pth files Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 17 Dec 2021 14:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52269 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Lars-Dominik Braun Received: via spool by 52269-submit@debbugs.gnu.org id=B52269.163975210921796 (code B ref 52269); Fri, 17 Dec 2021 14:42:02 +0000 Received: (at 52269) by debbugs.gnu.org; 17 Dec 2021 14:41:49 +0000 Received: from localhost ([127.0.0.1]:38351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myEQf-0005fU-Ge for submit@debbugs.gnu.org; Fri, 17 Dec 2021 09:41:49 -0500 Received: from mail-qv1-f48.google.com ([209.85.219.48]:42673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myEQd-0005fF-4K for 52269@debbugs.gnu.org; Fri, 17 Dec 2021 09:41:47 -0500 Received: by mail-qv1-f48.google.com with SMTP id p3so2514239qvj.9 for <52269@debbugs.gnu.org>; Fri, 17 Dec 2021 06:41:47 -0800 (PST) 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=cuC0YuvjNGH6j2+033I9vm5kW5JHzcb5Yh4ewHHl1ys=; b=QzECC2mo03BqZjOLK90Rt3SGqQllVE6L77RhRR9PvAGO3Q6reyxEQHxeCS4bkq5US3 VFBGr1lnzusMHCXAwxBg2gWRfm6ZRkKMJEiT6VXRd51SQvBFjUHBxg/geQQsAqr3XxAX FBseEIUkAW+fY4uc5AEO+w/RIaj9Ts4OEDBa7f+fQylzTQNS/DFrkapwQV6hPzZUiL8n h0nZZA6yWKYa1HZPW+GRulJYvDtoQHAhI68EFWIubJ2AvzbwMtTccl8Jb17lH7GeKR9m 0EvlZ8tbc1ZvyI6ihPMDuq0AGNGRB49kOeoqHhvLFM5G9ADMnvJg6bYLx9697ryUUtYv VHVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=cuC0YuvjNGH6j2+033I9vm5kW5JHzcb5Yh4ewHHl1ys=; b=aoWeGMTt8YfUVVPu81sg2EYtwXicfC7OdlRvZEYF6uy7PSZb3rdah2RJj1TYWCm3UO 2OTZRnI9gyu4ig7Ut92Wfr/x9bc69JMztoE1+4oG4m/6PzO+/7jY1p9kLBTpjubQQtn8 x3i5ZEC17YSohd6hQ2/jdvO5MN7F46M1F7VSoyT6U8DaFPABaKKbnvxikke80WgqtOkN hPsSbgAO3LHdNnaH9bZTsqT1zBiGJCW7TL01yj3qbqBUm2whVysK5BnLJR7g/wDKga+p SNTmsmlQW1gCMsInb+Kp/Mf9PaqIGpPsj72chfo6KkVwQ8ZYoRQnwjuFk1bmEAY5Jtxr VK1Q== X-Gm-Message-State: AOAM531XX0nUCUYkqoQdjkkYH6oJeUMUwG5ncA5BAV+oTBc9DXzxacuK vnYBDC0lJLTZ+DlBLeggLQxfjIu5SzI= X-Google-Smtp-Source: ABdhPJy10P3vG6n5eVLyn5d2zjpERoAREzT8x1xj+xHgxbA8BXSIs4bIF2DbivzMPPQITAbrWDvyzA== X-Received: by 2002:ad4:5961:: with SMTP id eq1mr2514426qvb.110.1639752101328; Fri, 17 Dec 2021 06:41:41 -0800 (PST) Received: from hurd ([207.35.95.41]) by smtp.gmail.com with ESMTPSA id c7sm7302378qtc.32.2021.12.17.06.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 06:41:40 -0800 (PST) From: Maxim Cournoyer References: <871r2taxcm.fsf@gmail.com> <87ee6gcomm.fsf_-_@gmail.com> Date: Fri, 17 Dec 2021 09:41:39 -0500 In-Reply-To: (Lars-Dominik Braun's message of "Thu, 16 Dec 2021 10:48:55 +0100") Message-ID: <87h7b770po.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 52269@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639753066; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=cuC0YuvjNGH6j2+033I9vm5kW5JHzcb5Yh4ewHHl1ys=; b=AcsU9lg4uPRrHQEEg632ilSlJxdaOwhT0OHkvOjWDdcVrevgwS7ugf7wGPPib5ADggqe4B asZ7KdVXd4BMD0ymjTJJ6pZcbHsI52MEP23NAf4sUAn6AzQ5hUjz1nAMjD0TijnuNcKeoq wv+xmQXjdrK1pUiK/pF8h0y7cf0jHbhyXoVvRFhPSRJRwDxGdG7LBBw6fS1gX44+v+CChI nsDrb+m5drj5OEMU2Xrr0+hLxIbq0CUOSRXCiTTgiJBKtMbVqfVGt/zFBOltnxu63acLwI KtxnUXYNhHZmUEONfEFe7V2bt42zbkZBAHeb/kuZlCphvdRDjDacj730Fsyulw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639753066; a=rsa-sha256; cv=none; b=rks2M9SIx5Csl2gBnZdGbcjOhUAHqW0EnEQDONcvRfZfPRQNPqZTwD5nsPQN0xXjDXwgod vQzZp+dfpnwtMOhfZCsQ83u/KEr9uefPyo7RvgFNw4buO3fWseTn4b9i5IVSCumHQ5vj04 I6rZd1oGlj57Qgkzm+Ia39UR0XsvWhu7lA/IEHVZ8Q+978yGCUkvD1WAWZRSUwEy+97Ugk wrZQfkO7NujVbnFluw4iCtlt0/c66J3b9/7vD2gCNGtOvpMhJp6CYmY6yAFPjkKbGIgBRF zqi36e9Ss4E5VN5W6f05mk/UMhdqQ0FSMrxFzJ+h3PsahT1PkKyjCNFijG5H0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QzECC2mo; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QzECC2mo; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D1FC6EE71 X-Spam-Score: -2.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: l5DXcJBA474h Hello! Lars-Dominik Braun writes: > Hi Maxim, > >> You can test it by placing the new sitecustomize.py file in the current >> directory, and then: > that works, thanks! > >> I agree that after it's un-bundled it shouldn't be necessary anymore, but >> let's keep this change for core-updates along work on the 517 >> python-build-system (I'll try having a look to it after the next release >> it out -- ping me otherwise). > Sure. > >> + # Move the entries that were appended to sys.path in front of >> + # Python's own site-packages directory. This enables Guix >> + # packages to override Python's bundled packages, such as 'pip'. >> + python_site_index = sys.path.index(python_site) >> + new_site_start_index = sys.path.index(matching_sites[0]) > One more nitpick: list.index() will raise a ValueError if the requested > value does not exist. I believe setting GUIX_PYTHONPATH=/nonexistent > will trigger this. It doesn't break when I try it here: $ PYTHONPATH=. GUIX_PYTHONPATH=/nonexistent python sample.py Also, messing with GUIX_PYTHONPATH is something users shouldn't do unless they really know what they are doing, in my opinion. It's intended as Guix's own mechanism to discover Python packages. Users can and should still use PYTHONPATH if they want to mess with Python's module search path. Thank you! Maxim