<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - python-systemd: Incompatibility with Python 3.x UUID class"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=77086">77086</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>python-systemd: Incompatibility with Python 3.x UUID class
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>gandro@gmx.net
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Using the UUID class in the systemd.journal module in Python 3.x causes an
AttributeError. The problem seems to be that the python-systemd wrapper is
using
the undocumented UUID.get_hex() method. This undocumented, private method is
present in Python 2.7, but not in Python 3.x.

The documented way to retrieve the hex string is the UUID.hex attribute:
See: <a href="https://docs.python.org/3/library/uuid.html#uuid.UUID.hex">https://docs.python.org/3/library/uuid.html#uuid.UUID.hex</a>

systemd version: 212

Relevant python tracebacks:

    $ python3
    Python 3.4.0 (default, Mar 17 2014, 23:20:09)
    [GCC 4.8.2 20140206 (prerelease)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from systemd import journal
    >>> from uuid import UUID
    >>>
    >>> journal.get_catalog(UUID('0123456789ABCDEF0123456789ABCDEF'))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.4/site-packages/systemd/journal.py", line 349, in
get_catalog
        mid = mid.get_hex()
    AttributeError: 'UUID' object has no attribute 'get_hex'
    >>>
    >>> j=journal.Reader()
    >>> j.messageid_match(UUID('0123456789ABCDEF0123456789ABCDEF'))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.3/site-packages/systemd/journal.py", line 317, in
messageid_match
        messageid = messageid.get_hex()
    AttributeError: 'UUID' object has no attribute 'get_hex'
    >>>
    >>> j=journal.Reader()
    >>> j.seek_monotonic(0, UUID('0123456789ABCDEF0123456789ABCDEF'))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.3/site-packages/systemd/journal.py", line 296, in
seek_monotonic
        bootid = bootid.get_hex()
    AttributeError: 'UUID' object has no attribute 'get_hex'</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>