Bug 1074461
| Summary: | error messages in stdout when using rpm as a library | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Ales Kozumplik <akozumpl> |
| Component: | rpm | Assignee: | Packaging Maintenance Team <packaging-team-maint> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 20 | CC: | jzeleny, novyjindrich, packaging-team-maint, pknirsch, pmatilai |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-03-25 10:34:06 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
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. |
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.