LDIFParser now also accepts value-spec without a space after the colon
This commit is contained in:
4
CHANGES
4
CHANGES
@@ -4,6 +4,8 @@ Released 2.4.22 2015-10-xx
|
|||||||
Changes since 2.4.21:
|
Changes since 2.4.21:
|
||||||
|
|
||||||
Lib/
|
Lib/
|
||||||
|
* LDIFParser now also accepts value-spec without a space
|
||||||
|
after the colon.
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
Released 2.4.21 2015-09-25
|
Released 2.4.21 2015-09-25
|
||||||
@@ -1202,4 +1204,4 @@ Released 2.0.0pre02 2002-02-01
|
|||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
Released 1.10alpha3 2000-09-19
|
Released 1.10alpha3 2000-09-19
|
||||||
|
|
||||||
$Id: CHANGES,v 1.357 2015/09/30 17:15:53 stroeder Exp $
|
$Id: CHANGES,v 1.358 2015/09/30 17:17:28 stroeder Exp $
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ldif - generate and parse LDIF data (see RFC 2849)
|
|||||||
|
|
||||||
See http://www.python-ldap.org/ for details.
|
See http://www.python-ldap.org/ for details.
|
||||||
|
|
||||||
$Id: ldif.py,v 1.84 2015/09/30 17:15:53 stroeder Exp $
|
$Id: ldif.py,v 1.85 2015/09/30 17:17:28 stroeder Exp $
|
||||||
|
|
||||||
Python compability note:
|
Python compability note:
|
||||||
Tested with Python 2.0+, but should work with Python 1.5.2+.
|
Tested with Python 2.0+, but should work with Python 1.5.2+.
|
||||||
@@ -324,7 +324,7 @@ class LDIFParser:
|
|||||||
# if needed attribute value is BASE64 decoded
|
# if needed attribute value is BASE64 decoded
|
||||||
value_spec = unfolded_line[colon_pos:colon_pos+2]
|
value_spec = unfolded_line[colon_pos:colon_pos+2]
|
||||||
if value_spec==': ':
|
if value_spec==': ':
|
||||||
attr_value = unfolded_line[colon_pos+2:]
|
attr_value = unfolded_line[colon_pos+2:].lstrip()
|
||||||
elif value_spec=='::':
|
elif value_spec=='::':
|
||||||
# attribute value needs base64-decoding
|
# attribute value needs base64-decoding
|
||||||
attr_value = base64.decodestring(unfolded_line[colon_pos+2:])
|
attr_value = base64.decodestring(unfolded_line[colon_pos+2:])
|
||||||
@@ -336,8 +336,8 @@ class LDIFParser:
|
|||||||
u = urlparse.urlparse(url)
|
u = urlparse.urlparse(url)
|
||||||
if self._process_url_schemes.has_key(u[0]):
|
if self._process_url_schemes.has_key(u[0]):
|
||||||
attr_value = urllib.urlopen(url).read()
|
attr_value = urllib.urlopen(url).read()
|
||||||
elif value_spec==':\r\n' or value_spec=='\n':
|
else:
|
||||||
attr_value = ''
|
attr_value = unfolded_line[colon_pos+1:]
|
||||||
return attr_type,attr_value
|
return attr_type,attr_value
|
||||||
|
|
||||||
def parse_entry_records(self):
|
def parse_entry_records(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user