changeset 8178:a73c88154a68

bug: handle case where argv[0] is invoked by setuptools-py2cfg I am working on migrating to pyproject.toml. I used setuptools-py2cfg to generate a toml version of setup.py. It results in argv[0] as a PosixPath and no a string. So guard against processing the PosixPath when looking for prefix argument. Overall the resulting pyproject.toml isn't installing any of the data files, docs etc. It doesn't seem to process MANIFEST.in to get the data files correctly. So no joy so far and I am not checking in the result.
author John Rouillard <rouilj@ieee.org>
date Sun, 08 Dec 2024 09:10:21 -0500
parents 2967f37e73e4
children 53afc3ffd4a2
files setup.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Sun Dec 08 01:09:34 2024 -0500
+++ b/setup.py	Sun Dec 08 09:10:21 2024 -0500
@@ -78,6 +78,12 @@
         if prefix_arg:
             prefix = a
             break
+
+        # argv[0] can be a PosixPath when setup.py
+        # is invoked by setuptools-py2cfg
+        if not isinstance(a, str):
+            continue
+
         # is there a short form -p or something for this??
         if a.startswith('--prefix'):
             if a == '--prefix':

Roundup Issue Tracker: http://roundup-tracker.org/