systembridgecli: TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
See original GitHub issueDescription
Running the example python -m systembridgecli --help
(though on my system I use python3
) I get the following error:
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/scott/.local/lib/python3.9/site-packages/systembridgecli/__main__.py", line 151, in <module>
app()
File "/home/scott/.local/lib/python3.9/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "/home/scott/.local/lib/python3.9/site-packages/typer/main.py", line 232, in get_command
click_command = get_group(typer_instance)
File "/home/scott/.local/lib/python3.9/site-packages/typer/main.py", line 218, in get_group
group = get_group_from_info(TyperInfo(typer_instance))
File "/home/scott/.local/lib/python3.9/site-packages/typer/main.py", line 349, in get_group_from_info
command = get_command_from_info(command_info=command_info)
File "/home/scott/.local/lib/python3.9/site-packages/typer/main.py", line 425, in get_command_from_info
) = get_params_convertors_ctx_param_name_from_function(command_info.callback)
File "/home/scott/.local/lib/python3.9/site-packages/typer/main.py", line 401, in get_params_convertors_ctx_param_name_from_function
parameters = get_params_from_function(callback)
File "/home/scott/.local/lib/python3.9/site-packages/typer/utils.py", line 11, in get_params_from_function
type_hints = get_type_hints(func)
File "/usr/lib/python3.9/typing.py", line 1449, in get_type_hints
value = _eval_type(value, globalns, localns)
File "/usr/lib/python3.9/typing.py", line 283, in _eval_type
return t._evaluate(globalns, localns, recursive_guard)
File "/usr/lib/python3.9/typing.py", line 539, in _evaluate
eval(self.__forward_code__, globalns, localns),
File "<string>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
What Platform / OS are you running?
Linux
What version are you running?
3.3.0
Anything in the logs or a references that might be useful?
It’s not entirely clear to me if systembridgebackend
needs to be running for the CLI tool to work. It is running via python3 -m systembridgebackend --no-gui
, but there are some errors. Here’s an example of one:
2022-07-06 12:24:38 ERROR (Thread-12) [systembridgeshared.database.Database] Error executing SQL: INSERT INTO disk (key, value, timestamp) VALUES ('io_counters_read_count', '992937', 1657124678.8771517) ON CONFLICT(key) DO UPDATE SET value = '992937', timestamp = 1657124678.8771517 WHERE key = 'io_counters_read_count'
cannot commit - no transaction is active
All of them seem to be SQL related errors. I can create a separate issue for these errors if it seems unrelated.
Additional information
Full version information:
$ python3 -m pip show systembridgeshared systembridgebackend systembridgecli systembridgefrontend systembridgegui
Name: systembridgeshared
Version: 3.3.0
Summary: System Bridge Shared
Home-page: https://github.com/timmo001/system-bridge
Author: Aidan Timson (Timmo)
Author-email: contact@timmo.xyz
License: MIT
Location: /home/scott/.local/lib/python3.9/site-packages
Requires: aiohttp, appdirs, colorlog, cryptography, incremental, pandas, pydantic
Required-by:
---
Name: systembridgebackend
Version: 3.3.0
Summary: System Bridge Backend
Home-page: https://github.com/timmo001/system-bridge
Author: Aidan Timson (Timmo)
Author-email: contact@timmo.xyz
License: MIT
Location: /home/scott/.local/lib/python3.9/site-packages
Requires: aiogithubapi, incremental, keyboard, mutagen, plyer, psutil, pyinstaller, sanic, sanic-ext, sanic-scheduler, zeroconf
Required-by:
---
Name: systembridgecli
Version: 3.3.0
Summary: System Bridge CLI
Home-page: https://github.com/timmo001/system-bridge
Author: Aidan Timson (Timmo)
Author-email: contact@timmo.xyz
License: MIT
Location: /home/scott/.local/lib/python3.9/site-packages
Requires: incremental, pyinstaller, shellingham, tabulate, typer
Required-by:
---
Name: systembridgefrontend
Version: 3.3.0
Summary: System Bridge Frontend
Home-page: https://github.com/timmo001/system-bridge
Author: Aidan Timson (Timmo)
Author-email: contact@timmo.xyz
License: MIT
Location: /home/scott/.local/lib/python3.9/site-packages
Requires:
Required-by:
---
Name: systembridgegui
Version: 3.3.0
Summary: System Bridge GUI
Home-page: https://github.com/timmo001/system-bridge
Author: Aidan Timson (Timmo)
Author-email: contact@timmo.xyz
License: MIT
Location: /home/scott/.local/lib/python3.9/site-packages
Requires: incremental, pyinstaller, pyperclip, PySide6, typer
Required-by:
System info:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 21.04
Release: 21.04
Codename: hirsute
$ uname -a
Linux scott-desktop-linux 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
TypeError: unsupported operand type(s) for |: 'type ... - GitHub
I searched the Typer documentation, with the integrated search. I already searched in Google "How to X in Typer" and didn't find any...
Read more >Unsupported operand type(s) for *: 'NoneType' and 'NoneType ...
The Python TypeError: unsupported operand type(s) for *: 'NoneType' and 'NoneType' occurs when we try to use the multiplication operator with `None` values....
Read more >How to fix "TypeError: unsupported operand type(s) for + ...
In python3, print is a function that returns None . So, the line: print ("number of donuts: " ) +str(count). you have None...
Read more >Unsupported operand type(s) for +: 'nonetype' and 'str'
Values equal to None cannot be concatenated with a string value. This causes the error “TypeError: unsupported operand type(s) for +: 'nonetype' ...
Read more >unsupported operand type(s) for + : 'NoneType' and 'str' - UCM
Hi All, I got below error while creating weblogic domain in UCM. Successfully installed Oracle,RCU and weblogic while creating domain i got ...
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
Yeah, all these things like this:
should instead be:
with
from typing import Optional
Confirmed version
3.4.3
has fixed this specific error for me.