Exception while using annotation hashid
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 57/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
cyclonedds/idl/_main.py のレポートに示されている md5 式から始め、annotate.member_hash_id を使って PersonHashid を定義し、その Topic を初期化して失敗を再現します。文字列アノテーションに対する hash-id の処理を確認し、Topic の初期化が TypeError なしで完了することを検証します。
索引モデルが issue の本文から書いたものです。
説明
When I use hash annotations to modify the dataclass field, I throw an exception: TypeError: Strings must be encoded before hashing
My dataclass is:
@dataclass
class PersonHashid(idl.IdlStruct, typename="PersonHashid"):
name: str
annotate.member_hash_id("name", "123")
age: types.int32
address: str
An exception occurred when I used the following code to initialize the topic :
participant = DomainParticipant(0)
topic = Topic(participant,"HelloWorldTopic", PersonHashid)
Abnormal information:
mid = unpack("<I", md5(f_annot.get("hash_id", "") or name.encode()).digest()[:4])[0] & 0x0FFFFFFF
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Strings must be encoded before hashing
After tracking the code, it was found that the problem occurred in the file cyclonedds/idl/_main. py: mid=unpack ("<I", md5 (f-annot. get ("hash_id", "") or name. encode()). digest() [: 4]) [0]&0x0FFFFFFF
Is the correct code supposed to be: mid=unpack ("<I", md5 ((f-annot. get ("hash_id", "") or name). encode()). digest() [: 4]) [0]&0x0FFFFFFF ?
- 主要言語
- Python
- スター
- 110
- フォーク
- 68
- 平均マージ
- 3日 5時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eclipse-cyclonedds/cyclonedds-python のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
-
Generated Python code is not interoperable when a union contains a member called "value"再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
eclipse-cyclonedds/cyclonedds-python#333 · コメント 1 件 ·
eclipse-cyclonedds/cyclonedds-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SwiftKickMobile/skai#84 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
jxxghp/MoviePilot#7070 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
flop-labs/technocore-chat#997 ·
メンテナーはふだん 1 日以内に返信
-
tunneld on Windows: Wi-Fi devices are not discovered because uvicorn runs on a ProactorEventLoopオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
doronz88/pymobiledevice3#2051 ·
メンテナーはふだん 1 日以内に返信