Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] 2.3.10 Failed to start. TypeError: unsupported operand type(s) for |: 'GObjectMeta' and 'NoneType' #135

Closed
cesarlol opened this issue Aug 19, 2024 · 1 comment
Labels

Comments

@cesarlol
Copy link

Describe the bug
In ubuntu 20.04, after apt upgrade to 2.3.10, failed to start

To Reproduce
Steps to reproduce the behavior:

  1. Go to terminal and run 'indicator-sound-switcher'
  2. See error

Expected behavior
Indicator running and show in top bar

Desktop (please complete the following information):

  • OS:Ubuntu 20.04 LTS
  • Desktop environment: Gnome ver. 3.36.9
  • Sound Switcher Indicator version [2.3.10]
  • Installation source: PPA via apt

Indicator config:

$ cat indicator-sound-switcher.json 
{
    "devices": {
        "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic": {
            "ports": {
                "[Out] HDMI3": {},
                "[Out] HDMI2": {},
                "[Out] HDMI1": {},
                "[Out] Speaker": {},
                "[Out] Headphones": {},
                "[In] Mic2": {},
                "[In] Mic1": {}
            }
        },
        "alsa_card.usb-C-Media_Electronics_Inc._Microsoft_LifeChat_LX-3000-00": {
            "ports": {
                "analog-input-mic": {},
                "multichannel-input": {},
                "analog-output-speaker": {},
                "iec958-stereo-output": {}
            }
        }
    }
}

Indicator log:
In order to fetch it, quit the indicator from the menu ("Quit"), open Terminal and start it again as follows:

$ indicator-sound-switcher -vv
Traceback (most recent call last):
  File "/usr/bin/indicator-sound-switcher", line 33, in <module>
    sys.exit(load_entry_point('indicator-sound-switcher==2.3.10', 'console_scripts', 'indicator-sound-switcher')())
  File "/usr/bin/indicator-sound-switcher", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/indicator_sound_switcher/__init__.py", line 32, in <module>
    from .indicator import SoundSwitcherIndicator, APP_ID, APP_NAME, APP_VERSION
  File "/usr/lib/python3/dist-packages/indicator_sound_switcher/indicator.py", line 19, in <module>
    from .card import CardProfile, Card
  File "/usr/lib/python3/dist-packages/indicator_sound_switcher/card.py", line 23, in <module>
    class Card(GObject.GObject):
  File "/usr/lib/python3/dist-packages/indicator_sound_switcher/card.py", line 72, in Card
    def get_active_profile(self) -> CardProfile | None:
TypeError: unsupported operand type(s) for |: 'GObjectMeta' and 'NoneType'

Attach any output to this bug report.

Additional context
Add any other context about the problem here.

@cesarlol cesarlol added the bug label Aug 19, 2024
@cesarlol
Copy link
Author

I found that my python version is 3.8.10 which is incompatible with the hint notation for '|' operator, I fix it by removing the hint type on card.py.

def get_active_profile(self) :

Another solution should be to update python version > 3.10.

@yktoo yktoo closed this as completed in 3469f19 Aug 20, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant