microsoft / microsoft/yardl

Python Reader/Writer classes should accept Path/PathLike arguments

Open
#242 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
35
Forks
14
Avg merge
5d 17h
Merged PRs (30d)
1

Description

All Python Readers, Writers, and CodedInputStream/CodedOutputStreams should accept os.PathLike in addition to the current types.

For example:
https://github.com/microsoft/yardl/blob/58c14fe231fd020142f7043df6a7901564ade95e/tooling/internal/python/static_files/_binary.py#L180-L189

The CodedInputStream will only open the stream if it is of type str, but it should accept any "path-like object".

So the type signature should also include os.PathLike, and the isinstance(stream, str) should be isinstance(stream, (str, os.PathLIke)).

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 with tooling/internal/python/static_files/_binary.py lines 180-189, then locate the other Python Reader, Writer, CodedInputStream, and CodedOutputStream definitions. Check their accepted types and path-opening conditions against the os.PathLike requirement; done means all listed classes accept path-like objects consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
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.