python / python/cpython

Add `mutate_flag` parameter for `fcntl.fcntl`

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

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

extension-modules stdlib topic-IO type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Feature or enhancement

Proposal:

fcntl.ioctl has a mutate_flag parameter. When set to True, it will pass the arg buffer to the underlying ioctl syscall directly. This is useful for receiving the result which will be written to the arg buffer.

However, fcntl.fcntl doesn't have this parameter, and it only returns bytes as the modified arg buffer. Users need to parse the bytes using the struct module, even if they have a well-defined structure that already implements the write buffer protocol.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

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

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

はじめの一歩

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

調査の方向性

fcntl.fcntl と fcntl.ioctl のエントリポイントから始め、ioctl が mutate_flag をどのように処理するかを、現在の fcntl の動作と比較してください。既存の fcntl テストと buffer protocol に関する期待を確認してください。fcntl.fcntl が提案されたパラメータをサポートし、struct parsing を必要とせずに変更された buffer を受け取るケースをテストでカバーできれば、作業は完了です。

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

評価

技術スタック
python
領域
operating-systems
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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