Bug 995575 - systemd journal python reader broken in 206
Summary: systemd journal python reader broken in 206
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 20
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-09 18:38 UTC by Orion Poplawski
Modified: 2014-01-14 22:16 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-14 22:16:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Orion Poplawski 2013-08-09 18:38:32 UTC
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 18:42:07 UTC
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 10:35:59 UTC
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 19:44:23 UTC
This is also fixed in 206-3.fc20, though not noted in the changelog.

Comment 4 Fedora Update System 2013-09-15 02:11:50 UTC
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 17:05:37 UTC
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.