[Distutils] Proposed bdist_dumb fix
Thomas Heller
theller@python.net
Thu Nov 21 15:29:01 2002
[Sorry for the previous one, still sometimes having problems with gnus]
Andrew Kuchling <akuchlin@mems-exchange.org> writes:
> Here's a proposed patch to alleviate the bdist_dumb problem. (Patch
> also attached to bug #410541.)
>
This code doesn't work unchanged on Windows:
> + else:
> + # install_base usually is a full path; we need to
> + # make it a relative path so it can be the second argument
> + # to os.path.join().
> + t = install.install_base
> + if t[0:1] == os.sep:
> + t = t[1:]
> + archive_root = os.path.join(self.bdist_dir, t)
't[0:1] == os.sep' is not a valid test for an absolute pathname,
those contain drive letters on Windows.
This will work, and should also work on other platforms if I understand
the docs for splitdrive() correctly.
else:
# install_base usually is a full path; we need to
# make it a relative path so it can be the second argument
# to os.path.join().
t = install.install_base
# on systems where a drive letter is used, split it off
_, t = os.path.splitdrive(t)
if t[0:1] == os.sep:
t = t[1:]
archive_root = os.path.join(self.bdist_dir, t)
I has to use '--from-root 0' command-line flag, is it supposed to work this way,
needing an argument?
The paths in the zip then start with 'Lib/site-packages' and
'Scripts'. Haven't yet tried older python versions, where
Lib/site-packages was not yet used, see PEP 250.
Thomas