Skip to content
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

sabctools does not work with pbs #548

Open
Ravencentric opened this issue Mar 1, 2025 · 1 comment
Open

sabctools does not work with pbs #548

Ravencentric opened this issue Mar 1, 2025 · 1 comment
Labels
external The problem is with an external package or dependency

Comments

@Ravencentric
Copy link

Ravencentric commented Mar 1, 2025

PyPI: https://pypi.org/project/sabctools/
GitHub: https://github.com/sabnzbd/sabctools/

Quick reproduction:

docker run --rm -it ghcr.io/astral-sh/uv:0.6.3-python3.13-bookworm /bin/sh
# uv venv -p 3.13
Using CPython 3.13.2 interpreter at: /usr/local/bin/python3.13
Creating virtual environment at: .venv
# uv pip install sabctools
Resolved 1 package in 81ms
Prepared 1 package in 59ms
Installed 1 package in 4ms
 + sabctools==8.2.5
# uv run python
Python 3.13.2 (main, Feb  6 2025, 22:37:13) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sabctools
>>> sabctools.__version__
'8.2.5'
>>> exit
# rm -rf .venv
# uv venv -p 3.13 --python-preference only-managed
Using CPython 3.13.2
Creating virtual environment at: .venv
# uv pip install sabctools
Resolved 1 package in 9ms
Installed 1 package in 13ms
 + sabctools==8.2.5
# uv run python
Python 3.13.2 (main, Feb 12 2025, 14:51:17) [Clang 19.1.6 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sabctools
AttributeError: module '_ssl' has no attribute '__file__'. Did you mean: '__name__'?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import sabctools
  File "/.venv/lib/python3.13/site-packages/sabctools/__init__.py", line 2, in <module>
    from sabctools.sabctools import *
SystemError: initialization of sabctools raised unreported exception
>>>
@indygreg
Copy link
Collaborator

indygreg commented Mar 2, 2025

In PBS, the _ssl extension module is linked into libpython.so and therefore doesn't have an appropriate standalone file name, so __file__ isn't set on the Python module.

Python doesn't mandate that __file__ be set for a module. It is arguably a bug of sabctools to expect __file__ to exist.

@zanieb zanieb added the external The problem is with an external package or dependency label Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The problem is with an external package or dependency
Projects
None yet
Development

No branches or pull requests

3 participants