Skip to content

Commit 33f084f

Browse files
committed
remove null bytes
1 parent 2c96a82 commit 33f084f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

parsel/selector.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ def __init__(self, text=None, type=None, namespaces=None, root=None,
188188
self._tostring_method = _ctgroup[st]['_tostring_method']
189189

190190
if text is not None:
191+
text = text.replace('\x00', '')
191192
if not isinstance(text, six.text_type):
192193
raise TypeError("text argument should be of type %s" % six.text_type)
193194
root = self._get_root(text, base_url)

0 commit comments

Comments
 (0)