Skip to content
This repository was archived by the owner on Jun 18, 2023. It is now read-only.

AttributeError: 'NoneType' object has no attribute 'group' #43

Closed
bblue opened this issue Apr 24, 2020 · 11 comments · Fixed by #45
Closed

AttributeError: 'NoneType' object has no attribute 'group' #43

bblue opened this issue Apr 24, 2020 · 11 comments · Fixed by #45

Comments

@bblue
Copy link

bblue commented Apr 24, 2020

The following line raises an AttributeError when the cache is being rebuilt. Seems re.search can return None. Not sure what the underlying issue is, but the error should at least exit the method a bit more graceful.

dl_function = re.search(r"function dl.*\}", soup.find("script").text).group(0)

@bblue
Copy link
Author

bblue commented Apr 24, 2020

Did a bit more digging. RoboBrowser response is 404, and hence the re.search or soup.find has nothing to dig through. I never did much with web crawling, so someone a bit more skilled with that should figure out what is wrong with the connection to gohlke's site. I bet this affects pretty much every user of pipwin.

@bblue
Copy link
Author

bblue commented Apr 24, 2020

Fixed it. Seems the crawler is blocked by the server when no user agent is defined.

@bblue bblue mentioned this issue Apr 24, 2020
@bblue
Copy link
Author

bblue commented Apr 27, 2020

hmm... the user agent fixed the connection from my development computer, but I still get a 404 when connecting from github-servers.

@presidento23
Copy link

Where did you change the user agent? Was it in pipwin.py in the headers variable?

@bblue
Copy link
Author

bblue commented Apr 29, 2020

Where did you change the user agent? Was it in pipwin.py in the headers variable?

Just see my pull request. All there.
https://github.com/lepisma/pipwin/pull/44/files

samapriya added a commit to samapriya/pipwin that referenced this issue Apr 30, 2020
- Handles text vs string parsing for beautifulsoup4 for python2 vs python3.
- Fixes [issue 43](lepisma#43)
@samapriya
Copy link
Contributor

Hi @lepisma
This issue was because of the way beautifulsoup4 handles string vs text. Fixed this in the pull request for release 0.5.0. @bblue we have removed robobrowser since version 0.4.7. @presidento23 you can try it out using while we wait for merge. :)

pip install git+https://github.com/samapriya/pipwin.git

@samapriya
Copy link
Contributor

Hey @lepisma
Would you mind merging and releasing to v0.5.0. Thank you :)

@This-is-NB
Copy link

I am not able to use pipwin
i checked "pip show pipwin"
its updated and there

but when i use any pipwin command it shows

'pipwin' is not recognized as an internal or external command,
operable program or batch file.

any help would be grateful!
@samapriya
Thanks

@samapriya
Copy link
Contributor

Hi @This-is-NB

  • Try the pip show pipwin again
  • Copy the Location path
  • Add this to the Path variable in System Variables under your system properties.

Try google adding to system variables windows that should help. Close the cmd and restart again and it should hopefully work

@This-is-NB
Copy link

Helli @samapriya
I did as you said
And added the path shown in
pip show pipwin

To system variables as well as user one just to be safe
And restarted cmd
But no fruit from this either
Its showing the same error
Pipwin is not recognized as an internal or external command
Still it

@This-is-NB
Copy link

@samapriya
I'm using python 3.8
and i found on stack that it doesn't work with 3.7 and above
is it true??
if it is true any alternatives??

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

Successfully merging a pull request may close this issue.

4 participants