Bug 995575 - systemd journal python reader broken in 206
systemd journal python reader broken in 206
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
20
All Linux
unspecified Severity high
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-09 14:38 EDT by Orion Poplawski
Modified: 2014-01-14 17:16 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-14 17:16:30 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Orion Poplawski 2013-08-09 14:38:32 EDT
Description of problem:

# python
Python 2.7.5 (default, Aug  4 2013, 08:19:47)
[GCC 4.8.1 20130717 (Red Hat 4.8.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from systemd import journal
>>> j = journal.Reader(converters={'__CURSOR': lambda x: x})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/systemd/journal.py", line 153, in __init__
    super(Reader, self).__init__(flags, path, files)
TypeError: argument 3 must be (unspecified), not None

Version-Release number of selected component (if applicable):
systemd-python-206-2.fc20.x86_64


Expected results:

systemd-python-204-9.fc19.x86_64
# python
Python 2.7.5 (default, Jul  8 2013, 09:48:59)
[GCC 4.8.1 20130603 (Red Hat 4.8.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from systemd import journal
>>> j = journal.Reader(converters={'__CURSOR': lambda x: x})
>>>
Comment 1 Orion Poplawski 2013-08-09 14:42:07 EDT
Or even:

>>> from systemd import journal
>>> j = journal.Reader()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/systemd/journal.py", line 153, in __init__
    super(Reader, self).__init__(flags, path, files)
TypeError: argument 3 must be (unspecified), not None
Comment 2 Steven Hiscocks 2013-08-11 06:35:59 EDT
Patch along the lines of below resolves this; by making `None` an acceptable value.

---

diff --git a/src/python-systemd/_reader.c b/src/python-systemd/_reader.c
index a678f69..604630d 100644
--- a/src/python-systemd/_reader.c
+++ b/src/python-systemd/_reader.c
@@ -73,6 +73,11 @@ static int strv_converter(PyObject* obj, void *_result) {
         if (!obj)
             goto cleanup;
 
+        if (obj == Py_None) {
+            *result = NULL;
+            return 1;
+        }
+
         if (!PySequence_Check(obj))
             return 0;
Comment 3 Orion Poplawski 2013-08-15 15:44:23 EDT
This is also fixed in 206-3.fc20, though not noted in the changelog.
Comment 4 Fedora Update System 2013-09-14 22:11:50 EDT
systemd-204-13.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/systemd-204-13.fc19
Comment 5 Fedora End Of Life 2013-09-16 13:05:37 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Note You need to log in before you can comment on or make changes to this bug.