Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

colab TypeError: GoogleAuth.LocalWebserverAuth() takes from 1 to 3 positional arguments but 5 were given

未关闭
#347 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python

调研方向

先使用 PyDrive2 1.19.0 复现所示的 LocalWebserverAuth 调用,然后检查 pydrive2/auth.py 以及回溯中提到的 Google Colab 包装器 _pydrive2.py。将受支持的方法签名与通过包装器传递的参数进行比较。在解释或修正参数不匹配问题并记录受支持的用法后,即可完成。

由索引模型根据 Issue 内容生成。

描述

I don't understand this error I'm getting on a local google colab docker runtime.
I've checked the code and LocalWebserverAuth takes 4 parameters??

TypeError                                 Traceback (most recent call last)

[<ipython-input-37-7bae651e2bc5>](https://localhost:8080/#) in <cell line: 9>()
      7 gauth = GoogleAuth(settings_file='settings.yaml')
      8 #gauth.credentials = GoogleCredentials.get_application_default()
----> 9 gauth.LocalWebserverAuth('localhost', [8090], False, '172.17.0.2')
     10 #gauth.CommandLineAuth()  # requires urn:ietf:wg:oauth:2.0:oob, no longer supported
     11 drive = GoogleDrive(gauth)

1 frames

[/usr/local/lib/python3.10/dist-packages/google/colab/_import_hooks/_pydrive2.py](https://localhost:8080/#) in PatchedLocalWebServerAuth(self, *args, **kwargs)
     59             self.credentials.refresh(httplib2.Http())
     60             return
---> 61           return orig_local_webserver_auth(self, *args, **kwargs)
     62 
     63         pydrive_auth_module.GoogleAuth.LocalWebserverAuth = (

[/usr/local/lib/python3.10/dist-packages/pydrive2/auth.py](https://localhost:8080/#) in _decorated(self, *args, **kwargs)
    123             self.LoadCredentials()
    124         if self.flow is None:
--> 125             self.GetFlow()
    126         if self.credentials is None:
    127             code = decoratee(self, *args, **kwargs)

TypeError: GoogleAuth.LocalWebserverAuth() takes from 1 to 3 positional arguments but 5 were given

Info:
Name: PyDrive2
Version: 1.19.0
Summary: Google Drive API made easy. Maintained fork of PyDrive.
Home-page: https://github.com/iterative/PyDrive2
Author: JunYoung Gwak
Author-email: [email protected]
License: Apache License 2.0
Location: /usr/local/lib/python3.10/dist-packages
Requires: google-api-python-client, oauth2client, pyOpenSSL, PyYAML

主要语言
Python
星标
668
派生
75
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

iterative/PyDrive2 的其他 Issue

查看 iterative/PyDrive2 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。