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

tv_grab_nl3.py with --quiet still writes to stderr #45

Closed
janpascal opened this issue Dec 18, 2019 · 4 comments
Closed

tv_grab_nl3.py with --quiet still writes to stderr #45

janpascal opened this issue Dec 18, 2019 · 4 comments

Comments

@janpascal
Copy link

I'm running tv_grab_nl3.py in a cron job. stdout is piped via a socket to tvheadend, but every time the job runs I get an email from cron with text like

Loaded the English texts file
Using config file: /home/janpascal/.xmltv/tv_grab_nl3_py.conf
Downloading tv_grab_API.json...
Downloading tv_grab_nl.json...

It looks like this is the stderr output from tv_grab_nl3.py, which it outputs even though the --quiet flag is used. I think this output should be suppressed with the --quiet flag.

@hikavdh
Copy link
Contributor

hikavdh commented Dec 19, 2019

quiet suppresses output on stdout not on stderr

@hikavdh
Copy link
Contributor

hikavdh commented Dec 19, 2019

So if you want to pipe the result instead of using the output file, you must not use quiet as then you get nothing to pipe!

@hikavdh hikavdh closed this as completed Dec 19, 2019
@janpascal
Copy link
Author

I'm sorry, but I'm quite sure as this has worked for years. I've just tried again just to be absolutely sure:

venv/bin/tv_grab_nl3.py --quiet > stdout.txt 2>stderr.txt &

gives the status messages on stderr as above, and the xml data on stdout.

The function Logging.writelog (in tv_grab_IO.py) checks the quiet flag and should prevent writing to stderr when it is set. Except that it doesn't for these few lines. I'll try to check why :).

@hikavdh
Copy link
Contributor

hikavdh commented Dec 20, 2019

You're right. It's been a long time since I looked at that part, while in between I worked other code.
My guess is that there is a problem with your log-file as then message meant for the log-file are send to stderr. In that stderr output you then should see something about the log-file.

@hikavdh hikavdh reopened this Dec 20, 2019
@hikavdh hikavdh closed this as completed Feb 2, 2020
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

2 participants