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

UnboundLocalError: local variable '_response' referenced before assignment #1246

Open
dimaqq opened this issue Dec 19, 2024 · 1 comment
Open
Labels
hint/help-wanted Extra attention is needed kind/bug indicates a bug in the project

Comments

@dimaqq
Copy link
Contributor

dimaqq commented Dec 19, 2024

Description

  File "/home/runner/work/python-libjuju/python-libjuju/juju/charmhub.py", line 95, in info
    result = json.loads(_response.text)
UnboundLocalError: local variable '_response' referenced before assignment

possibly after Fatal error on SSL transport

looking through the code, if the charmhub request fails with some other error then 404, response json is loaded, while response is not set.

Urgency

Casually reporting

Python-libjuju version

3.6.0.0

Juju version

any (hit on: 3.5/stable)

Reproduce / Test

https://github.com/juju/python-libjuju/actions/runs/12409171833/job/34642285834?pr=1245
@dimaqq dimaqq added the kind/bug indicates a bug in the project label Dec 19, 2024
@dimaqq
Copy link
Contributor Author

dimaqq commented Dec 19, 2024

this file has more than one static analyser warning about _response being possibly unbound.

@dimaqq dimaqq added the hint/help-wanted Extra attention is needed label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hint/help-wanted Extra attention is needed kind/bug indicates a bug in the project
Projects
None yet
Development

No branches or pull requests

1 participant