Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'groups' #333

Open
drbeane opened this issue Mar 7, 2024 · 11 comments
Open

AttributeError: 'NoneType' object has no attribute 'groups' #333

drbeane opened this issue Mar 7, 2024 · 11 comments
Labels
bug for issue

Comments

@drbeane
Copy link

drbeane commented Mar 7, 2024

Provide environment information

/usr/local/bin/python
Python 3.10.12
gdown 4.7.3

What OS are you using?

Windows 10

Describe the Bug

I am attempting to use gdown to download the ipynb file for a Colab notebook. I am running the code from a different Colab notebook and am getting the error below.

This seems to be the same issue discussed here: #291

Until today, downgrading to gdown version 4.6.3 fixed the issue, but that seems to no longer be the case.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-8-db6fed3c0bd6>](https://localhost:8080/#) in <cell line: 1>()
----> 1 notebook_name = gdown.download(id=notebook_id, quiet=True)

[/usr/local/lib/python3.10/dist-packages/gdown/download.py](https://localhost:8080/#) in download(url, output, quiet, proxy, speed, use_cookies, verify, id, fuzzy, resume, format, user_agent)
    248         )
    249         m = re.search(r"filename\*=UTF-8''(.*)", content_disposition)
--> 250         filename_from_url = m.groups()[0]
    251         filename_from_url = filename_from_url.replace(osp.sep, "_")
    252     else:

AttributeError: 'NoneType' object has no attribute 'groups'

Expected Behavior

The notebook should be downloaded.

To Reproduce

No response

@drbeane drbeane added the bug for issue label Mar 7, 2024
@nmdaman
Copy link

nmdaman commented Mar 7, 2024

I am having this same issue with a CoLab notebook. Downgrading to previous versions did not help.
This code worked a few days ago.

Error:

	'NoneType' object has no attribute 'groups'

To report issues, please visit https://github.com/wkentaro/gdown/issues.
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
[<ipython-input-20-9b023bc3d8e1>](https://u9ujg5vsr7-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20240306-060117_RC00_613175604#) in <cell line: 5>()
      3 get_ipython().system('gdown 1v5QrCU2JgoRiPDnT2k-dw1-YW9w-FZFw')
      4 import numpy as np  #this module needed to be loaded for the csv file load
----> 5 EPSCs = np.fromfile('/content/EPSCs.txt',dtype=float)
      6 with open("/content/EPSCs.txt") as thecsvfile:
      7   EPSCs = np.loadtxt(thecsvfile, delimiter=",")

FileNotFoundError: [Errno 2] No such file or directory: '/content/EPSCs.txt'

@RobLins12
Copy link

RobLins12 commented Mar 7, 2024

I had this trouble too... so i upgraded gdown by using "pip install --upgrade gdown" and then the code started working again

@DmStepankov
Copy link

Upgrading gdown with the above method to version 5.1.0 seems solve the problem in Google Colab

@bmox
Copy link

bmox commented Mar 8, 2024

Run this on Google Colab
!pip install --upgrade gdown

@aakhmetz
Copy link

aakhmetz commented Mar 8, 2024

it worked for me

@steluis
Copy link

steluis commented Mar 8, 2024

I had this trouble too... so i upgraded gdown by using "pip install --upgrade gdown" and then the code started working again

You saved me !!

@alexander-py
Copy link

Not the case here (also on Google Colab).

Downgrading does not work anymore. Neither does upgrading.

@filiptrplan
Copy link

Not the case here (also on Google Colab).

Downgrading does not work anymore. Neither does upgrading.

Same here... Was working until a day ago on 4.6.1 but now no versions work.

@bmox
Copy link

bmox commented Mar 9, 2024 via email

@alexander-py
Copy link

Seems its working as of today :)

@weigary
Copy link

weigary commented Mar 13, 2024

I see this error in the Colab notebook when downloading a folder:

import gdown
url = "https://drive.google.com/drive/folders/1BO_dyz-p65qhBRRMRA4TbZ8qW4rB99JZ"
gdown.download_folder(url, use_cookies=False)

OR

url = "https://drive.google.com/drive/folders/1BO_dyz-p65qhBRRMRA4TbZ8qW4rB99JZ"
! gdown --folder ${url}

The error persists even if I upgraded to the latest version gdown=5.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug for issue
Projects
None yet
Development

No branches or pull requests

10 participants