From 5130f8a7fff2852b076b27fd53bf53dcef5a034e Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 25 Aug 2016 15:06:01 +0100 Subject: [PATCH] Check for end of datum more specifically This prevents an empty list being treated as the end of a datum. For example decoding `["foo", []]`, would give `["foo"]` and leave an 'e' on the end of input `s`. --- nrepl/bencode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nrepl/bencode.py b/nrepl/bencode.py index b933b6f..5e02641 100644 --- a/nrepl/bencode.py +++ b/nrepl/bencode.py @@ -74,7 +74,7 @@ def _read_list(s): data = [] while True: datum = _read_datum(s) - if not datum: + if datum is None: break data.append(datum) return data