summaryrefslogtreecommitdiff
path: root/dateutil/parser/_parser.py
diff options
context:
space:
mode:
authorPaul Ganssle <paul@ganssle.io>2018-01-03 11:53:42 -0500
committerPaul Ganssle <paul@ganssle.io>2018-01-03 11:53:42 -0500
commit1cedde5b25ec257ad11a562f01a0f1915c975bfc (patch)
tree9601532158d04fdce9bd2b8fbcb895bbd18baf9e /dateutil/parser/_parser.py
parentea06a738df2acff1714d47beb9ca2a13fe6be101 (diff)
downloaddateutil-git-1cedde5b25ec257ad11a562f01a0f1915c975bfc.tar.gz
Deprecate dateutil-specific tz format
Diffstat (limited to 'dateutil/parser/_parser.py')
-rw-r--r--dateutil/parser/_parser.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/dateutil/parser/_parser.py b/dateutil/parser/_parser.py
index f5b5e9d..04770ce 100644
--- a/dateutil/parser/_parser.py
+++ b/dateutil/parser/_parser.py
@@ -44,7 +44,7 @@ from six import binary_type, integer_types, text_type
from decimal import Decimal
-import re
+from warnings import warn
from .. import relativedelta
from .. import tz
@@ -1419,6 +1419,14 @@ class _tzparser(object):
signal = 1
used_idxs.append(i)
res.dstoffset = (res.stdoffset + int(l[i]) * signal)
+
+ # This was a made-up format that is not in normal use
+ warn(('Parsed time zone "%s"' % tzstr) +
+ 'is in a non-standard dateutil-specific format, which ' +
+ 'is now deprecated; support for parsing this format ' +
+ 'will be removed in future versions. It is recommended ' +
+ 'that you switch to a standard format like the GNU ' +
+ 'TZ variable format.', tz.DeprecatedTzFormatWarning)
elif (l.count(',') == 2 and l[i:].count('/') <= 2 and
not [y for x in l[i:] if x not in (',', '/', 'J', 'M',
'.', '-', ':')