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

Warnings are written to stdout instead of stderr #33

Open
SECtim opened this issue Jan 2, 2024 · 1 comment · May be fixed by #34
Open

Warnings are written to stdout instead of stderr #33

SECtim opened this issue Jan 2, 2024 · 1 comment · May be fixed by #34

Comments

@SECtim
Copy link

SECtim commented Jan 2, 2024

The README says

Errors and warnings are only printed on the console (into the standard error output stream)

However, this is not the case. For example,

def _print_no_explicit_version_warnings(self):
if self._id_drafts_without_version_list:
print_yellow('WARNING', file=sys.stderr)

seems to print to stderr, but doesn't:
def print_yellow(text, end='\n', file=sys.stdout):
print(f'\u001b[33m\u001b[33m{text}\u001b[0m', end=end)

This is annoying when adding bib entries to a bib file, e.g. rfcbibtex draft-ietf-httpbis-rfc6265bis >> specs.bib, because the warning ends up in the bib file.

SECtim added a commit to SECtim/rfc-bibtex that referenced this issue Jan 2, 2024
The utils.print_x functions take a `file` argument that was not used in their implementation.
This lead to errors and warnings being printed to stdout instead of stderr.

Fixes iluxonchik#33
@SECtim SECtim linked a pull request Jan 2, 2024 that will close this issue
@iluxonchik
Copy link
Owner

Hello,

Thank you for your creating the issue and submitting a merge request. I will review it soon. From a quick check, your observation and code change seems valid. I'll just make sure that that doesn't break anything, and then work it into a release.

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

Successfully merging a pull request may close this issue.

2 participants