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
causing job died when stderr closed in the middle #1033
Comments
Hmm one solution to this would be to pass in a custom file to tqdm. Something like |
|
I don't understand at all what you mean. import logging, time
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
while True:
log.info("hello")
time.sleep(1) This program:
Clearly expected behaviour and nothing to do with |
Not exactly, using your test code above, the job won't die when the shell exits. You can check But the code below will cause the job dead when the shell exits. import tqdm, time
for i in tqdm.tqdm(range(100)):
print('hello', file=open('test.output', 'a'))
time.sleep(1) |
Can't reproduce this (running on Ubuntu, python2 and python3). Maybe your system (mac) is different? |
I can reproduce it on ubuntu 16.04 and macos, zsh and bash, python3. Can you try below again?
# test.py
import logging, time
for i in range(100):
logging.warn(f"hello {i}")
print(f"hello {i}", file=open("test.output", "a"))
time.sleep(1)
|
Nope; doesn't continue for me. So clearly looks like a difference in I/O handling between your system and mine; and nothing to do with
|
Strange, I have tried on 3 systems and they all show the disowned job run in background. It seems |
right got it |
could you try #1036 ( |
Confirm that branch |
read the known issues
environment, where applicable:
Steps to reproduce:
python somejob.py &!
. tqdm works fine producing progress barpython somejob.py 2>/dev/null &!
, it will keep running even the shell exited.I guess when the shell exits,
stderr
will change/close, tqdm failed to write to that file descriptor as before and raise exception.What I expected is, tqdm should keep silent if no file to write and never disturb the main job.
The text was updated successfully, but these errors were encountered: