There's the following script: #! /usr/bin/python import rpm if __name__ == '__main__': spec = rpm.spec(__file__) That outputs: error: line 3: Unknown tag: import rpm In the stdout. If one creates an empty dir and points the rpm.spec call to it there's even more: error: Name field must be present in package: (main package) error: Version field must be present in package: (main package) error: Release field must be present in package: (main package) error: Summary field must be present in package: (main package) error: License field must be present in package: (main package) If the lib outputs these into stdout, the output of client programs like DNF can look overly dramatic and confusing.
Related DNF bug 1074461.
(In reply to Ales Kozumplik from comment #1) > Related DNF bug 1074461. Should be bug 1074436.
rpm libraries output to rpmlog() which defaults to stderr (not stdout), but which you can redirect to another file, including of course /dev/null: sink = open("/dev/null", "w") rpm.setLogFile(sink)
Thanks Panu, updated our code.
NOTABUG as per comment #3, the output is not to stdout/stderr but to a client controllable log.