[Rpm-maint] [rpm-software-management/rpm] Throw OSEror Argument Error if method is not valid (PR #4128)

El Malvado notifications at github.com
Mon Mar 2 15:26:29 UTC 2026


Fdopen() did not validate the IO engine specified in the mode string. Unknown engine names (e.g. "aaaiiiooo") or malformed mode suffixes (e.g. "r9xyz") would silently fall through to plain IO instead of reporting an error

Now:

```python
import rpm
f = rpm.fd('/etc/passwd', 'r', 'aaaiiiooo')
print(f.name)
f.close()


Traceback (most recent call last):
  File "<python-input-1>", line 2, in <module>
    f = rpm.fd('/etc/passwd', 'r', 'fsssso')
OSError: Invalid argument
```

Fixes #3058
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/4128

-- Commit Summary --

  * Throw OSEror Argument Error if method is not valid

-- File Changes --

    M rpmio/rpmio.cc (22)
    M tests/rpmpython.at (20)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/4128.patch
https://github.com/rpm-software-management/rpm/pull/4128.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4128
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4128 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260302/1f93460e/attachment.htm>


More information about the Rpm-maint mailing list