Hubert Tournier <hubert.tourn...@gmail.com> added the comment:
Hello, Same results with Python 3.10.4: [...] Adding 185.220.102.6 Database has 62 records for 442368 bytes. Last record was 640 bytes long Traceback (most recent call last): File "./shelve-test.py", line 84, in <module> _verify_whois_cache() File "./shelve-test.py", line 63, in _verify_whois_cache for key in db.keys(): File "/usr/local/lib/python3.10/_collections_abc.py", line 881, in __iter__ yield from self._mapping File "/usr/local/lib/python3.10/shelve.py", line 95, in __iter__ for k in self.dict.keys(): SystemError: Negative size passed to PyBytes_FromStringAndSize # freebsd-version -uk 13.0-RELEASE-p8 13.0-RELEASE-p10 # python3.10 --version Python 3.10.4 The point at which the database breaks depends (from 50 to 500+ records), the size of the database doesn't seem to be relevant (from 400K to 1800K). The size of the record *apparently* doesn't seem to be relevant (but I'm not 100% sure it's the right figure), though I've had other shelve module uses without issues with many more records but much smaller and less complex. ---------- Added file: https://bugs.python.org/file50703/shelve-test-3.10.zip _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue47072> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com