fs.makedirs() fails unless you put a file in the folder (shared drive)
まだ誰も着手していません。
評価
調査の方向性
まず 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 はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
iterative/PyDrive2 のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
iterative/PyDrive2 の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·