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

logging in __del__ is not reliable #141

Open
graingert opened this issue Jul 31, 2020 · 1 comment
Open

logging in __del__ is not reliable #141

graingert opened this issue Jul 31, 2020 · 1 comment

Comments

@graingert
Copy link

[2020-07-31T11:31:18.114Z] --- Logging error ---
[2020-07-31T11:31:18.114Z] Traceback (most recent call last):
[2020-07-31T11:31:18.114Z]   File "/usr/lib/python3.8/logging/__init__.py", line 1084, in emit
[2020-07-31T11:31:18.114Z]     stream.write(msg + self.terminator)
[2020-07-31T11:31:18.114Z]   File "/opt/001-python/lib/python3.8/site-packages/_pytest/capture.py", line 441, in write
[2020-07-31T11:31:18.114Z]     self.buffer.write(obj)
[2020-07-31T11:31:18.114Z] ValueError: I/O operation on closed file
[2020-07-31T11:31:18.114Z] Call stack:
[2020-07-31T11:31:18.114Z]   File "/opt/001-python/lib/python3.8/site-packages/redislite/client.py", line 83, in _cleanup
[2020-07-31T11:31:18.114Z]     logger.debug(
[2020-07-31T11:31:18.115Z] Message: 'Shutting down redis server with pid of %r'
[2020-07-31T11:31:18.115Z] Arguments: (18113,)
[2020-07-31T11:31:18.115Z] --- Logging error ---
@graingert
Copy link
Author

also note that redis-py v4 will enforce explicit resource management: https://github.com/andymccurdy/redis-py/blob/master/CHANGES#L16-L17

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