OpenPrinting / system-config-printer

Graphical user interface for CUPS administration
GNU General Public License v2.0
163 stars 89 forks source link

NameError: name 'Secret' is not defined #101

Closed jonblack closed 6 years ago

jonblack commented 6 years ago

I installed system-config-printer on debian unstable and since sometime in the last month it's giving the following error:

Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 84, in <module>
    import jobviewer
  File "/usr/share/system-config-printer/jobviewer.py", line 76, in <module>
    NETWORK_PASSWORD = Secret.Schema.new("org.system.config.printer.store", Secret.SchemaFlags.NONE,
NameError: name 'Secret' is not defined

When I run the import in a python3 prompt I get:

>>> from gi.repository import Secret
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 888, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 127, in find_module
    'introspection typelib not found' % namespace)
ImportError: cannot import name Secret, introspection typelib not found

The following packages are installed:

I did manage to fix it by aptitude purge system-config-printer and reinstalling, but it would be nice to have known what the problem was. I'm also wondering if it should just continue with USE_SECRET set to False.

zdohnal commented 6 years ago

Hi Jon, seems Secret module wasn't installed correctly or at all (maybe packaging error?) at first time and it got fixed by re-installing. USE_SECRET was default for long time before, it was set to False only temporarily, because the code, which was run when USE_SECRET was True, used deprecated libgnome-keyring. Now the code uses libsecret, which is maintained.