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

structlog 21.3.0 fails with python -OO #374

Closed
ghost opened this issue Nov 25, 2021 · 4 comments
Closed

structlog 21.3.0 fails with python -OO #374

ghost opened this issue Nov 25, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 25, 2021

__doc__.strip() in structlog/__init__.py, line 48 (introduced with 5e6ea9c) fails with

AttributeError: 'NoneType' object has no attribute 'strip'

when used with python -OO, which discards docstrings.

@ghost
Copy link
Author

ghost commented Nov 25, 2021

As a fix, I'd just duplicate the string and set

__description__ = "Structured Logging for Python"

It's not trivial to cover this with conventional tests, as python -O already removes assert statements.
But if you wish, I could try to contribute a separate job within .github/workflows/main.yml.

@hynek
Copy link
Owner

hynek commented Nov 25, 2021

This has already been fixed in #373. I’m only waiting for #371 and will release 21.4.

@ghost
Copy link
Author

ghost commented Nov 25, 2021

Oh, never mind: I didn't see that PR. Thanks!

@ghost ghost closed this as completed Nov 25, 2021
@hynek
Copy link
Owner

hynek commented Nov 25, 2021

FYI 21.4 is on PyPI

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant