Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

'NoneType' object does not support the context manager protocol when clicking on PIV #367

@dlazerka

Description

@dlazerka
  • YubiKey Manager version: 1.2.5
  • How was it installed?: just ran *.AppImage from my non-root user
  • Operating system and version: Linux Mint 21.3 Virginia Cinnamon (aka Ubuntu 22.04 jammy).
  • YubiKey model and version: Nano 5
  • Bug description summary: Error when clicking Application / PIV

Steps to reproduce

  1. Run the .AppImage (device recognized correctly).
  2. Click Applications menu.
  3. Click bottom menu item "PIV"

Expected result

No error

Actual results

Qt Quick Layouts: Polish loop detected. Aborting after two iterations.
Qt Quick Layouts: Polish loop detected. Aborting after two iterations.
Failed to open device
Traceback (most recent call last):
  File "qrc:///py/yubikey.py", line 78, in wrapped
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "qrc:///py/yubikey.py", line 300, in refresh_piv
    with self._open_device([SmartCardConnection]) as conn:
TypeError: 'NoneType' object does not support the context manager protocol

And red error message in GUI.

Other info

If trying to run from root user, and performing the same steps, the error logs are somewhat different:

[sudo] password for user:             
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Failed to open device
Traceback (most recent call last):
  File "qrc:///py/yubikey.py", line 78, in wrapped
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "qrc:///py/yubikey.py", line 300, in refresh_piv
    with self._open_device([SmartCardConnection]) as conn:
TypeError: 'NoneType' object does not support the context manager protocol
qml: qrc:/qml/PivView.qml:26: Error: Invalid write to global property "isMacOs"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions