Repository.create_reference only accepts str and not bytes
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Description
Repository.create_reference only accepts str and not bytes. This is because Repository_create_reference_direct in repository.c uses the s specifier for parsing that argument, which only accepts str and implicitly encodes it using UTF-8. I would expect it to accept str or bytes, and if you pass bytes, it uses exactly what you pass in with no encoding/decoding.
This is a similar problem to #932.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in repository.c at Repository_create_reference_direct and inspect how the reference argument is parsed. Check the existing Repository.create_reference behavior and related issue #932 for expected handling, then verify that str remains UTF-8 encoded while bytes are passed through unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, git, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- Half a day
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100