pypa / pypa/distutils

[FR] Support os.PathLike objects

Open
#142 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Python
Stars
59
Forks
94
PR merge metrics
No merged PRs in 30d

Description

I prefer to use pathlib.Path objects, but helpers like distutils.Command.make_file only accept strings: https://github.com/pypa/distutils/blob/27638e388d8ae92368e5459254b59a026e73b1cd/distutils/cmd.py#L387-L391

Filing this issue before I go in and make a PR to change these to os.PathLike checks. Any issues with that approach?

Directed here from setuptools: https://github.com/pypa/setuptools/issues/3315

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in distutils/cmd.py at the make_file implementation linked in the issue, then inspect nearby helpers that perform similar string-only path checks. Confirm how pathlib.Path and other os.PathLike objects should be accepted, and update the relevant checks so those helpers handle them consistently. Done means the affected helpers accept os.PathLike inputs without breaking existing string behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.