Summary: | >=net-misc/streamlink-5: Doesn't work from unprivileged user | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Michael <voron1> |
Component: | Current packages | Assignee: | Sam James <sam> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | gentoo.qxrin, gentoo, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/streamlink/streamlink/issues/5083 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | emerge-info |
Description
Michael
2023-01-27 03:27:26 UTC
Can't reproduce: ``` $ streamlink -v usage: streamlink [OPTIONS] <URL> [STREAM] Use -h/--help to see the available options or read the manual at https://streamlink.github.io $ streamlink --version streamlink 5.2.1 ``` Do you have PYTHONPATH or something set in your environment? No, it's unset sudo wouldn't change it anyway (In reply to Michael from comment #3) > sudo wouldn't change it anyway There's a limited number of things which can break this, so you'll have to forgive me for asking questions about each of them. And yes, it would, because sudo only perserves certain environment variables? If you write a small Python program with just 'from Crypto.Util.Padding import unpad' inside, what happens when you execute that? Sure, I will be happy to help troubleshoot. It is as weird to me as it is to you: ``` cat test.py from Crypto.Util.Padding import unpad ``` python ./test.py Traceback (most recent call last): File "/home/corvus/soft/streamlink-debug/./test.py", line 1, in <module> from Crypto.Util.Padding import unpad ModuleNotFoundError: No module named 'Crypto.Util.Padding' We get our minimal reproducer. :-) $ yt-dlp --version Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/yt_dlp/dependencies.py", line 27, in <module> from Cryptodome.Cipher import AES as Cryptodome_AES ModuleNotFoundError: No module named 'Cryptodome' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python-exec/python3.10/yt-dlp", line 5, in <module> from yt_dlp import main File "/usr/lib/python3.10/site-packages/yt_dlp/__init__.py", line 18, in <module> from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS File "/usr/lib/python3.10/site-packages/yt_dlp/cookies.py", line 18, in <module> from .aes import ( File "/usr/lib/python3.10/site-packages/yt_dlp/aes.py", line 5, in <module> from .dependencies import Cryptodome_AES File "/usr/lib/python3.10/site-packages/yt_dlp/dependencies.py", line 37, in <module> Cryptodome_AES.new(b'abcdefghijklmnop') File "/home/corvus/.local/lib/python3.10/site-packages/Crypto/Cipher/AES.py", line 95, in new return AESCipher(key, *args, **kwargs) File "/home/corvus/.local/lib/python3.10/site-packages/Crypto/Cipher/AES.py", line 59, in __init__ blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs) File "/home/corvus/.local/lib/python3.10/site-packages/Crypto/Cipher/blockalgo.py", line 141, in __init__ self._cipher = factory.new(key, *args, **kwargs) SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats $ sudo yt-dlp --version 2023.01.06 The other revdep of cryptodome on my system behaves the same. :-( (In reply to Michael from comment #5) > Sure, I will be happy to help troubleshoot. It is as weird to me as it is to > you: > > ``` > cat test.py > from Crypto.Util.Padding import unpad > ``` > > python ./test.py > Traceback (most recent call last): > File "/home/corvus/soft/streamlink-debug/./test.py", line 1, in <module> > from Crypto.Util.Padding import unpad > ModuleNotFoundError: No module named 'Crypto.Util.Padding' > > We get our minimal reproducer. :-) heh :) - Okay, any better with 'python -E ./test.py'? - If you temporarily uninstall pycryptodome forcefully (quickpkg it first), does streamlink still work as root? (Put pycryptodome back afterwards). - I assume re-emerging pycryptodome makes no difference? - What does 'find /usr/lib/python* -exec qfile -o {} +' give? (Hopefully no output at all.) (In reply to Sam James from comment #7) > (In reply to Michael from comment #5) > > Sure, I will be happy to help troubleshoot. It is as weird to me as it is to > > you: > > > > ``` > > cat test.py > > from Crypto.Util.Padding import unpad > > ``` > > > > python ./test.py > > Traceback (most recent call last): > > File "/home/corvus/soft/streamlink-debug/./test.py", line 1, in <module> > > from Crypto.Util.Padding import unpad > > ModuleNotFoundError: No module named 'Crypto.Util.Padding' > > > > We get our minimal reproducer. :-) > > heh :) > > - Okay, any better with 'python -E ./test.py'? No, same. > - If you temporarily uninstall pycryptodome forcefully (quickpkg it first), > does streamlink still work as root? (Put pycryptodome back afterwards). No, it says `ModuleNotFoundError: No module named 'Crypto'` > - I assume re-emerging pycryptodome makes no difference? None. > - What does 'find /usr/lib/python* -exec qfile -o {} +' give? (Hopefully no > output at all.) ``` # find /usr/lib/python* -exec qfile -o {} + /usr/lib/python3.10/site-packages/Brotli-1.0.9-py3.10.egg-info.backup.0000 /usr/lib/python3.9 /usr/lib/python3.9/site-packages /usr/lib/python3.9/site-packages/Brotli-1.0.9-py3.9.egg-info.backup.0000 ``` Finds a little trash. You should remove those orphaned files it found (the egg, and all of 3.9) as an aside. - If you run 'env -i python ./test.py', does that work as your user? - I just realised I assumed that 'test.py' works as root. It does, right? - Failing that, we can strace the root invocation and the user invocation and compare what's different. (In reply to Sam James from comment #9) > You should remove those orphaned files it found (the egg, and all of 3.9) as > an aside. Yes, I removed the trash. The system is 13 years old, cobwebs, dustbunnies everywhere. I swipe them away as I encounter them. I even used portage-orphaned-files or some such, when it started feeling like grandfather's attic. I should show you emerge.log. It's 50MB long, starts in 2010. > - If you run 'env -i python ./test.py', does that work as your user? Yes, same: $ env -i python ./test.py Traceback (most recent call last): File "/home/corvus/soft/streamlink-debug/./test.py", line 1, in <module> from Crypto.Util.Padding import unpad ModuleNotFoundError: No module named 'Crypto.Util.Padding' > - I just realised I assumed that 'test.py' works as root. It does, right? Yes, returns no errors. > - Failing that, we can strace the root invocation and the user invocation > and compare what's different. I guess so. I don't think I can really do anything about this. This isn't specific to streamlink and it's somehow specific to your system. There's something off with site-packages or one of the import paths of Python on your machine, I guess. |