Skip to content

Commit

Permalink
Wallet workaround for python issue 97641 and update anyio for issue 5…
Browse files Browse the repository at this point in the history
…89 (#16408)

* add arvid's fix to wallet as well

* update anyio to 4.0.0
  • Loading branch information
wjblanke authored Sep 26, 2023
1 parent ee09892 commit 07e2a0b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion chia/simulator/setup_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,24 @@ async def setup_wallet_node(
await service.wait_closed()
if db_path.exists():
# TODO: remove (maybe) when fixed https://github.com/python/cpython/issues/97641

# 3.11 switched to using functools.lru_cache for the statement cache.
# See #87028. This introduces a reference cycle involving the connection
# object, so the connection object no longer gets immediately
# deallocated, not until, for example, gc.collect() is called to break
# the cycle.
gc.collect()
db_path.unlink()
for _ in range(10):
try:
db_path.unlink()
break
except PermissionError as e:
print(f"db_path.unlink(): {e}")
time.sleep(0.1)
# filesystem operations are async on windows
# [WinError 32] The process cannot access the file because it is
# being used by another process
pass
keychain.delete_all_keys()


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

dependencies = [
"aiofiles==23.2.1", # Async IO for files
"anyio==3.7.1",
"anyio==4.0.0",
"blspy==2.0.2", # Signature library
"boto3==1.28.25", # AWS S3 for DL s3 plugin
"chiavdf==1.0.11", # timelord and vdf verification
Expand Down

0 comments on commit 07e2a0b

Please sign in to comment.