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

Fix Attribute Error: 'HTTPResponse' object has no attribute 'strict' #117

Merged
merged 7 commits into from
Jun 6, 2023

Conversation

Yanqiao4396
Copy link
Contributor

@Yanqiao4396 Yanqiao4396 commented May 22, 2023

Requests Incompatibility Problem

Description

Current Poetry version will return error

AttributeError

  'HTTPResponse' object has no attribute 'strict'

  at ~/.local/share/pypoetry/venv/lib/python3.7/site-packages/cachecontrol/serialize.py:54 in dumps
       50│                 ),
       51│                 u"status": response.status,
       52│                 u"version": response.version,
       53│                 u"reason": text_type(response.reason),
    →  54│                 u"strict": response.strict,
       55│                 u"decode_content": response.decode_content,
       56│             }
       57│         }
       58│

To fix this problem, the easiest workaround is to upgrade Poetry over 1.2. Here I upgraded the automatic build of Poetry in .GitHub/workflow/main.yml to 1.4.2

Linked Issues

More discussions about this error could be found in psf/cachecontrol#292

closes: #00

Type of Change

  • Feature
  • [ x ] Bug fix
  • Documentation

Contributors

  • @

pyproject.toml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
Specifying urllab3 in pyproject.toml doesn't help with the Requests bug. Delete it
Upgrade Poetry in the workflow/main.yml to the newest version 1.5.0
Copy link
Member

@Michionlion Michionlion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Let's make sure this is fully tested (by installing it locally and running a few assignments through it) and then I think we're good to go.

@Yanqiao4396
Copy link
Contributor Author

It works well locally after a few trials

@Yanqiao4396 Yanqiao4396 merged commit 42541d6 into main Jun 6, 2023
@Yanqiao4396 Yanqiao4396 deleted the HTTP-incompatibility branch June 6, 2023 16:33
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

Successfully merging this pull request may close these issues.

4 participants