From unknown Fri Aug 15 16:55:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52269: [core-updates-frozen] Some Python packages relying on .pth are broken Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 04 Dec 2021 03:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52269 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 52269@debbugs.gnu.org X-Debbugs-Original-To: bug-guix Received: via spool by submit@debbugs.gnu.org id=B.163858680230578 (code B ref -1); Sat, 04 Dec 2021 03:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Dec 2021 03:00:02 +0000 Received: from localhost ([127.0.0.1]:52552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtLHO-0007x4-1C for submit@debbugs.gnu.org; Fri, 03 Dec 2021 22:00:02 -0500 Received: from lists.gnu.org ([209.51.188.17]:60566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtLHK-0007wR-4G for submit@debbugs.gnu.org; Fri, 03 Dec 2021 22:00:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtLHJ-0001iF-Rw for bug-guix@gnu.org; Fri, 03 Dec 2021 21:59:57 -0500 Received: from [2607:f8b0:4864:20::836] (port=43927 helo=mail-qt1-x836.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtLHH-0008KE-Vj for bug-guix@gnu.org; Fri, 03 Dec 2021 21:59:57 -0500 Received: by mail-qt1-x836.google.com with SMTP id q14so5340042qtx.10 for ; Fri, 03 Dec 2021 18:59:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=2oXFAQdEa8lc536uALeWkocgLYySx9wJzPtQghiiLRE=; b=kGuVGJPwSaTYILJViLb3RyEnzoetvnQXzvGa/ertN70197VvBrBe3+4JJgfu0eUo/T JN18y6lekZChDM1z1qauIz6hDYBKXt4IZrr+oP68JHfIVQLV4FpPxlFBQNk2bxIt80gj 3SSmBz75dFhkDwNSkWlRbbi/pGBfRObVIdB285JxCA+UXlNlFHLaccsxZS0dSekvfBD6 ofKcQYI7C0lvMxayPncobOOd5dJ3JjXKm4EKA74il/4+o7xjWQXSHFwMxcktVF29+cuu SGri6AthT6LwuIvA5rKE8c6OhfXQRt1B6dX8ZT7SDp/f76+aAv9ou+AumsnM2jNy+rcR G++w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=2oXFAQdEa8lc536uALeWkocgLYySx9wJzPtQghiiLRE=; b=gBd8rwgsWKytD/I9DPUGHx4xeGDDJDZ/v+5cyFqPoZpOnUocl2FHW8lkL31IZXGFqZ 0/KSoMc+QvYJ5Wx2tGiQSexgLPEeSUZhkK5bsIbFDEkQs0fkOKnrGz6/TEWzx2aun/Ix +3NZFJPd721iGeibqYBp6yy+IHU3wtvMTcPSVhjdljiZ/6tPrGEq0IHboZD20jd1nxdv xcxbAWTZ4fsQ28kh31WMdy9MDdLzHiiwZqx8epgADrqq0vP1Whvxti8y13nA7Nb0N42v CwildSmYCv+0WD8QXa7QtQ+Npae3dEmG4rs5BrjIkPoTeObEK74/OszP5xE3O5AM8ROS RBBA== X-Gm-Message-State: AOAM530F9JAxCi2Rwg6UP1anuei9+cLAVg2mCuB0ocvciZUSFEihNIVM Pr9d9vWC1HLJhwdIWRKEKdDRIRugrN8= X-Google-Smtp-Source: ABdhPJxK+kTjetxpgs+u00VbleH9A7Z+3zeQEO3QmWB/NgAAeHxSiT7dWe8np7c8xCQ5/o1JYjqtSg== X-Received: by 2002:a05:622a:54d:: with SMTP id m13mr24798570qtx.33.1638586794702; Fri, 03 Dec 2021 18:59:54 -0800 (PST) Received: from hurd (dsl-156-29.b2b2c.ca. [66.158.156.29]) by smtp.gmail.com with ESMTPSA id de13sm3162844qkb.81.2021.12.03.18.59.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 18:59:54 -0800 (PST) From: Maxim Cournoyer Date: Fri, 03 Dec 2021 21:59:53 -0500 Message-ID: <871r2taxcm.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::836 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::836; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x836.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -2.3 (--) Hello Guix, This was already something Harmut noted during their review of the site.py loader (that it should honor .pth files), but at the time I wasn't aware of a Python package that still made use of that mechanism and thought it was legacy. To my dismay it seems to be used by the tool 'pdbpp', which is an improved pdb (debugger) for Python; using core-updates-frozen I noticed that it was no longer in use; looking at its installed files I see: --8<---------------cut here---------------start------------->8--- pdbpp_hijack_pdb.pth --8<---------------cut here---------------end--------------->8--- So I'm guessing that because the new loader doesn't handle .pth files its "hijacking" technique doesn't work. Unfortunately touching this site.py file would causes a massive rebuild (of the whole Python world). Hopefully this use of .pth is a rare occurrence and can be worked around. Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 03 22:15:29 2021 Received: (at control) by debbugs.gnu.org; 4 Dec 2021 03:15:29 +0000 Received: from localhost ([127.0.0.1]:52578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtLWL-0000Le-6e for submit@debbugs.gnu.org; Fri, 03 Dec 2021 22:15:29 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:36596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtLWG-0000CJ-Hv for control@debbugs.gnu.org; Fri, 03 Dec 2021 22:15:27 -0500 Received: by mail-qt1-f178.google.com with SMTP id t11so5401863qtw.3 for ; Fri, 03 Dec 2021 19:15:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:from:subject; bh=ANpxvHHcBctBCgpRmrP5jjpNPQsPoWNw6/h4r6/f6o4=; b=mWDMwt/hc9Be0X+VWla+xqy3G/Jp32e8AzP4CqfccDt24DoW82v74Wyi6KYOT7SfQP NbkZ+QuDgfvZ5thqvCMlj65OH70Tb4fDmWdGHa3NbFHXPF7+evm94XEWkJToq7lRcftO NH3rHsTh8YQCHNo0WY4RM9c7LWdi6rk2W6yLgFy0TtBJKcNu/H9bsHZQhHN+JQwE86Eg Wh6Jw1NCYTIqICivXJ//8Yz3U6SMPWgvivvO6DOaiyPfoCxYkRkNuygflWB980/UcjOS KpZHdjua53qbDgq5Fl6pGqTNjoJPmMSmUIVJwlSinZ6FnOhcFPpAV1zksKyqQt/DxDqq 9ERw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:from:subject; bh=ANpxvHHcBctBCgpRmrP5jjpNPQsPoWNw6/h4r6/f6o4=; b=mq93X88802/bezKvIfHEYQyT3sTzOxsQOvLZ62vy/e1IGZ93n3LFSIx+yV5MLIfdx2 hUXKWj53HSqEhyGBQ6iUt3KEmrJePh/0UeJZ2CJP3yPfB/3Kt+zfTBFbJWeflfZCTM76 dxR2I9fD33Ax31gXWigXe1xIHdXUIvoaCauOw6zBoEx0R6WqOmEYYn4SvxI43YW5SLpi g1yWaXa0V8Xart4xx+RCaz85zsvVkenGBAkjX0+1nmA7zCFZb0XfTG7i3hcz6BDjiGmF WINxvGJx80a0quOC6q6AQXhDFNEXVXCTdy1kj1BSxzVJhsRBp4W5yddNjs0+0/mGbS1Z ka4g== X-Gm-Message-State: AOAM533A6FEx7k4GWFKBg6+4Z1XgugFKmo9hbIBo1jGRoK4/IyrQw6yO 2bZKg4YlEwSvn22clDMtnZzIlTdcJhA= X-Google-Smtp-Source: ABdhPJxXvlRb2ZiI3SrzCQri5V3meZp7eYkZq9mY1PvxRuCy80AVKDvV84HKgOGHiJ5+qIECkiUedQ== X-Received: by 2002:a05:622a:14:: with SMTP id x20mr24776767qtw.1.1638587718956; Fri, 03 Dec 2021 19:15:18 -0800 (PST) Received: from hurd (dsl-156-29.b2b2c.ca. [66.158.156.29]) by smtp.gmail.com with ESMTPSA id w10sm3841987qtj.37.2021.12.03.19.15.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 19:15:18 -0800 (PST) Date: Fri, 03 Dec 2021 22:15:17 -0500 Message-Id: <87v9059i2i.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #52269 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) retitle 52269 [core-updates-frozen] sitecustomize.py does not honor .pth files quit From unknown Fri Aug 15 16:55:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52269: [PATCH core-updates-frozen] sitecustomize does not honor .pth files Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 04 Dec 2021 05:37: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: To: 52269@debbugs.gnu.org, GNU Debbugs Received: via spool by 52269-submit@debbugs.gnu.org id=B52269.163859619616530 (code B ref 52269); Sat, 04 Dec 2021 05:37:02 +0000 Received: (at 52269) by debbugs.gnu.org; 4 Dec 2021 05:36:36 +0000 Received: from localhost ([127.0.0.1]:52781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtNiu-0004IS-9W for submit@debbugs.gnu.org; Sat, 04 Dec 2021 00:36:36 -0500 Received: from mail-qk1-f170.google.com ([209.85.222.170]:41646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtNip-0004I7-7N; Sat, 04 Dec 2021 00:36:34 -0500 Received: by mail-qk1-f170.google.com with SMTP id t83so5770293qke.8; Fri, 03 Dec 2021 21:36:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=Trx/zUMN1VTEHVYsdG43n1GeNumg8RVRJvaJfSjTjDA=; b=dIwPD4TpGZhXnTUVV8JG7ZTXjKiuQWL9ppU8WnAppby+f0gXRlSKo3QpuuT0Qk2Ed5 nHTTzgBTpzfBJxnMUYJNr2JEe0/BnL0j14rSQ/oWxv/2zJ1UD7L5H+g7Dp2zhAm9whTS smXxLKG1GBF/YSG+/LbIKZ1AxwB3sB9IYKdzLYSbGuhlTsA86i7Sbv6zXrTX33/7rlRy kb3zlqoi5nXoYrnyI6Mdg2tR2fJvkmOJm5BlrcUEtaOukQJVTnkAIDQmBDL1UNor5miC CLtkpkJh5kPFS5MYiXah03s7zIAsbSXroqS95mFvKUGY6kzIUXR5qrR/dcw9asUh+EM6 Ohrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Trx/zUMN1VTEHVYsdG43n1GeNumg8RVRJvaJfSjTjDA=; b=Gs0dvt0+EpTCfrQD+bDnP56SckTdHOsa/rFB8TQAhXzQoOTq5kAZ0Vp76V1TY/vac+ S/YyxCCVUvkgIH9XohnR7WnmxxXXH+9jRM7GVdMtkKFg2sYsWb1h0pFih98KO7nyIo9M RAH9GE/Bnlf5N9OxxYSLVO0EvipjptSqyWj4Njf3QYEUEReWKp9tYSVXBs218YZYzVgT fnGkFZZJkL67Irtoh8+DS94X0nV81UV+5sv/OqmDkHjB5TgqVNgyrWnrwQPIk8cDr9st Dcfc6eW9uVPuLdEOfVzKRywVH3UCsOnkYZryRCiy20d7zApsFdoZb/KCD04QimaqoiIA A7nQ== X-Gm-Message-State: AOAM5302RHFN7uUh0olgWB2yYYvJ0Tc3t4ay1j3Fg0wRzzezerco6+X4 Ao9D1qPzl0ljzCtOIsw4wrHmZfJaYic= X-Google-Smtp-Source: ABdhPJxPvf5N1gq4TsAS59rhjKh2KXokKyXMK5inMLwh6lPJtnH/BtGrha+TuFXEUpjDZyKKls+IAw== X-Received: by 2002:ae9:f716:: with SMTP id s22mr21573976qkg.212.1638596185333; Fri, 03 Dec 2021 21:36:25 -0800 (PST) Received: from hurd (dsl-156-29.b2b2c.ca. [66.158.156.29]) by smtp.gmail.com with ESMTPSA id e20sm4023223qty.14.2021.12.03.21.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 21:36:24 -0800 (PST) From: Maxim Cournoyer References: <871r2taxcm.fsf@gmail.com> Date: Sat, 04 Dec 2021 00:36:23 -0500 In-Reply-To: <871r2taxcm.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 03 Dec 2021 21:59:53 -0500") Message-ID: <87mtlh9bjc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) --=-=-= Content-Type: text/plain tags 52269 patch thanks Hi! The following patch fixes it. I used site.addsitedir but ensured the correct ordering of sys.path (we need to make the Guix-installed packages appear before Python's own site-packages directory otherwise we wouldn't be able to override its bundled packages such as 'pip'). Here's how I tested: Copy the sitecustomize.py file to the current directory, then: --8<---------------cut here---------------start------------->8--- $ pip --version pip 21.1.3 from $HOME/.guix-profile/lib/python3.9/site-packages/pip (python 3.9) $ guix show python-pip | recsel -p version version: 20.2.4 --8<---------------cut here---------------end--------------->8--- Ensure installed pip still overrides Python's own. PYTHONPATH=. forces the sitecustomize.py file in the CWD to take precedence over the one currently installed along Python. --8<---------------cut here---------------start------------->8--- $ guix shell --pure python python-pip python-pdbpp [env]$ PYTHONPATH=. python3 -c 'import pip; print(pip.__version__)' 20.2.4 --8<---------------cut here---------------end--------------->8--- Next I created a dummy script to trigger run pdb: #file: test.py print('hello') import pdb; pdb.set_trace() --8<---------------cut here---------------start------------->8--- $ guix shell --pure python python-pip python-pdbpp [env]$ python3 test.py hello > /tmp/toto/test.py(7)() -> exit(1) (Pdb) --8<---------------cut here---------------end--------------->8--- This is the current bug; this is the regular Pdb, not Pdbpp. Let's force our revised sitecustomize.py file: --8<---------------cut here---------------start------------->8--- $ PYTHONPATH=. python3 test.py hello [0] > /tmp/toto/test.py(7)() -> exit(1) (Pdb++) --8<---------------cut here---------------end--------------->8--- Better! --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-sitecustomize.py-Honor-.pth-files.patch >From 762357609270ab016236d22999ae5cfc3fe4ff28 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 3 Dec 2021 22:36:26 -0500 Subject: [PATCH] sitecustomize.py: Honor .pth files. Fixes . * gnu/packages/aux-files/python/sitecustomize.py: Use site.addsitedirs to add the site directories; this takes care of the .pth files. Make sure the added items still appear before Python's own 'site-packages' directory. --- .../aux-files/python/sitecustomize.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/gnu/packages/aux-files/python/sitecustomize.py b/gnu/packages/aux-files/python/sitecustomize.py index 71e328b9ac..bdaaa8e9e2 100644 --- a/gnu/packages/aux-files/python/sitecustomize.py +++ b/gnu/packages/aux-files/python/sitecustomize.py @@ -18,6 +18,7 @@ # along with GNU Guix. If not, see . import os +import site import sys # Commentary: @@ -47,9 +48,20 @@ all_sites_norm = [os.path.normpath(p) for p in all_sites_raw] matching_sites = [p for p in all_sites_norm if p.endswith(site_packages_prefix)] -# Insert sites matching the current version into sys.path, right before -# Python's own site. This way, the user can override the libraries provided -# by Python itself. -sys_path_absolute = [os.path.realpath(p) for p in sys.path] -index = sys_path_absolute.index(python_site) -sys.path[index:index] = matching_sites +if not matching_sites: + exit(0) + +# Deduplicate the entries, append them to sys.path, and handle any .pth files +# they contain. +for s in matching_sites: + site.addsitedir(s) + +# 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]) +if python_site_index < new_site_start_index: + sys.path = (sys.path[:python_site_index] + + sys.path[new_site_start_index:] + + sys.path[python_site_index:new_site_start_index]) -- 2.34.0 --=-=-=-- From unknown Fri Aug 15 16:55:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52269: [PATCH] sitecustomize.py: Honor .pth files. References: <871r2taxcm.fsf@gmail.com> In-Reply-To: <871r2taxcm.fsf@gmail.com> Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 06 Dec 2021 08:44: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: Maxim Cournoyer Cc: 52269@debbugs.gnu.org Received: via spool by 52269-submit@debbugs.gnu.org id=B52269.163878019217768 (code B ref 52269); Mon, 06 Dec 2021 08:44:02 +0000 Received: (at 52269) by debbugs.gnu.org; 6 Dec 2021 08:43:12 +0000 Received: from localhost ([127.0.0.1]:60484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mu9aZ-0004cV-MG for submit@debbugs.gnu.org; Mon, 06 Dec 2021 03:43:11 -0500 Received: from mout-p-101.mailbox.org ([80.241.56.151]:27836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mu9aW-0004c9-GK for 52269@debbugs.gnu.org; Mon, 06 Dec 2021 03:43:10 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4J6xlT60wvzQkBn; Mon, 6 Dec 2021 09:43:01 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1638780179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mro54vXASUDT44XMbXa0FrEva3PWS2ilAD4vwHEfjxk=; b=oA9sBZ/EZfgkDStq3IVSo99BuQ/CYtfxUclWJmQXh3bHgu0fda//qM2U2edkSqM48RUOuG sxgvOLLrs5oPxYHiCEcwdEK0B3W5wFERlwZ/EtZVAbyhQXWFfPtofe8H7evy6agM52wcJu L94PebKxyBUka0nx+1ExrMgfmZTw9GRV55uFXh8ywXLFl6h+iFSce/GSoC7gxLPTqJD8+J uUnUsyBmrXsa4iAbPFpjHZdDmERyGGhwzxD9hA1vozO70M/XA9TifpusYlxpcerkze7RYK Y/AWkWjGaFF6cBLihlQPznH2hP2vyavugFpef67TZaTcX8Yhc+x2I5nwYBJCeA== Date: Mon, 6 Dec 2021 09:42:56 +0100 From: Lars-Dominik Braun Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.7 (-) Hi Maxim, > +if not matching_sites: > + exit(0) are you sure about using `exit()` here? sitecustomize.py is imported during startup and this would simply quit the Python interpreter if GUIX_PYTHONPATH is not set, wouldn’t it? (Can’t test the change unfortunately, because it’s a massive rebuild.) > +# 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]) > +if python_site_index < new_site_start_index: > + sys.path = (sys.path[:python_site_index] > + + sys.path[new_site_start_index:] > + + sys.path[python_site_index:new_site_start_index]) This is unrelated to the pdb issue, right? I see that it’s necessary right now, but as suggested in #46848 I’d prefer unbundling setuptools/pip from python. (I’ll send a v3 of the patchset at some point.) Cheers, Lars From unknown Fri Aug 15 16:55:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52269: [core-updates-frozen] sitecustomize.py does not honor .pth files Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 13 Dec 2021 10:13: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: Maxim Cournoyer Cc: Lars-Dominik Braun , 52269@debbugs.gnu.org Received: via spool by 52269-submit@debbugs.gnu.org id=B52269.16393903472650 (code B ref 52269); Mon, 13 Dec 2021 10:13:02 +0000 Received: (at 52269) by debbugs.gnu.org; 13 Dec 2021 10:12:27 +0000 Received: from localhost ([127.0.0.1]:54198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwiJm-0000gg-R5 for submit@debbugs.gnu.org; Mon, 13 Dec 2021 05:12:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwiJi-0000gG-A2 for 52269@debbugs.gnu.org; Mon, 13 Dec 2021 05:12:25 -0500 Received: from [2001:470:142:3::e] (port=54598 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwiJc-00046z-5h; Mon, 13 Dec 2021 05:12:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=GNrU/lkNwY+dcfHbf3gyjMYZ4sWZ5/HirwA4+SMPnvM=; b=RjShbEEu/GtBVYSkq6hL CYwkVw8afRXKlYSUcVPj+4SlpNmsNvaPJ7jGP8SZEZj3EcE1mQIGxxSFys8B42MdpdUDm7aNom3/o AnM4f7k+wJgG1lef2wiJc0YNvm40Gw/RQ67IOoa3ETX5nzXHPY/yFXSOaFpSpTvUASqpEJlhafhSJ n2NX+AZjqb2Q3hf55GW2JRHYzYFVEHcT6ApB3gre5n01r9n0ceknNj+p1hPnqMvXCk4Yv88Mb9i54 o7XNbMHb2vH7qkK/bwuuuFjdk2gTwV+R028wMAGdYpjsleHd4hiXpjEpvI/KFQDc8UrocSb1Cl2fe RXVpUq9MMdQyyg==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43402 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwiJb-0005tc-IY; Mon, 13 Dec 2021 05:12:16 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <871r2taxcm.fsf@gmail.com> <87mtlh9bjc.fsf@gmail.com> Date: Mon, 13 Dec 2021 11:12:12 +0100 In-Reply-To: <87mtlh9bjc.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 04 Dec 2021 00:36:23 -0500") Message-ID: <875yrs3jb7.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) Hello Maxim, Maxim Cournoyer skribis: >>>From 762357609270ab016236d22999ae5cfc3fe4ff28 Mon Sep 17 00:00:00 2001 > From: Maxim Cournoyer > Date: Fri, 3 Dec 2021 22:36:26 -0500 > Subject: [PATCH] sitecustomize.py: Honor .pth files. > > Fixes . > > * gnu/packages/aux-files/python/sitecustomize.py: Use site.addsitedirs to= add > the site directories; this takes care of the .pth files. Make sure the a= dded > items still appear before Python's own 'site-packages' directory. I had completely overlooked this patch. Lars had useful comments about it. Do we need to address this before we merge =E2=80=98core-updates-frozen=E2= =80=99 into =E2=80=98master=E2=80=99? If so, what changes need to be made to the patch before it can be applied? TIA! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 13 05:12:41 2021 Received: (at control) by debbugs.gnu.org; 13 Dec 2021 10:12:41 +0000 Received: from localhost ([127.0.0.1]:54202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwiK1-0000h8-2Y for submit@debbugs.gnu.org; Mon, 13 Dec 2021 05:12:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwiJz-0000gv-0v for control@debbugs.gnu.org; Mon, 13 Dec 2021 05:12:39 -0500 Received: from [2001:470:142:3::e] (port=54604 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwiJt-0004A4-6o for control@debbugs.gnu.org; Mon, 13 Dec 2021 05:12:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=TmTl99hzc+neJIpdG3nqA0iMQUTLAf+XBGwc3qBxBjg=; b=l/MC/EImKPhRta TnH+3kuEAqSzkAQT8O3omHeAuquXpFN85MWNmImXnIEvdwbXlu0WBBYYNulMpwH5eFaSykoiAC++8 b3afy9ii4POFSx89FEd797zjdHSA/Ji/LowHfejQHuY2UvoNEBknTlmEFqO3GDHg7bNTznFpuIN5G selSWId4ocC3qXpiN6EP1YFCfNYErwrxwfdElYd45USilG3huqDlc79ZEc5N91x7JPZ7hV3GaUTLF RvbBMO4jmK8qSMM16hYEx7gOT/PbEvZYTxC5IGUyExSalixr7Uq65esJvn+dTke/MAeh9LZ41QQ2f 1Ce1O1AbUjj5Ck6tBhzg==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43406 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwiJs-0005vF-3t for control@debbugs.gnu.org; Mon, 13 Dec 2021 05:12:32 -0500 Date: Mon, 13 Dec 2021 11:12:29 +0100 Message-Id: <874k7c3jaq.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #52269 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) severity 52269 important quit From unknown Fri Aug 15 16:55:50 2025 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: Mon, 13 Dec 2021 14:11:01 +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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Lars-Dominik Braun , 52269@debbugs.gnu.org Received: via spool by 52269-submit@debbugs.gnu.org id=B52269.163940464810557 (code B ref 52269); Mon, 13 Dec 2021 14:11:01 +0000 Received: (at 52269) by debbugs.gnu.org; 13 Dec 2021 14:10:48 +0000 Received: from localhost ([127.0.0.1]:54454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwm2R-0002kD-N7 for submit@debbugs.gnu.org; Mon, 13 Dec 2021 09:10:47 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:34447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwm2P-0002jz-Nh for 52269@debbugs.gnu.org; Mon, 13 Dec 2021 09:10:46 -0500 Received: by mail-qv1-f49.google.com with SMTP id i13so14474661qvm.1 for <52269@debbugs.gnu.org>; Mon, 13 Dec 2021 06:10:45 -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:content-transfer-encoding; bh=G36pNdo1NUOX1cFbbCBwTT0bXA4O6N9h3T/o1xwR8Vc=; b=kQlMOuJbXKaxymEtELtoEwO/Mz0UgxwEamn1T4psWBQvsRXKgekUXx7ubkueQMucOn kKNecX5RbEz4kv1PmVeqyN2+IQghMLsYCo2THMBN3lLypjJO0Ydg7qKJv+lAHoUHX+UU iGsY0UeH1jXgZE2U132l9lwGU5fT3kYMOeXZEsWFhVrdB47ViH8EnR4VyrAafANx21nm C7H9tOZsXFvUPJigNOUH5YeWXUSDpx7ucky+Pt7x/VnwWH0UVMGm9qhJH91U/vI5CVcJ nQOyoJKmdLhSPET8J2P8iImoPbvIoyUr4TMZvH34P3UNzszO5kKoz7tinBVHYdCMhUcE 4d4w== 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:content-transfer-encoding; bh=G36pNdo1NUOX1cFbbCBwTT0bXA4O6N9h3T/o1xwR8Vc=; b=e4hvfsQzzwWx1qoOPobmhb11evbuPEYGFJGZDroa9UFYTLBdUVR/VObM+irkw2Ao1W zJCzYuxd+nO05SyUX5dU8XzGYzeNUc2u62nWO5b+hquW0nPaOmQ4u4Mq7bGX1zaXnDlZ 9MbivrDeJmXfjjLDQeHyyIg237PdvLd3Z7k1dx5Ga0SMZljM+rrXJwju9sfrvAjZZgOb 814G+7rewG1guydDCbRrwiTxvAgYpucUhNllVJ+dZpOE590vhhm1pU+HdSh9BRr/tA1n L4UNPM96aKUxPX3tPKt5ohyjLtWhAmmSp3lNJAYFC5izc/PA7/35aOJ/RTZYSkcwrg8t UO3g== X-Gm-Message-State: AOAM530lgE6xBrjprdscwWjFPWH+mgv7NQAMxfCq4syiJneeFuGXqMlz CirddpDIJa4byuK42Vs9R54= X-Google-Smtp-Source: ABdhPJxh65IpwcjQB3NwAZ3eXiVJZeW1MsEhnne/b6uaF5/xn1AXgo9jIHFBtAgsx7r3H1e6JXEAUQ== X-Received: by 2002:ad4:41c3:: with SMTP id a3mr42043424qvq.51.1639404640129; Mon, 13 Dec 2021 06:10:40 -0800 (PST) Received: from hurd (dsl-10-141-188.b2b2c.ca. [72.10.141.188]) by smtp.gmail.com with ESMTPSA id w9sm6017404qko.71.2021.12.13.06.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 06:10:39 -0800 (PST) From: Maxim Cournoyer References: <871r2taxcm.fsf@gmail.com> <87mtlh9bjc.fsf@gmail.com> <875yrs3jb7.fsf_-_@gnu.org> Date: Mon, 13 Dec 2021 09:10:38 -0500 In-Reply-To: <875yrs3jb7.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 13 Dec 2021 11:12:12 +0100") Message-ID: <87czm0y4rl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) Hi Ludovic, Ludovic Court=C3=A8s writes: > Hello Maxim, > > Maxim Cournoyer skribis: > >>>>From 762357609270ab016236d22999ae5cfc3fe4ff28 Mon Sep 17 00:00:00 2001 >> From: Maxim Cournoyer >> Date: Fri, 3 Dec 2021 22:36:26 -0500 >> Subject: [PATCH] sitecustomize.py: Honor .pth files. >> >> Fixes . >> >> * gnu/packages/aux-files/python/sitecustomize.py: Use site.addsitedirs t= o add >> the site directories; this takes care of the .pth files. Make sure the = added >> items still appear before Python's own 'site-packages' directory. > > I had completely overlooked this patch. > > Lars had useful comments about it. > > Do we need to address this before we merge =E2=80=98core-updates-frozen= =E2=80=99 into > =E2=80=98master=E2=80=99? The only reason I'm on the fence about it is that it causes a big rebuild. But rebuilding aside, I believe it'd be nice to have it in. I've only spotted one package affected so far (python-pdbpp), but there may be others. > If so, what changes need to be made to the patch before it can be > applied? I'll try having a look today. Thanks, Maxim From unknown Fri Aug 15 16:55:50 2025 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: Mon, 13 Dec 2021 19:06:01 +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 Cc: 52269@debbugs.gnu.org Received: via spool by 52269-submit@debbugs.gnu.org id=B52269.16394223048289 (code B ref 52269); Mon, 13 Dec 2021 19:06:01 +0000 Received: (at 52269) by debbugs.gnu.org; 13 Dec 2021 19:05:04 +0000 Received: from localhost ([127.0.0.1]:56821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwqd9-00029E-Q0 for submit@debbugs.gnu.org; Mon, 13 Dec 2021 14:05:04 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:44721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwqd6-00028y-Ss for 52269@debbugs.gnu.org; Mon, 13 Dec 2021 14:04:58 -0500 Received: by mail-qt1-f172.google.com with SMTP id a2so16174502qtx.11 for <52269@debbugs.gnu.org>; Mon, 13 Dec 2021 11:04:56 -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=BkP3HtSfRPRcr9kVkNx14s6LxaiftGVYYsrHZLa98fw=; b=XxeQl3q08xMAqpjAik27wbEH5KHHvA6s4f0eLo3Efn6PtcfiS94P6D8dms/H3DIPtl he/aGjvNPIxBw6Gt+sKFLnp7N8evi1oupzatUothzZnuW27MTcQpPRlKaygy2OVJ8K3l APtVyqQtNBQxuCn+KEEseSFtaGnIBYKirgzkRdnxWoSvhbeuER7Lg62D0wR9n4C9BJOn 7xnb/RPcvPeMdQangRzCOLadU6PdO8y9S47v56FOAvKLU5Wu4ZZwCYvYjexLPY6IWzez RFdfCLTkbpw7LVCwUgDXym9ORmo6h5GvV+MvYzEn8wdNB6K/VMCxA+9FTvF/WeyAT3ho Ct/Q== 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=BkP3HtSfRPRcr9kVkNx14s6LxaiftGVYYsrHZLa98fw=; b=cpiz9XfuHSIAi0m1DdlHZWRjCaMgB3fvLJIKw/IvPIpSWYRkb+6yKXBM6zCX995lhs 5J1yLSuAB0cP2FG4LwsrkWLAR21UWYe8Odqd9bS5CbU4TcARhBdKjh5mFuPGpqqjokUR jeQHiqyuwUtWym0/OLbn8JXt64frcK9Npc28b+hrw+mlfiT3ivoOYXR6KfMJHzlpMepg 0lnJ/Y90Pp54VeqwFNKCPmajKsAIOO88geFTK5UIJE2FABvdBlXXXI5wEpnoE+Dylaj1 +E/1AHFt2fftSz1OWQHY8JRi7Jj6oJXPGD+J6z9lhCMSw8nrYCeB65sokiujdDwjTPGr 5mtA== X-Gm-Message-State: AOAM532VFNYl0JyrtEHLgf7LVXkJA2DXJ9q0xw+xBNLUKba5D+hhy6X8 IWJcCluqP//TFwIJeJ9k9PDFk/D8ZBc= X-Google-Smtp-Source: ABdhPJxJ7k0OUmhny+UM75FSVWoHaoukZYSrV/i5njqh97uNMNCVw0xT10JKbRIv9QqKyS+AyN9W0g== X-Received: by 2002:ac8:57ce:: with SMTP id w14mr261142qta.252.1639422291055; Mon, 13 Dec 2021 11:04:51 -0800 (PST) Received: from hurd (dsl-10-141-188.b2b2c.ca. [72.10.141.188]) by smtp.gmail.com with ESMTPSA id f11sm6428957qko.84.2021.12.13.11.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 11:04:50 -0800 (PST) From: Maxim Cournoyer References: <871r2taxcm.fsf@gmail.com> Date: Mon, 13 Dec 2021 14:04:49 -0500 In-Reply-To: (Lars-Dominik Braun's message of "Mon, 6 Dec 2021 09:42:56 +0100") Message-ID: <87ee6gcomm.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Lars-Dominik Braun writes: > Hi Maxim, > >> +if not matching_sites: >> + exit(0) > are you sure about using `exit()` here? sitecustomize.py is imported > during startup and this would simply quit the Python interpreter if > GUIX_PYTHONPATH is not set, wouldn=E2=80=99t it? (Can=E2=80=99t test the = change > unfortunately, because it=E2=80=99s a massive rebuild.) You can test it by placing the new sitecustomize.py file in the current directory, and then: $ guix shell python-wrapper python-pdbpp [env]$ $ PYTHONPATH=3D. GUIX_PYTHONPATH=3D python sample.py where sample.py contains something like: --8<---------------cut here---------------start------------->8--- __import__("pdb").set_trace() print('hello') --8<---------------cut here---------------end--------------->8--- Indeed, when GUIX_PYTHONPATH is unset or matching_sites is empty, it exit with 0 as you expected: --8<---------------cut here---------------start------------->8--- $ PYTHONPATH=3D. GUIX_PYTHONPATH=3D python sample.py Fatal Python error: init_import_site: Failed to import the site module Python runtime state: initialized Traceback (most recent call last): File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python= 3.9/site.py", line 589, in main() File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python= 3.9/site.py", line 582, in main execsitecustomize() File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python= 3.9/site.py", line 521, in execsitecustomize import sitecustomize File "/home/maxim/proj/kinova/kts_robot/sitecustomize.py", line 52, in exit(0) File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python= 3.9/_sitebuiltins.py", line 26, in __call__ raise SystemExit(code) SystemExit: 0 --8<---------------cut here---------------end--------------->8--- After the proposed change: --8<---------------cut here---------------start------------->8--- [env]$ PYTHONPATH=3D. GUIX_PYTHONPATH=3D python sample.py > /home/maxim/proj/kinova/kts_robot/sample.py(5)() -> print('hello') --8<---------------cut here---------------end--------------->8--- There's no longer pdbpp because of clearing GUIX_PYTHONPATH but at least it doesn't crash :-). >> +# Move the entries that were appended to sys.path in front of Python's = own >> +# site-packages directory. This enables Guix packages to override Pyth= on's >> +# bundled packages, such as 'pip'. >> +python_site_index =3D sys.path.index(python_site) >> +new_site_start_index =3D sys.path.index(matching_sites[0]) >> +if python_site_index < new_site_start_index: >> + sys.path =3D (sys.path[:python_site_index] >> + + sys.path[new_site_start_index:] >> + + sys.path[python_site_index:new_site_start_index]) > This is unrelated to the pdb issue, right? I see that it=E2=80=99s necess= ary > right now, but as suggested in #46848 I=E2=80=99d prefer unbundling > setuptools/pip from python. (I=E2=80=99ll send a v3 of the patchset at so= me > point.) Previously the Guix-provided paths were directly spliced at the right location; now using 'site.addsitedir' simply appends them, which requires manual fiddling afterward. 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). Thank you, Maxim --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-sitecustomize.py-Honor-.pth-files.patch >From 49f0d2a493b868b9414ea10c7a676cf8404e1bca Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 3 Dec 2021 22:36:26 -0500 Subject: [PATCH] sitecustomize.py: Honor .pth files. Fixes . * gnu/packages/aux-files/python/sitecustomize.py: Use site.addsitedirs to add the site directories; this takes care of the .pth files. Make sure the added items still appear before Python's own 'site-packages' directory. --- .../aux-files/python/sitecustomize.py | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/gnu/packages/aux-files/python/sitecustomize.py b/gnu/packages/aux-files/python/sitecustomize.py index 71e328b9ac..e2348e0356 100644 --- a/gnu/packages/aux-files/python/sitecustomize.py +++ b/gnu/packages/aux-files/python/sitecustomize.py @@ -18,6 +18,7 @@ # along with GNU Guix. If not, see . import os +import site import sys # Commentary: @@ -47,9 +48,18 @@ all_sites_norm = [os.path.normpath(p) for p in all_sites_raw] matching_sites = [p for p in all_sites_norm if p.endswith(site_packages_prefix)] -# Insert sites matching the current version into sys.path, right before -# Python's own site. This way, the user can override the libraries provided -# by Python itself. -sys_path_absolute = [os.path.realpath(p) for p in sys.path] -index = sys_path_absolute.index(python_site) -sys.path[index:index] = matching_sites +if matching_sites: + # Deduplicate the entries, append them to sys.path, and handle any + # .pth files they contain. + for s in matching_sites: + site.addsitedir(s) + + # 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]) + if python_site_index < new_site_start_index: + sys.path = (sys.path[:python_site_index] + + sys.path[new_site_start_index:] + + sys.path[python_site_index:new_site_start_index]) -- 2.34.0 --=-=-=-- From unknown Fri Aug 15 16:55:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52269: [core-updates-frozen] sitecustomize.py does not honor .pth files Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 16 Dec 2021 09:50: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: Maxim Cournoyer Cc: 52269@debbugs.gnu.org Received: via spool by 52269-submit@debbugs.gnu.org id=B52269.163964815627096 (code B ref 52269); Thu, 16 Dec 2021 09:50:02 +0000 Received: (at 52269) by debbugs.gnu.org; 16 Dec 2021 09:49:16 +0000 Received: from localhost ([127.0.0.1]:34609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxnO0-00072x-2O for submit@debbugs.gnu.org; Thu, 16 Dec 2021 04:49:16 -0500 Received: from mout-p-101.mailbox.org ([80.241.56.151]:12922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxnNu-00072e-M2 for 52269@debbugs.gnu.org; Thu, 16 Dec 2021 04:49:14 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:105:465:1:3:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4JF6l401qCzQlNJ; Thu, 16 Dec 2021 10:49:04 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1639648142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UyMVqYhsH1WiA0FB163TMNBLrTNri8BCwlfKfGxQCt4=; b=RvWRMP5Lk2YzeVdZSnRe0AfLcNp7spcmpWFP4SJ3au230m77X70SgThbQa1ECSrfCoE+J6 gL++Loq9kyob68V+CW0A4zpmf9jYytGXTtG3MFyahdY0UL6QNgmweUt5p33FEBnV18iNci 2W1s5mkp5sguzyUmpdccuh5N4Its1mM4MYBIWZTytxAZETHsqdsDb6hf0E2Of+8IsQKz4K CE6/V9iTKVolNXijx8r6Abw48VDFVHhfEfv3ui/4EGCXtBvEzq6xyiRlJ2dH2FeupfeK/L HcRqwJU2ev3MvEZMYGjwcH+13vyaH8S+w/K+PIInanzvkKoOpvNy9klL8OPGgw== Date: Thu, 16 Dec 2021 10:48:55 +0100 From: Lars-Dominik Braun Message-ID: References: <871r2taxcm.fsf@gmail.com> <87ee6gcomm.fsf_-_@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ee6gcomm.fsf_-_@gmail.com> X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.7 (-) 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. Cheers, Lars From unknown Fri Aug 15 16:55:50 2025 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 Cc: 52269@debbugs.gnu.org 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-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) 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 From unknown Fri Aug 15 16:55:50 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Maxim Cournoyer Subject: bug#52269: closed (Re: bug#52269: [core-updates-frozen] sitecustomize.py does not honor .pth files) Message-ID: References: <87czlv6zrn.fsf@gmail.com> <871r2taxcm.fsf@gmail.com> X-Gnu-PR-Message: they-closed 52269 X-Gnu-PR-Package: guix X-Gnu-PR-Keywords: patch Reply-To: 52269@debbugs.gnu.org Date: Fri, 17 Dec 2021 15:03:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1639753381-26121-1" This is a multi-part message in MIME format... ------------=_1639753381-26121-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #52269: [core-updates-frozen] sitecustomize.py does not honor .pth files which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 52269@debbugs.gnu.org. --=20 52269: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D52269 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1639753381-26121-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 52269-done) by debbugs.gnu.org; 17 Dec 2021 15:02:14 +0000 Received: from localhost ([127.0.0.1]:40376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myEkQ-0006m5-BJ for submit@debbugs.gnu.org; Fri, 17 Dec 2021 10:02:14 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:37386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myEkO-0006lo-A2 for 52269-done@debbugs.gnu.org; Fri, 17 Dec 2021 10:02:12 -0500 Received: by mail-qv1-f41.google.com with SMTP id fo11so2619422qvb.4 for <52269-done@debbugs.gnu.org>; Fri, 17 Dec 2021 07:02:12 -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=RtfNjK4rnvuy9JVB+CJWAR7ufEdxXz0sPVpVCO9DR7U=; b=dwqHyHEqGRYB+mypHh2encbwlmW3EuWlAhMJDIZtdUok9C51vW3lh7j8EViD5iFpva Oe7QYV7i4zTBh28RTTjdZUBjH/nI6Eppc6yo9jGPoaKaz4sUc0MmQZZFYoX+i9aAUSda FDdDevXkfzNZQIQck+CY730wDCEp4WUoX3OB8/Bv1pfoBILN2edDBmfVK33Rp4f0cJhA aMyjISh3rWAPtzz9EIHn1NBAS1kIgh0kBdNnnRHJMExSxMdu7185LNp2Tg86EspVqYUV 2w/fDLsGPoL5VXOUZ8VLiwkntOTiffMZTHnFg5nKAgVaxsCbZ/vN5T29wAThJ1AmyJoL fAZA== 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=RtfNjK4rnvuy9JVB+CJWAR7ufEdxXz0sPVpVCO9DR7U=; b=sYtWSEhT6yyqVE6KnmaVzisIaWJzPzXWDDEsy1aATMEtFFgCvyrETOco6dk8XMbRaY 5PhVq374UTrhmBmbpzJD+cEx6aWvSwiR/f2r5xVpJRP+U9OzZ5vPl/eZDHgb6kS4XY9R MSSgN7Xl3r+Z3Kb615fvNpRk8626g/luo++Kod9arcDXGV3nemL6PgnwoSRbea+tQYp1 Wy1MzA1go/7B6XjNnykmA4sI9jfuZVhpJd1AZIM+zQKNPQS3zzvkwckXZhX5m21aKcjs DqNje6HiSB21no9QKiBp/8FDhnBD26T1i6JhxvFWixa7odb028SnW7Mdz4c6mgg3+w19 SGiw== X-Gm-Message-State: AOAM53276/UCvtUFl02Wm6AnjCZJYyTy+JRScGz/fZKLySk15jocCM4H Krpk9x8otjDoVAiFptFxIK2XVuxA7Dk= X-Google-Smtp-Source: ABdhPJzp8CdgOehHP6zIcdAWyo0uAj3Noi0jY6tizTPwHwnt37ECW7Vu8q0bAAVXjDRsdViBnMRDEg== X-Received: by 2002:a05:6214:27cf:: with SMTP id ge15mr2542219qvb.129.1639753326466; Fri, 17 Dec 2021 07:02:06 -0800 (PST) Received: from hurd ([207.35.95.41]) by smtp.gmail.com with ESMTPSA id k9sm7439289qta.48.2021.12.17.07.02.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 07:02:05 -0800 (PST) From: Maxim Cournoyer To: Lars-Dominik Braun Subject: Re: bug#52269: [core-updates-frozen] sitecustomize.py does not honor .pth files References: <871r2taxcm.fsf@gmail.com> <87ee6gcomm.fsf_-_@gmail.com> <87h7b770po.fsf@gmail.com> Date: Fri, 17 Dec 2021 10:02:04 -0500 In-Reply-To: <87h7b770po.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 17 Dec 2021 09:41:39 -0500") Message-ID: <87czlv6zrn.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-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52269-done Cc: 52269-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) Hi, I've cherry-picked this commit to the version-1.4.0 branch. I'll amass some fixes there and then later have Cuirass build it. Closing. Thanks for the review! Maxim ------------=_1639753381-26121-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Dec 2021 03:00:02 +0000 Received: from localhost ([127.0.0.1]:52552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtLHO-0007x4-1C for submit@debbugs.gnu.org; Fri, 03 Dec 2021 22:00:02 -0500 Received: from lists.gnu.org ([209.51.188.17]:60566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtLHK-0007wR-4G for submit@debbugs.gnu.org; Fri, 03 Dec 2021 22:00:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtLHJ-0001iF-Rw for bug-guix@gnu.org; Fri, 03 Dec 2021 21:59:57 -0500 Received: from [2607:f8b0:4864:20::836] (port=43927 helo=mail-qt1-x836.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtLHH-0008KE-Vj for bug-guix@gnu.org; Fri, 03 Dec 2021 21:59:57 -0500 Received: by mail-qt1-x836.google.com with SMTP id q14so5340042qtx.10 for ; Fri, 03 Dec 2021 18:59:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=2oXFAQdEa8lc536uALeWkocgLYySx9wJzPtQghiiLRE=; b=kGuVGJPwSaTYILJViLb3RyEnzoetvnQXzvGa/ertN70197VvBrBe3+4JJgfu0eUo/T JN18y6lekZChDM1z1qauIz6hDYBKXt4IZrr+oP68JHfIVQLV4FpPxlFBQNk2bxIt80gj 3SSmBz75dFhkDwNSkWlRbbi/pGBfRObVIdB285JxCA+UXlNlFHLaccsxZS0dSekvfBD6 ofKcQYI7C0lvMxayPncobOOd5dJ3JjXKm4EKA74il/4+o7xjWQXSHFwMxcktVF29+cuu SGri6AthT6LwuIvA5rKE8c6OhfXQRt1B6dX8ZT7SDp/f76+aAv9ou+AumsnM2jNy+rcR G++w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=2oXFAQdEa8lc536uALeWkocgLYySx9wJzPtQghiiLRE=; b=gBd8rwgsWKytD/I9DPUGHx4xeGDDJDZ/v+5cyFqPoZpOnUocl2FHW8lkL31IZXGFqZ 0/KSoMc+QvYJ5Wx2tGiQSexgLPEeSUZhkK5bsIbFDEkQs0fkOKnrGz6/TEWzx2aun/Ix +3NZFJPd721iGeibqYBp6yy+IHU3wtvMTcPSVhjdljiZ/6tPrGEq0IHboZD20jd1nxdv xcxbAWTZ4fsQ28kh31WMdy9MDdLzHiiwZqx8epgADrqq0vP1Whvxti8y13nA7Nb0N42v CwildSmYCv+0WD8QXa7QtQ+Npae3dEmG4rs5BrjIkPoTeObEK74/OszP5xE3O5AM8ROS RBBA== X-Gm-Message-State: AOAM530F9JAxCi2Rwg6UP1anuei9+cLAVg2mCuB0ocvciZUSFEihNIVM Pr9d9vWC1HLJhwdIWRKEKdDRIRugrN8= X-Google-Smtp-Source: ABdhPJxK+kTjetxpgs+u00VbleH9A7Z+3zeQEO3QmWB/NgAAeHxSiT7dWe8np7c8xCQ5/o1JYjqtSg== X-Received: by 2002:a05:622a:54d:: with SMTP id m13mr24798570qtx.33.1638586794702; Fri, 03 Dec 2021 18:59:54 -0800 (PST) Received: from hurd (dsl-156-29.b2b2c.ca. [66.158.156.29]) by smtp.gmail.com with ESMTPSA id de13sm3162844qkb.81.2021.12.03.18.59.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 18:59:54 -0800 (PST) From: Maxim Cournoyer To: bug-guix Subject: [core-updates-frozen] Some Python packages relying on .pth are broken Date: Fri, 03 Dec 2021 21:59:53 -0500 Message-ID: <871r2taxcm.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::836 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::836; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x836.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -2.3 (--) Hello Guix, This was already something Harmut noted during their review of the site.py loader (that it should honor .pth files), but at the time I wasn't aware of a Python package that still made use of that mechanism and thought it was legacy. To my dismay it seems to be used by the tool 'pdbpp', which is an improved pdb (debugger) for Python; using core-updates-frozen I noticed that it was no longer in use; looking at its installed files I see: --8<---------------cut here---------------start------------->8--- pdbpp_hijack_pdb.pth --8<---------------cut here---------------end--------------->8--- So I'm guessing that because the new loader doesn't handle .pth files its "hijacking" technique doesn't work. Unfortunately touching this site.py file would causes a massive rebuild (of the whole Python world). Hopefully this use of .pth is a rare occurrence and can be worked around. Thanks, Maxim ------------=_1639753381-26121-1--