python / python/cpython

Wrong `follow_symlinks` default fallback implementation

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

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

type-bug
主要言語
Python
スター
77.2k
フォーク
36k
PR マージ指標
PR 指標を取得中

説明

Bug report

Bug description:

By https://github.com/python/cpython/blob/96b392d/Modules/posixmodule.c#L4274, if follow_symlinks = True, Python will choose to call syscall link rather than linkat. However, the behavior of link will have AT_SYMLINK_FOLLOW unset, which leads an opposite behavior.

import os
os.link('link', 'another-file')
wrong implementation of follow_symlinks
CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

### Tasks
Linked PRs
  • gh-119886

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

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

はじめの一歩

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

調査の方向性

Modules/posixmodule.c の 4274 行付近にあるフォールバック実装から始め、Linux で os.link の例を再現して、follow_symlinks=True の場合の link と linkat の動作を比較します。すでに進行中の作業については、リンクされている PR gh-119886 を確認してください。フォールバックが文書化された follow_symlinks の動作と一致すれば完了です。

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

評価

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

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

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