You are not logged in.

#1 2018-01-07 21:23:00

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

[SOLVED] Python dbm.gnu

Did we recently drop support for dbm.gnu from python?  This is in regards to a program I wrote that stores api_keys, location, and unit preferences in a database and uses them to retrieve local weather.  It broke today, but I do not see anything in the pacman logs that would make sense as to why this suddenly stopped working.  Killing the database file (~/.wunderground) and re-running the program creates two new files which seem to represent a dbm.ndbm format (dir and pag files).  The new data are stored, and the program runs well with the database in the alternate format.

ewaller@turing ~ 1043 %wunderground.py                    
Traceback (most recent call last):
  File "/usr/bin/wunderground.py", line 216, in <module>
    main()
  File "/usr/bin/wunderground.py", line 165, in main
    theShelve = shelve.open(PersistentStrorageFilename)
  File "/usr/lib/python3.6/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/usr/lib/python3.6/shelve.py", line 227, in __init__
    Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
  File "/usr/lib/python3.6/dbm/__init__.py", line 91, in open
    "available".format(result))
dbm.error: db type is dbm.gnu, but the module is not available
ewaller@turing ~ [1]1044 %rm .wunderground                   
ewaller@turing ~ 1045 %wunderground.py -k <<REDACTED>> -l 91104 -i
Location : Pasadena, CA                                               
Sun, 07 Jan 2018 13:11:39 -0800
Condition : Clear
Temperature :73.4 F (23.0 C)
Humidity :36% / Dewpoint :45 F (7 C)
Pressure :30.03 in hg. Trend -
Visibility :10.0mi
Wind: West @ 0.0 mph
precip :0.00 in (0 mm)
precip/hr :0.00 in
Moon : Waning Gibbous 61%
Sunrise : 6:59 ; Sunset : 16:58
Weather data by Weather Underground
(http://www.wunderground.com)
ewaller@turing ~ 1046 %ls .wunderground*
.wunderground.dir  .wunderground.pag
ewaller@turing ~ 1047 %

Last edited by ewaller (2018-01-07 23:11:39)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#2 2018-01-07 21:31:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: [SOLVED] Python dbm.gnu

Are you importing dbm.gnu?  I just tried it and it imported fine, so the module is still present.

I checked the docs which indicate that if the module is not available, python fill fall back to other implementations.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-01-07 21:35:43

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [SOLVED] Python dbm.gnu

Are you running the staging repository? There is a new release of gdbm and a rebuild of python with that version in staging. Maybe there are still some problems with that?


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2018-01-07 22:27:55

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: [SOLVED] Python dbm.gnu

Trilby wrote:

Are you importing dbm.gnu?  I just tried it and it imported fine, so the module is still present.

I had not.  I was importing shelve.

ewaller@turing ~ 1001 %python                            
Python 3.6.4 (default, Dec 23 2017, 19:07:07) 
[GCC 7.2.1 20171128] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbm.gnu
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/dbm/gnu.py", line 3, in <module>
    from _gdbm import *
ImportError: /usr/lib/python3.6/lib-dynload/_gdbm.cpython-36m-x86_64-linux-gnu.so: undefined symbol: gdbm_errno
>>> 
progandy wrote:

Are you running the staging repository? There is a new release of gdbm and a rebuild of python with that version in staging. Maybe there are still some problems with that?

No, but you got me thinking.  I have been playing with python-pyside2 from the AUR; I wonder if I am seeing some side effects of that.

It sounds like we should still support it, so I that answers the fundamental question.  I'll look around and see why it broke and make the appropriate bug reports.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2018-01-07 23:11:14

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: [SOLVED] Python dbm.gnu

Well, I backed out all the stuff from the AUR having to do with pyside and I still had issues.  Reinstalled gdbm and all is well O_o
No clue how I stepped on it.  Thanks guys.   I'll mark it solved, though I would like to know how and when I did this to myself.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB