Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Auto generated use of the client with context manager is wrong

Open
#999 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api, documentation

Research direction

The issue names no repository file or test; start by locating the generated Client context-manager template and the documentation example, then compare them with the linked HTTPX example. Done means the generated usage and docs consistently show a fresh client for each with statement, with any relevant regression check passing.

Written by the indexing model from the issue text.

Description

There should be a new instance every time we use the with statement. because if not the next time you use the client you'll get "Cannot reopen a client instance, once it has been closed."

Like in this example you should write in the docs:
with Client(base_url="Somthing") as client:
and not:
with client as client:

Dominant language
Python
Stars
2k
Forks
293
Avg merge
34m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openapi-generators/openapi-python-client

All issues in openapi-generators/openapi-python-client

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.