rh-messaging / cli-proton-python

Proton Python client provided by QE for testing.
Apache License 2.0
4 stars 6 forks source link

RuntimeWarning: 'cli_proton_python.sender' found in sys.modules after import of package 'cli_proton_python', but prior to execution of 'cli_proton_python.sender' #58

Open jiridanek opened 1 year ago

jiridanek commented 1 year ago
% python3 -m cli_proton_python.sender --log-msgs=dict
<frozen runpy>:128: RuntimeWarning: 'cli_proton_python.sender' found in sys.modules after import of package 'cli_proton_python', but prior to execution of 'cli_proton_python.sender'; this may result in unpredictable behaviour
jiridanek commented 1 year ago

Running cli from source directory does not work

$ python3 cli_proton_python/sender.py --log-msgs=dict
Traceback (most recent call last):
  File "/home/jdanek/repos/testing/cli/cli-proton-python/cli_proton_python/sender.py", line 33, in <module>
    from cli_proton_python import coreclient, options, utils
ModuleNotFoundError: No module named 'cli_proton_python'

So to run from source, set PYTHONPATH

$ PYTHONPATH=. python3 cli_proton_python/sender.py --log-msgs=dict
ERROR {'cause' :'Transport error: proton.pythonio - Connection refused to all addresses'}
ERROR {'cause' :'Transport error: proton.pythonio - Connection refused to all addresses'}