1
I want to acquire version information for bugs.kde.org/show_bug.cgi?id=475304#c4. In order to work around discuss.python.org/t/108891, I attempted to paste:
#!/usr/bin/env python3
import rpm, yaml
from datetime import datetime, timezone
from shutil import which
package = which("dolphin")
header = next(
rpm.TransactionSet().dbMatch(
"basenames",
package
)
)
tags = (
"NAME",
"VERSION",
"RELEASE",
"ARCH",
"INSTALLTIME",
"SIZE",
"SIGPGP",
"SOURCERPM",
"BUILDTIME",
"BUILDHOST",
"PACKAGER",
"VENDOR",
)
properties = {}
for name in tags:
value = header[
getattr(
rpm,
f"RPMTAG_{name}"
)
]
if name in (
"INSTALLTIME",
"BUILDTIME"
):
value = (
datetime.fromtimestamp(
value,
timezone.utc
)
.isoformat(timespec="seconds")
.replace(
"+00:00",
"Z"
)
)
properties[name] = value
print(
yaml.safe_dump(
properties,
sort_keys=False,
default_flow_style=False,
)
)
…into:
NAME: python3-bpython
VERSION: '0.26'
RELEASE: 3.fc44
ARCH: noarch
INSTALLTIME: '2026-06-07T18:08:17Z'
SIZE: 1815569
SIGPGP: null
SOURCERPM: bpython-0.26-3.fc44.src.rpm
BUILDTIME: '2026-01-16T08:37:17Z'
BUILDHOST: buildvm-a64-24.rdu3.fedoraproject.org
PACKAGER: Fedora Project
VENDOR: Fedora Project
However, when I do, I observe:
PS /> bpython
bpython version 0.26 on top of Python 3.14.7 /usr/bin/python3
>>> #!/usr/bin/env python3
>>> import rpm, yaml
>>> from datetime import datetime, timezone
>>> from shutil import which
>>> package = which("dolphin")
>>> header = next(
... rpm.TransactionSet().dbMatch(
... "basenames",
... package
... )
... )
>>> tags = (
... "NAME",
... "VERSION",
... "RELEASE",
... "ARCH",
... "INSTALLTIME",
... "SIZE",
... "SIGPGP",
... "SOURCERPM",
... "BUILDTIME",
... "BUILDHOST",
... "PACKAGER",
... "VENDOR",
... )
>>> properties = {}
>>> for name in tags:
... value = header[
File "<bpython-input-30>", line 2
value = header[
^^^^^
IndentationError: expected an indented block after 'for' statement on line 1
>>> getattr(
... rpm,
... f"RPMTAG_{name}"
... )
Traceback (most recent call last):
File "<input>", line 3, in <module>
NameError: name 'name' is not defined
>>> ]
File "<input>", line 1
]
^
SyntaxError: unmatched ']'
>>> if name in (
... "INSTALLTIME",
... "BUILDTIME"
... ):
... value = (
File "<bpython-input-40>", line 5
value = (
^^^^^
IndentationError: expected an indented block after 'if' statement on line 1
>>> datetime.fromtimestamp(
... value,
... timezone.utc
... )
Traceback (most recent call last):
File "<input>", line 2, in <module>
NameError: name 'value' is not defined
>>> .isoformat(timespec="seconds")
File "<input>", line 1
.isoformat(timespec="seconds")
^
SyntaxError: invalid syntax
>>> .replace(
File "<input>", line 1
.replace(
^
SyntaxError: invalid syntax
>>> "+00:00",
('+00:00',)
>>> "Z"
'Z'
>>> )
File "<input>", line 1
)
^
SyntaxError: unmatched ')'
>>> )
File "<input>", line 1
)
^
SyntaxError: unmatched ')'
>>> properties[name] = value
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'value' is not defined
>>> print(
... yaml.safe_dump(
... properties,
... sort_keys=False,
... default_flow_style=False,
... )
... )
{}
>>>
My Environment
-
NAME: powershell
VERSION: 7.6.3
RELEASE: 1.fc44
ARCH: x86_64
INSTALLTIME: '2026-07-10T14:27:59Z'
SIZE: 80457338
SIGPGP: !!binary |
wqsEABYIAF0FgmozBp4JEADNq0PeIm1vNRQAAAAAABwAEHNhbHRAbm90YXRpb25zLm9wZW5wZ3Bq
cy5vcmeWi4zlrtA1yO8xb4OMUSU5FiEErgkVek3oi0l+odXTAM2rQ94ibW8AAKjWAQDWopeT8mCr
wyzNusrdfDlx5zGLi46YyGOQjMCm9TPg1wD/VIKQxf34I+pI8njFm6haTosAu2sJ7zAJ19vIBh+T
Uw4=
SOURCERPM: powershell-7.6.3-1.fc44.src.rpm
BUILDTIME: '2026-06-17T20:27:32Z'
BUILDHOST: bb40358eb1d9
PACKAGER: Gilver E. <[email protected]>
VENDOR: Terra
-
NAME: konsole
VERSION: 26.08.0
RELEASE: 1.fc44
ARCH: x86_64
INSTALLTIME: '2026-08-23T11:58:33Z'
SIZE: 7098104
SIGPGP: null
SOURCERPM: konsole-26.08.0-1.fc44.src.rpm
BUILDTIME: '2026-08-15T20:13:58Z'
BUILDHOST: buildvm-x86-13.rdu3.fedoraproject.org
PACKAGER: Fedora Project
VENDOR: Fedora Project
1
I want to acquire version information for
bugs.kde.org/show_bug.cgi?id=475304#c4. In order to work arounddiscuss.python.org/t/108891, I attempted to paste:…into:
However, when I do, I observe:
My Environment
Footnotes
chatgpt.com/s/p_6aa58aef674c8191b00358e3cca801ef2 ↩chatgpt.com/share/6aa58ab2-8448-83eb-9256-dc7dab6a34683 ↩chatgpt.com/c/6a9c5957-ad88-83eb-be41-fcdaa2588944↩