File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
2+ import sys
23from typing import Iterable , overload , Any
34
45import nicegui .context
78from nicegui .testing import UserInteraction
89from nicegui .testing .user import User
910
11+ if sys .platform == "win32" :
12+ # Python 3.14 on Windows: nicegui's storage teardown races with subprocess shutdown,
13+ # leaving storage-general.json locked (WinError 32). Patch only FilePersistentDict.clear
14+ # so the retry sleep never runs inside the async event loop.
15+ import time
16+ from nicegui .persistence import file_persistent_dict as _fpd
17+
18+ _orig_clear = _fpd .FilePersistentDict .clear
19+
20+ def _safe_clear (self : _fpd .FilePersistentDict ) -> None :
21+ try :
22+ _orig_clear (self )
23+ except PermissionError :
24+ time .sleep (0.5 )
25+ _orig_clear (self )
26+
27+ _fpd .FilePersistentDict .clear = _safe_clear # type: ignore[method-assign]
28+
1029
1130@pytest .fixture (autouse = True )
1231def reset_nicegooey_main ():
You can’t perform that action at this time.
0 commit comments