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

'HTTPResponse' object has no attribute 'chunked' #18

Closed
mbunkin opened this issue Apr 4, 2020 · 3 comments
Closed

'HTTPResponse' object has no attribute 'chunked' #18

mbunkin opened this issue Apr 4, 2020 · 3 comments

Comments

@mbunkin
Copy link

mbunkin commented Apr 4, 2020

Installed using pip

lastversion https://github.com/php/php-src

Traceback (most recent call last):
File "/usr/bin/lastversion", line 9, in
load_entry_point('lastversion==1.1.1', 'console_scripts', 'lastversion')()
File "/usr/lib/python2.7/site-packages/lastversion/lastversion.py", line 195, in main
args.shorter_urls, args.major)
File "/usr/lib/python2.7/site-packages/lastversion/lastversion.py", line 53, in latest
release = s.get_latest(pre_ok=pre_ok, major=major)
File "/usr/lib/python2.7/site-packages/lastversion/GitHubRepoSession.py", line 137, in get_latest
r = self.get('https://{}/{}/releases.atom'.format(self.hostname, self.repo))
File "/usr/lib/python2.7/site-packages/lastversion/GitHubRepoSession.py", line 46, in get
r = super(GitHubRepoSession, self).get(url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 498, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 486, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 598, in send
r = adapter.send(request, **kwargs)
File "/usr/lib64/python2.7/site-packages/cachecontrol/adapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 437, in send
return self.build_response(request, resp)
File "/usr/lib64/python2.7/site-packages/cachecontrol/adapter.py", line 107, in build_response
if response.chunked:
AttributeError: 'HTTPResponse' object has no attribute 'chunked'

@dvershinin
Copy link
Owner

@mbunkin this happens due to cachecontrol's issue.
Likely you requests Python package is too old.

Unfortunately, they have not merged the pull request with the trivial fix.

The best way to go around lastversion is either using the packaged install (if you're on CentOS/RHEL) or pip in a virtualenv.

@mbunkin
Copy link
Author

mbunkin commented Apr 4, 2020

Thank you! But I thought pip is a package manager, why doesn't it check for the requests package version when installing lastversion?

@dvershinin
Copy link
Owner

There was no specific version requirement set by lastversion, so pip was satisfied with whatever requests package you already had before. The new version of lastversion will set the requirement to be more explicit.

dvershinin added a commit that referenced this issue Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants