Răsfoiți Sursa

Merge pull request #2322 from CrystalWindSnake/main

Fix a problem with Storage not working in python 3.8
Falko Schindler 1 an în urmă
părinte
comite
c344c34f4f
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      nicegui/storage.py

+ 1 - 1
nicegui/storage.py

@@ -155,7 +155,7 @@ class Storage:
         To distinguish between the old and new encoding, the new files are named with dashes instead of underscores.
         """
         for filepath in self.path.glob('storage_*.json'):
-            new_filepath = filepath.with_stem(filepath.stem.replace('_', '-'))
+            new_filepath = filepath.with_name(filepath.stem.replace('_', '-') + filepath.suffix)
             try:
                 data = json.loads(filepath.read_text())
             except Exception: