diff --git a/.travis.yml b/.travis.yml
index 9dd3331..f46558a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,6 +7,7 @@ python:
     - 3.5
     - 3.6
     - 3.7
+    - 3.8-dev
     - pypy
     - pypy3
 
diff --git a/CHANGES.rst b/CHANGES.rst
index 030e368..731807f 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -5,7 +5,10 @@
 3.5.1 (unreleased)
 ==================
 
-- Nothing changed yet.
+- Added support for Python 3.8.  This primarily involves avoiding the
+  new-in-3.8 validation of the format string when using the
+  'safe-template' format style, since that's not supported in the Python
+  standard library.
 
 
 3.5.0 (2019-06-24)
diff --git a/ZConfig/components/logger/formatter.py b/ZConfig/components/logger/formatter.py
index 512f5da..009630d 100644
--- a/ZConfig/components/logger/formatter.py
+++ b/ZConfig/components/logger/formatter.py
@@ -248,8 +248,17 @@ class FormatterFactory(object):
             else:
                 # A formatter class that supports style, but our style is
                 # non-standard, so we reach under the covers a bit.
+                #
+                # Python 3.8 adds a validate option, defaulting to True,
+                # which causes the format string to be checked.  Since
+                # safe-template is not a standard style, we want to
+                # suppress this.
+                #
+                kwargs = dict()
+                if sys.version_info >= (3, 8):
+                    kwargs['validate'] = False
                 formatter = self.factory(self.format, self.dateformat,
-                                         style='$')
+                                         style='$', **kwargs)
                 assert formatter._style._fmt == self.format
                 formatter._style = stylist
         else:
