-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace py dependency with termcolor. #575
Conversation
This is great. If you have the time, this is also a good chance to change strings to f-strings |
Only the colored terminal printing feature of the borderline deprecated py library is used so swap it out for termcolor which is slimmer. Doing so also fixes the pains that py's submodule deprecations sculdugery have been causing PyInstaller users (e.g. #245, #447, plus a new regression specific to pyshark 0.5.2 leading to a `ModuleNotFoundError: No module named 'py._io'`).
Done. |
I also found this bug when running my program packaged with pyinstaller which the version of pyshark was 0.5.3. ...
File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module
File "pyshark\__init__.py", line 13, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module
File "pyshark\capture\live_capture.py", line 7, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module
File "pyshark\capture\capture.py", line 11, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module
File "pyshark\packet\packet.py", line 8, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module
File "pyshark\packet\layers\base.py", line 11, in <module>
File "pyshark\packet\layers\base.py", line 61, in BaseLayer
File "py\_vendored_packages\apipkg\__init__.py", line 157, in __makeattr
File "py\_vendored_packages\apipkg\__init__.py", line 75, in importobj
ModuleNotFoundError: No module named 'py._io' Could you please fix the bug by merging this PR ASAP? cc @KimiNewt |
I've reluctantly put a fragile temporary fix (pyinstaller/pyinstaller-hooks-contrib#477) into PyInstaller since this PR hasn't moved in the last 6 weeks. If you And come on @KimiNewt! I didn't refactor all those f-strings for fun you know/ |
Wow, thank you very much! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as this was tested. Looks good to me.
@KimiNewt can we get a new release with this included so folks can upgrade pyshark and close out CVE-2022-42969? |
Only the colored terminal printing feature of the borderline deprecated py library is used so swap it out for termcolor which is slimmer. Doing so also fixes the pains that py's submodule deprecations sculdugery have been causing PyInstaller users (e.g. #245, #447, plus a new regression specific to pyshark 0.5.2 leading to a
ModuleNotFoundError: No module named 'py._io'
).Normally I'd raise an issue first to see what you think about the idea but it looked like the easiest way to measure feasibility of this change was just to try it and see.