InStream.get_channels_buffer_size uses wrong encoding
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
generated/nidaqmx/task/_in_stream.py の InStream.get_channels_buffer_size と、generated/nidaqmx/task/_out_stream.py の OutStream.get_channels_buffer_size から始めます。Task.channel_names がどのようにデコードされるかを確認し、次に DAQmxGetTaskChannels の呼び出しとそのネイティブなエンコーディング動作を調べます。完了条件は、fault-condition properties が C API の表現に基づくバッファーサイズを受け取り、マルチバイトのチャンネル名で buffer-too-small エラーが発生しなくなることです。
索引モデルが issue の本文から書いたものです。
説明
InStream.get_channels_buffer_size and OutStream.get_channels_buffer_size read the Task.channel_names property to calculate the maximum buffer size for a fault condition status property such as overcurrent_chans.
The problem is that these functions are calculating the length of the channel_names property after decoding from bytes to str. If Python represents str as UTF-16 or UTF-32, the number of characters in a str may be smaller than the number of UTF-8 bytes used to return that str from the DAQmx C API. When this happens, reading the fault condition property will likely return a "buffer too small" error when there is a fault.
Some potential solutions:
- Use
DAQmxGetTaskChannels(task, NULL, 0)to query the size of the TaskChannels property in the C API's native encoding (UTF-8 or MBCS). This would also be a small optimization because it would query the size of the TaskChannels property without querying the actual value. - Convert the task channels back to the C API's native encoding. This is a hack, so the first solution is better.
- 主要言語
- Python
- スター
- 590
- フォーク
- 199
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ni/nidaqmx-python のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
ni/nidaqmx-python#1030 ·
メンテナーはふだん 2 日以内に返信
-
tech debt
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
ni/nidaqmx-python#945 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
ni/nidaqmx-python#941 ·
メンテナーはふだん 2 日以内に返信
-
Potential typos in the API対応中かも @KostaIlic2 が 209 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
ni/nidaqmx-python#939 ·
メンテナーはふだん 2 日以内に返信
-
Add gRPC examplesオープンenhancement
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
ni/nidaqmx-python#917 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
ni/nidaqmx-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
task
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
danparshall/claude_researcher#87 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
datajoint/datajoint-python#1586 ·
メンテナーはふだん 1 日以内に返信
-
1D intercept of length 1 is accepted as `fix_params` in population GLM with more than 1 unit対応中かも @dhvani7014 が今日担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
flatironinstitute/nemos#642 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
uniswap-python/uniswap-python#487 ·