diff --git a/setup.py b/setup.py
index f16aabe..2bb70ed 100644
--- a/setup.py
+++ b/setup.py
@@ -64,6 +64,7 @@ options = dict(
         'Programming Language :: Python :: 3.5',
         'Programming Language :: Python :: 3.6',
         'Programming Language :: Python :: 3.7',
+        'Programming Language :: Python :: 3.8',
         'Programming Language :: Python :: Implementation :: CPython',
         'Programming Language :: Python :: Implementation :: PyPy',
         'Operating System :: OS Independent',
diff --git a/tox.ini b/tox.ini
index 7a9860b..4c7f8cd 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py27,py34,py35,py36,py37,pypy,coverage-report
+envlist = py27,py34,py35,py36,py37,py38,pypy,coverage-report
 skip_missing_interpreters = true
 
 [testenv]

diff --git a/ZConfig/components/logger/tests/test_formatter.py b/ZConfig/components/logger/tests/test_formatter.py
index 81c7235..3a04a5f 100644
--- a/ZConfig/components/logger/tests/test_formatter.py
+++ b/ZConfig/components/logger/tests/test_formatter.py
@@ -25,6 +25,17 @@ import ZConfig.components.logger.formatter
 import ZConfig.components.logger.tests.support
 
 
+# In Python 3.8, a KeyError raised by string interpolation is re-written
+# into a ValueError reporting a reference to an undefined field.  We're
+# not masking the exception, but we want to check for the right one in
+# the tests below (without catching anything else).
+#
+if sys.version_info >= (3, 8):
+    MissingFieldError = ValueError
+else:
+    MissingFieldError = KeyError
+
+
 class LogFormatStyleTestCase(unittest.TestCase):
 
     def setUp(self):
@@ -314,7 +325,10 @@ class CustomFormatterFactoryWithoutStyleParamTestCase(
 class StylelessFormatter(logging.Formatter):
 
     def __init__(self, fmt=None, datefmt=None):
-        logging.Formatter.__init__(self, fmt=fmt, datefmt=datefmt)
+        kwargs = dict()
+        if sys.version_info >= (3, 8):
+            kwargs['validate'] = False
+        logging.Formatter.__init__(self, fmt=fmt, datefmt=datefmt, **kwargs)
 
 
 def styleless_formatter(fmt=None, datefmt=None):
@@ -552,9 +566,9 @@ class ArbitraryFieldsTestCase(StyledFormatterTestHelper, unittest.TestCase):
             arbitrary_fields=True)
 
         # The formatter still breaks when it references an undefined field:
-        with self.assertRaises(KeyError) as cm:
+        with self.assertRaises(MissingFieldError) as cm:
             formatter.format(self.record)
-        self.assertEqual(str(cm.exception), "'undefined_field'")
+        self.assertIn("'undefined_field'", str(cm.exception))
 
     def test_classic_arbitrary_field_present(self):
         formatter = self.get_formatter(
@@ -574,9 +588,9 @@ class ArbitraryFieldsTestCase(StyledFormatterTestHelper, unittest.TestCase):
             arbitrary_fields=True)
 
         # The formatter still breaks when it references an undefined field:
-        with self.assertRaises(KeyError) as cm:
+        with self.assertRaises(MissingFieldError) as cm:
             formatter.format(self.record)
-        self.assertEqual(str(cm.exception), "'undefined_field'")
+        self.assertIn("'undefined_field'", str(cm.exception))
 
     def test_format_arbitrary_field_present(self):
         formatter = self.get_formatter(
@@ -596,9 +610,9 @@ class ArbitraryFieldsTestCase(StyledFormatterTestHelper, unittest.TestCase):
             arbitrary_fields=True)
 
         # The formatter still breaks when it references an undefined field:
-        with self.assertRaises(KeyError) as cm:
+        with self.assertRaises(MissingFieldError) as cm:
             formatter.format(self.record)
-        self.assertEqual(str(cm.exception), "'undefined_field'")
+        self.assertIn("'undefined_field'", str(cm.exception))
 
     def test_template_arbitrary_field_present(self):
         formatter = self.get_formatter(

tests break with Python 3.8
Introduction of formatting string validation in ``logging.Formatter`` breaks several of our formatting control tests.
ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_safe_template_with_junk ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_safe_template_with_junk
ZConfig/components/logger/tests/test_formatter.py::LogFormatStyleTestCase::test_bad_values ZConfig/components/logger/tests/test_formatter.py::LogFormatStyleTestCase::test_classic ZConfig/components/logger/tests/test_formatter.py::LogFormatStyleTestCase::test_format ZConfig/components/logger/tests/test_formatter.py::LogFormatStyleTestCase::test_safe_template ZConfig/components/logger/tests/test_formatter.py::LogFormatStyleTestCase::test_template ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_classic_explicit ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_classic_implicit ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_format ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_format_with_anonymous_placeholders ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_format_with_positional_placeholders ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_safe_template_with_braces ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_safe_template_without_braces ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_template_with_braces ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_template_with_junk ZConfig/components/logger/tests/test_formatter.py::LoggerStyledFormatterTestCase::test_template_without_braces ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_classic_explicit ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_classic_implicit ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_format ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_format_with_anonymous_placeholders ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_format_with_positional_placeholders ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_format_with_traceback_info ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_safe_template_with_braces ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_safe_template_without_braces ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_template_with_braces ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_template_with_junk ZConfig/components/logger/tests/test_formatter.py::ZopeExceptionsFormatterTestCase::test_template_without_braces ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_classic_explicit ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_classic_implicit ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_format ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_format_with_anonymous_placeholders ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_format_with_positional_placeholders ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_safe_template_with_braces ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_safe_template_with_junk ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_safe_template_without_braces ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_template_with_braces ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_template_with_junk ZConfig/components/logger/tests/test_formatter.py::CustomFormatterClassWithoutStyleParamTestCase::test_template_without_braces ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_classic_explicit ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_classic_implicit ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_format ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_format_with_anonymous_placeholders ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_format_with_positional_placeholders ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_safe_template_with_braces ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_safe_template_with_junk ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_safe_template_without_braces ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_template_with_braces ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_template_with_junk ZConfig/components/logger/tests/test_formatter.py::CustomFormatterFactoryWithoutStyleParamTestCase::test_template_without_braces ZConfig/components/logger/tests/test_formatter.py::FieldTypesTestCase::test_func_name_classic ZConfig/components/logger/tests/test_formatter.py::FieldTypesTestCase::test_func_name_format ZConfig/components/logger/tests/test_formatter.py::FieldTypesTestCase::test_func_name_template ZConfig/components/logger/tests/test_formatter.py::FieldTypesTestCase::test_levelno_integer_classic ZConfig/components/logger/tests/test_formatter.py::FieldTypesTestCase::test_levelno_integer_format ZConfig/components/logger/tests/test_formatter.py::FieldTypesTestCase::test_msecs_float_classic ZConfig/components/logger/tests/test_formatter.py::FieldTypesTestCase::test_msecs_float_format ZConfig/components/logger/tests/test_formatter.py::FieldTypesTestCase::test_relative_created_float_classic ZConfig/components/logger/tests/test_formatter.py::FieldTypesTestCase::test_relative_created_float_format ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_classic_arbitrary_field_disallowed_by_default ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_classic_arbitrary_field_missing ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_classic_arbitrary_field_present ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_format_arbitrary_field_disallowed_by_default ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_format_arbitrary_field_missing ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_format_arbitrary_field_present ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_safe_template_arbitrary_field_missing ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_safe_template_arbitrary_field_present ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_template_arbitrary_field_disallowed_by_default ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_template_arbitrary_field_missing ZConfig/components/logger/tests/test_formatter.py::ArbitraryFieldsTestCase::test_template_arbitrary_field_present