libgit2 / libgit2/pygit2

Signature email requires ASCII on Python 2 but requires Unicode only "str" on Python 3

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

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

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

説明

Signature_init in signature.c currently uses the s format string for parsing the email argument. This is inconsistent between Python 2 and 3. On Python 2, it accepts either text (unicode) or bytes (str) and implicitly encodes text using the default system encoding, which is ascii by default (and it seems like changing it is kind of weird and not really recommended by most people). Python 3, it only accepts text (str), and it's implicitly encodes it using UTF-8.

The name argument for Signature_init just uses O and accepts either text or bytes. It appears to implicitly encode text using UTF-8 and leaves bytes as-is. I would expect the email argument to work the same way.

So there's currently no way to pass in bytes on Python 3 and no way to pass in non-ASCII text on Python 2.

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

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

はじめの一歩

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

調査の方向性

signature.c の Signature_init から始め、email 引数が name 引数と比較してどのように解析されるかを調べます。Python 2 と Python 3 での動作を確認します。完了の条件は、email が Python 3 では bytes を、Python 2 では非 ASCII テキストを、name と一貫して受け入れることです。

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

評価

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

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

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