Skip to content

Commit

Permalink
Doc: Use bytes for attribute values in example
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Viktorin authored and GitHub committed May 6, 2020
1 parent 7196171 commit 9005ba9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Doc/reference/ldif.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ Example
The following example demonstrates how to write LDIF output
of an LDAP entry with :mod:`ldif` module.

>>> import sys,ldif
>>> entry={'objectClass':['top','person'],'cn':['Michael Stroeder'],'sn':['Stroeder']}
>>> import sys, ldif
>>> entry={'objectClass': [b'top', b'person'], 'cn': [b'Michael Stroeder'], 'sn': [b'Stroeder']}
>>> dn='cn=Michael Stroeder,ou=Test'
>>> ldif_writer=ldif.LDIFWriter(sys.stdout)
>>> ldif_writer.unparse(dn,entry)
>>> ldif_writer.unparse(dn, entry)
dn: cn=Michael Stroeder,ou=Test
cn: Michael Stroeder
objectClass: top
Expand Down

0 comments on commit 9005ba9

Please sign in to comment.