We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Steps to reproduce:
❯ PYTHONOPTIMIZE=2 venv/bin/python3 Python 3.12.2 (main, Feb 6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import bitstring Traceback (most recent call last): File "<stdin>", line 1, in <module> File "[...]/venv/lib/python3.12/site-packages/bitstring/__init__.py", line 305, in <module> Bits.__doc__ = Bits.__doc__.replace('[GENERATED_PROPERTY_DESCRIPTIONS]', property_docstring) ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'replace'
This is because starting Pyhton with PYTHONOPTIMIZE=2 or with the -O0 argument strips away the docstrings so Bits.__doc__ becomes None.
PYTHONOPTIMIZE=2
-O0
Bits.__doc__
None
The text was updated successfully, but these errors were encountered:
Ah, that's not something I had considered!
I've reproduced it and will get a fix in for version 4.2.1 shortly.
Thank you for the bug report.
Sorry, something went wrong.
Fix for crash when docstrings are optimized out. Bug #321.
3d2ccb1
This should be working again the 4.2.1 release.
scott-griffiths
No branches or pull requests
Steps to reproduce:
This is because starting Pyhton with
PYTHONOPTIMIZE=2
or with the-O0
argument strips away the docstrings soBits.__doc__
becomesNone
.The text was updated successfully, but these errors were encountered: