Code

test that announcement.txt is pure ASCII, required at least up to
[roundup.git] / setup.py
index 0d94693caff75ace4e1f8cd708fd178590864cb6..3426b80d1671d0098c609a58e5c4fb5091e3741a 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -94,6 +94,14 @@ def main():
     # perform the setup action
     from roundup import __version__
 
+    long_description=open('doc/announcement.txt').read().decode('utf8')
+    try:
+        long_description.encode('ascii')
+    except UnicodeEncodeError, cause:
+        print >> sys.stderr, "doc/announcement.txt contains non-ascii: %s" \
+            % cause
+        sys.exit(42)
+
     setup(name='roundup',
           version=__version__,
           author="Richard Jones",
@@ -101,7 +109,7 @@ def main():
           description="A simple-to-use and -install issue-tracking system"
             " with command-line, web and e-mail interfaces. Highly"
             " customisable.",
-          long_description=open('doc/announcement.txt').read().decode('utf8'),
+          long_description=long_description,
           url='http://www.roundup-tracker.org',
           download_url='http://pypi.python.org/pypi/roundup',
           classifiers=['Development Status :: 5 - Production/Stable',