Addition to code: I have simply added a second argument to all print calls that intend to print an error, that second argument being the file descriptor of the stderr buffer. There are several reasons why: the most obvious being best practice, and no buffering.
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
Proposed Changes
Change all print('Error: ...') error messages to print('Error: ...', file=sys.stderr) instead.
Why is this change needed?
This change is needed to maintain the overall code quality of this project. Printing error messages to `sys.stderr` is a practice that should be adhered to by all code. See [this](https://stackoverflow.com/questions/3385201/confused-about-stdin-stdout-and-stderr) for more information about what `sys.stderr` (or just `stderr`) is.
### Checklist:
- [x] My code follows the style guidelines of this project and I have read [CONTRIBUTING.md](/CONTRIBUTING.md)
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have checked my code and corrected any misspellings
Redirects errors to
stderr
Related Issue/Addition to code
print
calls that intend to print an error, that second argument being the file descriptor of thestderr
buffer. There are several reasons why: the most obvious being best practice, and no buffering.Type of change
Proposed Changes
print('Error: ...')
error messages toprint('Error: ...', file=sys.stderr)
instead.Why is this change needed?
This change is needed to maintain the overall code quality of this project. Printing error messages to `sys.stderr` is a practice that should be adhered to by all code. See [this](https://stackoverflow.com/questions/3385201/confused-about-stdin-stdout-and-stderr) for more information about what `sys.stderr` (or just `stderr`) is. ### Checklist: - [x] My code follows the style guidelines of this project and I have read [CONTRIBUTING.md](/CONTRIBUTING.md) - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have checked my code and corrected any misspellings