You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to ensure that a filename always honors the
indicated output_dir, make sure it's relative.
Ref python/cpython#37775.
"""
# Chop off the drive
no_drive=os.path.splitdrive(base)[1]
# If abs, chop off leading /
returnno_drive[os.path.isabs(no_drive) :]
In ccompiler.py, the function _make_relative aims to turn an arbitrary path into something "relative" in the sense that os.path.join can append it to some other path. In Python 3.13, os.path.isabs changed in a way that it now returns False for '/a/b' on Windows. This means that _make_relative('C:/a/b') only strips the drive but not the leading slash, and returns the bad '/a/b' (as opposed to 'a/b' with Python 3.12). Note that os.path.join still handles '/a/b' as an absolute path, os.path.join('build','/a/b') returns its second argument.
A suggestion (from someone not very familiar with the whole thing) would be to replace
returnno_drive[os.path.isabs(no_drive) :]
with
returnno_drive.lstrip(r'\/')
The text was updated successfully, but these errors were encountered:
(This was noticed in pypa/setuptools#4645)
distutils/distutils/ccompiler.py
Lines 983 to 992 in 3ac1adc
In
ccompiler.py
, the function_make_relative
aims to turn an arbitrary path into something "relative" in the sense thatos.path.join
can append it to some other path. In Python 3.13,os.path.isabs
changed in a way that it now returns False for'/a/b'
on Windows. This means that_make_relative('C:/a/b')
only strips the drive but not the leading slash, and returns the bad '/a/b' (as opposed to 'a/b' with Python 3.12). Note thatos.path.join
still handles '/a/b' as an absolute path,os.path.join('build','/a/b')
returns its second argument.A suggestion (from someone not very familiar with the whole thing) would be to replace
with
The text was updated successfully, but these errors were encountered: