proxy.py
proxy.py copied to clipboard
RuntimeWarning: `proxy.common.pki` found in sys.modules after import of package `proxy.common`
Describe the bug
When attempting to make ca-certificates
or make https-certificates
console is flooded with RuntimeWarning
s. This happens cloned version from GitHub.
To Reproduce Steps to reproduce the behavior:
- Clone from GitHub
- Create a virtualenv and install requirements.txt
- Run
make ca-certificates
- See
RuntimeWarning
multiple times
(proxy.py--OOQT5gg) pop@pop-os:~/gits/proxy.py$ make ca-certificates
# Generate CA key
python -m proxy.common.pki gen_private_key \
--private-key-path ca-key.pem
/usr/lib/python3.8/runpy.py:127: RuntimeWarning: 'proxy.common.pki' found in sys.modules after import of package 'proxy.common', but prior to execution of 'proxy.common.pki'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
python -m proxy.common.pki remove_passphrase \
--private-key-path ca-key.pem
/usr/lib/python3.8/runpy.py:127: RuntimeWarning: 'proxy.common.pki' found in sys.modules after import of package 'proxy.common', but prior to execution of 'proxy.common.pki'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
# Generate CA certificate
python -m proxy.common.pki gen_public_key \
--private-key-path ca-key.pem \
--public-key-path ca-cert.pem
/usr/lib/python3.8/runpy.py:127: RuntimeWarning: 'proxy.common.pki' found in sys.modules after import of package 'proxy.common', but prior to execution of 'proxy.common.pki'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
# Generate key that will be used to generate domain certificates on the fly
# Generated certificates are then signed with CA certificate / key generated above
python -m proxy.common.pki gen_private_key \
--private-key-path ca-signing-key.pem
/usr/lib/python3.8/runpy.py:127: RuntimeWarning: 'proxy.common.pki' found in sys.modules after import of package 'proxy.common', but prior to execution of 'proxy.common.pki'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
python -m proxy.common.pki remove_passphrase \
--private-key-path ca-signing-key.pem
/usr/lib/python3.8/runpy.py:127: RuntimeWarning: 'proxy.common.pki' found in sys.modules after import of package 'proxy.common', but prior to execution of 'proxy.common.pki'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
Expected behavior I want to generate certificates without these warnings.
Version information
- OS: Pop!_OS 20.10
- proxy.py Version 2.3.0
- Python: 3.8.6
Thank you @kazik56 for reporting this. Does these warnings result in any unexpected behavior? If not, I will safely ignore them for now. Unfortunately, I don't have access to Pop!_OS
and I wasn't able to reproduce / replicate these warnings on Mac and Linux OS. If no functionality is impacted, I'll label this issue as an enhancement and circle back to it in future.
No. After inspecting one more time certificates files are visible in the cloned directory. This was just something I wanted to point out as I felt that it might not be a desired behavior.
I have one more question - the Makefile uses python
instead of python3
- should I solve this by making an alias or replacing all python
occurrences with python3
?
It's better to ensure python3 is default in the environment instead of changing all 'python' with 'python3'. Example if you are using virtualenv, this will automatically be the case.
On Tue, Nov 17, 2020, 3:43 AM kazik56 [email protected] wrote:
No. After inspecting one more time certificates files are visible in the cloned directory. This was just something I wanted to point out as I felt that it might not be a desired behavior.
I have one more question - the Makefile uses python instead of python3 - should I solve this by making an alias or replacing all python occurrences with python3?
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/abhinavsingh/proxy.py/issues/459#issuecomment-728361323, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA6Y4OZCILU4R6KTZIQ573SQGPWZANCNFSM4TVPQAWA .