Closed kszys closed 4 days ago
Similar problem using the scheduler:
with USE_SCHEDULER = True
the logger complain that the log file is closed.
My setting options in settings.py
(but got same error using a file):
LOGGERS = [
"debug:stdout"
]
--- Logging error ---
Traceback (most recent call last):
File "/Users/max/.pyenv/versions/3.10.2/lib/python3.10/logging/__init__.py", line 1103, in emit
stream.write(msg + self.terminator)
ValueError: I/O operation on closed file
Call stack:
File "/Users/max/.pyenv/versions/3.10.2/lib/python3.10/threading.py", line 966, in _bootstrap
self._bootstrap_inner()
File "/Users/max/.pyenv/versions/3.10.2/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
self.run()
File "/Users/max/.pyenv/versions/3.10.2/lib/python3.10/threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "/Users/max/.pyenv/versions/py4web_3.10.2/lib/python3.10/site-packages/pydal/tools/scheduler.py", line 183, in loop
if not self.step():
File "/Users/max/.pyenv/versions/py4web_3.10.2/lib/python3.10/site-packages/pydal/tools/scheduler.py", line 228, in step
self.logger.info("no new tasks")
Message: 'no new tasks'
It seems that the last version w/o the problem was version 1.20240518.3
Hmm... the version you mention do not seem to exist in https://pypi.org/project/py4web/#history
I checked it out on git. git checkout v1.20240518.3
In any case you can try 1.20240509.1 that is downloadable
Thanks! I was able to reproduce.
I believe this is now fixed. Thanks.
I have an issue with logging in py4web app (does not seem to be related to #874 ) - this is with logging to
stdout
orstderr
. Here is a minimal example:While the first logging command correctly prints
Logger has been initialized
to the console (during loading of the app), the HTTP request to/time
very consistently produces an error in the console -ValueError: I/O operation on closed file
:Running in Docker (not sure if this matters), version: