summaryrefslogtreecommitdiff
path: root/dateutil/parser
diff options
context:
space:
mode:
authorBrock Mendel <jbrockmendel@gmail.com>2017-12-05 08:37:08 -0800
committerPaul Ganssle <paul@ganssle.io>2018-03-11 18:15:59 -0400
commit1dfa77a2e87dcfd1cf277c69c27dea0ec8530f77 (patch)
tree5895a988aebb7ae3f4e0e0843d76bc25fde7c27a /dateutil/parser
parent1a7ebd70371a95ae61f95cdcde6d6cbb5dd7f68c (diff)
downloaddateutil-git-1dfa77a2e87dcfd1cf277c69c27dea0ec8530f77.tar.gz
raise on unidentified tz
Diffstat (limited to 'dateutil/parser')
-rw-r--r--dateutil/parser/_parser.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/dateutil/parser/_parser.py b/dateutil/parser/_parser.py
index 1391437..a5ec2fb 100644
--- a/dateutil/parser/_parser.py
+++ b/dateutil/parser/_parser.py
@@ -613,6 +613,14 @@ class parser(object):
if not ignoretz:
ret = self._build_tzaware(ret, res, tzinfos)
+ elif not res.tzname and not res.tzoffset:
+ # i.e. no timezone information was found.
+ pass
+ else:
+ # tz-like string was parsed but we don't know what to do
+ # with it
+ raise ValueError(res.tzname)
+
if kwargs.get('fuzzy_with_tokens', False):
return ret, skipped_tokens
else: