From 27ff594a2609c07205753ce24f74d8f45a7ea418 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sat, 1 Jun 2019 23:27:26 -0700 Subject: [PATCH] fix a bug w/ decoding datetime's when there is a space in the data as well... --- pasn1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pasn1.py b/pasn1.py index 69d1b86..2ece814 100644 --- a/pasn1.py +++ b/pasn1.py @@ -373,7 +373,7 @@ class ASN1Coder(object): raise ValueError('last character must be Z') # Real bug is in strptime, but work around it here. - if ' ' in data: + if ' ' in ts: raise ValueError('no spaces are allowed') if '.' in ts: @@ -601,6 +601,7 @@ class TestCode(unittest.TestCase): set(), set((1,2,3)), set((1,'sjlfdkj', None, float('inf'))), datetime.datetime.utcnow(), + [ datetime.datetime.utcnow(), ' ' ], datetime.datetime.utcnow().replace(microsecond=0), datetime.datetime.utcnow().replace(microsecond=1000), ]: