Skip to content

Commit

Permalink
🐛 fix dummylock injected into asyncsession for cookies (#137)
Browse files Browse the repository at this point in the history
fix #136
  • Loading branch information
Ousret authored Jul 9, 2024
1 parent 01b2605 commit 3285732
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release History
===============

3.7.2 (2024-07-09)
------------------

**Fixed**
- DummyLock injected into RequestsCookieJar is not fully compatible, thus breaking AsyncSession on certain scenario. (#136)

3.7.1 (2024-07-07)
------------------

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dynamic = ["version"]
dependencies = [
"charset_normalizer>=2,<4",
"idna>=2.5,<4",
"urllib3.future>=2.8.900,<3",
"urllib3.future>=2.8.902,<3",
"wassima>=1.0.1,<2",
"kiss_headers>=2,<4",
]
Expand Down
4 changes: 2 additions & 2 deletions src/niquests/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
__url__: str = "https://niquests.readthedocs.io"

__version__: str
__version__ = "3.7.1"
__version__ = "3.7.2"

__build__: int = 0x030701
__build__: int = 0x030702
__author__: str = "Kenneth Reitz"
__author_email__: str = "me@kennethreitz.org"
__license__: str = "Apache-2.0"
Expand Down
8 changes: 7 additions & 1 deletion src/niquests/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,10 @@ def __enter__(self):
return self

def __exit__(self, exc_type, exc_val, exc_tb):
return
pass

def acquire(self):
pass

def release(self):
pass
6 changes: 6 additions & 0 deletions tests/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ async def test_awaitable_redirect_chain_stream(self):
assert resp.status_code == 200
assert await resp.json()

async def test_async_session_cookie_dummylock(self):
async with AsyncSession() as s:
await s.get("https://pie.dev/cookies/set/hello/world")
assert len(s.cookies)
assert "hello" in s.cookies

async def test_concurrent_task_get(self):
async def emit():
responses = []
Expand Down

0 comments on commit 3285732

Please sign in to comment.