Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fs.makedirs() fails unless you put a file in the folder (shared drive)

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
api, cloud

調査の方向性

まず GDriveFileSystem.makedirs() を使って共有ドライブの例を再現し、次に makedirs のエントリポイントとフォルダー作成ロジックを調べます。test_parent/test、またはそれと同等のネストされたパスを、先にファイルを作成せずに再帰的に作成できれば完了です。リポジトリに回帰テストが用意されている場合は、それを追加するか実行してください。

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

説明

Example:

# Setup
from pydrive2.fs import GDriveFileSystem
from pydrive2.auth import GoogleAuth

settings = {
    "client_config_backend": "service",
    'service_config': {
        'client_json_dict': {
            "type": "service_account",
            "private_key_id": str(os.getenv('xxx')),
            "private_key": str(os.getenv('xxx')).replace('\\n', '\n'),
            "client_email": str(os.getenv('xxx')),
            "client_id": str(os.getenv('xxx')),
        },
    'oauth_scope': [
        'https://www.googleapis.com/auth/drive',
        'https://www.googleapis.com/auth/drive.metadata'
    ]
    }
}

g = GoogleAuth(settings=settings)
g.ServiceAuth()
shared_d_name = "xxx"

fs = GDriveFileSystem(
    shared_d_name,
    google_auth=g
)


# Example that does not recursively create folders, and no exceptions raised
folder_path = f'{shared_d_name}/test_parent/test'
fs.makedirs(folder_path)

# Example that creates the folders
folder_path = f'{shared_d_name}/test_parent2/test2'
fs.makedirs(folder_path)
with fs.open(folder_path+'hi.txt', 'w') as f:
    f.write('hi')

Easy to make and then delete the file as a workaround, but the lack of success in the first example was wierd.
Best,
T

主要言語
Python
スター
670
フォーク
75
PR マージ指標
30日以内にマージされた PR はありません

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

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

はじめの一歩

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

iterative/PyDrive2 のほかの issue

iterative/PyDrive2 の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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