Cannot use shelve without manual import of dbm.dumb
See original GitHub issuepython -m nuitka --version
0.7.5
Commercial: None
Python: 3.8.12 (heads/master:bd5e0bb, Aug 31 2021, 10:21:45) [MSC v.1929 64 bit (AMD64)]
Flavor: Unknown
Executable: C:\Users\<user>\AppData\Local\Programs\Python\Python38\python.exe
OS: Windows
Arch: x86_64
WindowsRelease: 10
Nuitka was installed using pip. Python was installed using the binary installer.
import shelve
pConfig = shelve.open("config")
pConfig.close()
Compiling the above code example with the following options:
python -m nuitka --standalone --follow-imports test.py
yields the following output when executing the binary:
Traceback (most recent call last):
File "C:\Users\<user>\nuitkaTest\test.py", line 3, in <module>
File "C:\Users\<user>\nuitkaTest\shelve.py", line 243, in open
File "C:\Users\<user>\nuitkaTest\shelve.py", line 226, in __init__
ModuleNotFoundError: No module named 'dbm'
Using the current develop version of nuitka (0.8rc6) yields the same error.
If I add import dbm
in front of import shelve
, I get an error saying it couldn’t find any implementation of dbm (neither dbm.gnu, nor dbm.ndbm, nor dbm.dumb)
If I add import dbm.dumb
it works fine.
Nuitka version 0.6.19.7 worked perfectly fine.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Convert Python shelve from dbm.gnu to dbm.dumb
I am trying to convert data stored in a non-dumb shelve to a dumb shelve, to be able to ...
Read more >dbm — Interfaces to Unix “databases” — Python 3.11.1 ...
Returns one of the following values: None if the file can't be opened because it's unreadable or doesn't exist; the empty string (...
Read more >11.4. shelve — Python object persistence
A “shelf” is a persistent, dictionary-like object. The difference with “dbm” databases is that the values (not the keys!) in a shelf can...
Read more >Python - Database Manager (dbm) package - GeeksforGeeks
This function is used to open a dbm database or create a new database if not exist. Syntax: dbm.open(file, flag='r', mode=0o666). Parameters: ...
Read more >Chapter 16. Databases and Persistence
So far in this book, we've used Python in the system programming, GUI development, and Internet ... Shelve files: storing pickled objects in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is now on develop and will be in 0.8 release.
Part of 0.8 release that I just made.