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

Writing to standard output #74

Closed
marcverhagen opened this issue May 31, 2017 · 4 comments
Closed

Writing to standard output #74

marcverhagen opened this issue May 31, 2017 · 4 comments

Comments

@marcverhagen
Copy link
Member

marcverhagen commented May 31, 2017

There are many occasions where TTK writes to standard output. This is not a good idea when you use the --pipe option. Printing to stdout is okay when processing a directory, but printing to stdout in standard file or pipe processing should be eliminated.

Find all those occasions and replace them with calls to the logger or write to stderr.

@marcverhagen
Copy link
Member Author

marcverhagen commented Jun 6, 2017

This was fixed for a line in components/common_modules/tree.py (which contained the print statement that first alerted us to this problem).

marcverhagen added a commit that referenced this issue Jun 6, 2017
The print statement caused problems (see issue #74) and the documentation spelled out some Windows limitations when it comes to spaces in paths (issue #42).
@marcverhagen
Copy link
Member Author

Removed writing error report to stdout in commit 7cc7060.

@marcverhagen
Copy link
Member Author

Checked all print statements in the code and removed the dangerous ones or replaced them with calls to the logger. Print statements were allowed on some spots:

  • high level routines that are not executed when we run in --pipe mode
  • pretty print methods that are used for debugging
  • scripts that call tarsqi.py, like the evaluation scripts
  • all print statements that are conditional on a debugging variable

@marcverhagen
Copy link
Member Author

Fixed in a9662a1.

marcverhagen added a commit that referenced this issue Oct 17, 2018
Removed potentially dangerous uses of print statement (issue #74).
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