libgit2 / libgit2/pygit2

Repository.create_reference only accepts str and not bytes

オープン
#966 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
1.7k
フォーク
408
平均マージ
2日 57分
マージ済み PR(30日)
7

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

repository.c の Repository_create_reference_direct から始め、reference 引数がどのように解析されるかを確認してください。既存の Repository.create_reference の動作と関連する issue #932 を確認して想定される処理を把握し、その後、str が UTF-8 エンコードのままであり、bytes は変更せずに渡されることを検証してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, git, python
領域
api, backend
issue の種類
バグ
難易度
2/5
見積もり時間
半日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。