diff options
Diffstat (limited to 'docutils')
| -rw-r--r-- | docutils/HISTORY.txt | 2 | ||||
| -rw-r--r-- | docutils/README.txt | 2 | ||||
| -rw-r--r-- | docutils/docs/dev/distributing.txt | 2 | ||||
| -rw-r--r-- | docutils/docutils/frontend.py | 2 | ||||
| -rw-r--r-- | docutils/docutils/utils/code_analyzer.py | 2 | ||||
| -rw-r--r-- | docutils/docutils/writers/odf_odt/__init__.py | 5 | ||||
| -rwxr-xr-x | docutils/setup.py | 2 | ||||
| -rw-r--r-- | docutils/test/test_error_reporting.py | 13 | ||||
| -rwxr-xr-x | docutils/test/test_parsers/test_rst/test_directives/test_tables.py | 14 | ||||
| -rwxr-xr-x | docutils/test/test_utils.py | 9 | ||||
| -rwxr-xr-x | docutils/test/test_writers/test_odt.py | 1 | ||||
| -rwxr-xr-x | docutils/tools/buildhtml.py | 2 | ||||
| -rw-r--r-- | docutils/tox.ini | 2 |
13 files changed, 27 insertions, 31 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt index 40a5c6642..defbfbb1d 100644 --- a/docutils/HISTORY.txt +++ b/docutils/HISTORY.txt @@ -20,7 +20,7 @@ Changes Since 0.15 * General - - Dropped support for Python 2.6 (work in progress). + - Dropped support for Python 2.6, Python 3.3 (work in progress). - Keep `backslash escapes`__ in the document tree. Backslash characters in text are be represented by NULL characters in the ``text`` attribute of Doctree nodes and removed in the writing stage by the node's diff --git a/docutils/README.txt b/docutils/README.txt index 747a04a52..2816531a5 100644 --- a/docutils/README.txt +++ b/docutils/README.txt @@ -16,7 +16,7 @@ Quick-Start This is for those who want to get up & running quickly. -1. Docutils requires Python (version 2.6 or later), available from +1. Docutils requires Python (version 2.7 or later), available from http://www.python.org/ diff --git a/docutils/docs/dev/distributing.txt b/docutils/docs/dev/distributing.txt index 3aeb6af24..e4d4fa349 100644 --- a/docutils/docs/dev/distributing.txt +++ b/docutils/docs/dev/distributing.txt @@ -28,7 +28,7 @@ Dependencies Docutils has the following dependencies: -* Python 2.6 or later is required. Use ">= Python 2.6" in the +* Python 2.7 or later is required. Use ">= Python 2.7" in the dependencies. * Docutils may optionally make use of the PIL (`Python Imaging diff --git a/docutils/docutils/frontend.py b/docutils/docutils/frontend.py index f5f7046cb..a297b9c91 100644 --- a/docutils/docutils/frontend.py +++ b/docutils/docutils/frontend.py @@ -777,7 +777,7 @@ Skipping "%s" configuration file. except IOError: continue try: - if sys.version_info < (3,2): + if sys.version_info < (3, 0): CP.RawConfigParser.readfp(self, fp, filename) else: CP.RawConfigParser.read_file(self, fp, filename) diff --git a/docutils/docutils/utils/code_analyzer.py b/docutils/docutils/utils/code_analyzer.py index eedf621b0..218d8dbf6 100644 --- a/docutils/docutils/utils/code_analyzer.py +++ b/docutils/docutils/utils/code_analyzer.py @@ -18,7 +18,7 @@ try: from pygments.lexers import get_lexer_by_name from pygments.formatters.html import _get_ttype_class with_pygments = True -except (ImportError, SyntaxError): # pygments 2.0.1 fails with Py 3.1 and 3.2 +except ImportError: with_pygments = False # Filter the following token types from the list of class arguments: diff --git a/docutils/docutils/writers/odf_odt/__init__.py b/docutils/docutils/writers/odf_odt/__init__.py index 6ecd610c7..9bc0fba8d 100644 --- a/docutils/docutils/writers/odf_odt/__init__.py +++ b/docutils/docutils/writers/odf_odt/__init__.py @@ -22,10 +22,12 @@ import re import copy import itertools import weakref + try: import locale # module missing in Jython except ImportError: pass + import docutils from docutils import frontend, nodes, utils, writers, languages from docutils.readers import standalone @@ -91,6 +93,7 @@ if isinstance(etree.Element, type): else: _ElementInterface = etree._ElementInterface + class _ElementInterfaceWrapper(_ElementInterface): def __init__(self, tag, attrib=None): _ElementInterface.__init__(self, tag, attrib) @@ -302,7 +305,7 @@ def add_ns(tag, nsdict=CNSD): def ToString(et): outstream = StringIO() - if sys.version_info >= (3, 2): + if sys.version_info >= (3, 0): et.write(outstream, encoding="unicode") else: et.write(outstream) diff --git a/docutils/setup.py b/docutils/setup.py index ff7e4a9e6..469b39722 100755 --- a/docutils/setup.py +++ b/docutils/setup.py @@ -123,7 +123,7 @@ what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60 'maintainer_email': 'docutils-develop@lists.sourceforge.net', 'license': 'public domain, Python, 2-Clause BSD, GPL 3 (see COPYING.txt)', 'platforms': 'OS-independent', - 'python_requires': '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*', + 'python_requires': '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', 'package_dir': {'docutils': 'docutils', 'docutils.tools': 'tools'}, 'packages': ['docutils', diff --git a/docutils/test/test_error_reporting.py b/docutils/test/test_error_reporting.py index 845927ca7..d62e6dbad 100644 --- a/docutils/test/test_error_reporting.py +++ b/docutils/test/test_error_reporting.py @@ -27,7 +27,6 @@ unless the minimal required Python version has this problem fixed. import unittest import sys, os -import codecs from io import StringIO, BytesIO import DocutilsTestSupport # must be imported before docutils @@ -35,15 +34,13 @@ from docutils import core, parsers, frontend, utils from docutils.utils.error_reporting import SafeString, ErrorString, ErrorOutput oldlocale = None -if sys.version_info < (3,0): # problems solved in py3k +if sys.version_info < (3, 0): # problems solved in py3k try: - import locale # module missing in Jython + import locale # module missing in Jython oldlocale = locale.getlocale() - # Why does getlocale return the defaultlocale in Python 3.2 ???? - # oldlocale = (None, None) # test suite runs without locale except ImportError: print ('cannot test error reporting with problematic locales,\n' - '`import locale` failed.') + '`import locale` failed.') # locales confirmed to use non-ASCII chars in the IOError message @@ -81,8 +78,6 @@ class SafeStringTests(unittest.TestCase): us = u'\xfc' # bytes(us) fails; str(us) fails in Python 2 be = Exception(bs) # unicode(be) fails ue = Exception(us) # bytes(ue) fails, str(ue) fails in Python 2; - # unicode(ue) fails in Python < 2.6 (issue2517_) - # .. _issue2517: http://bugs.python.org/issue2517 # wrapped test data: wbs = SafeString(bs) wus = SafeString(us) @@ -114,7 +109,7 @@ class SafeStringTests(unittest.TestCase): self.assertEqual(unicode(self.us), unicode(self.wus)) # unicode(self.be) fails self.assertEqual(unicode, type(unicode(self.wbe))) - # unicode(ue) fails in Python < 2.6 (issue2517_) + self.assertEqual(unicode, type(unicode(self.ue))) self.assertEqual(unicode, type(unicode(self.wue))) self.assertEqual(self.us, unicode(self.wue)) diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_tables.py b/docutils/test/test_parsers/test_rst/test_directives/test_tables.py index ed11b3ab2..a6a02f5fb 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_tables.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_tables.py @@ -10,7 +10,8 @@ Tests for tables.py directives. from __init__ import DocutilsTestSupport -import os, sys +import os +import sys import csv import platform from docutils.parsers.rst.directives import tables @@ -33,21 +34,20 @@ if isinstance(unichr_exception, OverflowError): else: unichr_exception_string = str(unichr_exception) -# some error messages changed in Python 3.3: -# CPython has backported to 2.7.4, PyPy has not -# platform.python_implementation is new in 2.6 +# some error messages changed in Python 3.3, CPython has backported to 2.7.4, +# PyPy has not csv_eod_error_str = 'unexpected end of data' if sys.version_info < (2,7,4) or platform.python_implementation() == 'PyPy': csv_eod_error_str = 'newline inside string' # pypy adds a line number -if sys.version_info > (2, 6) and platform.python_implementation() == 'PyPy': +if sys.version_info > (2, 7) and platform.python_implementation() == 'PyPy': csv_eod_error_str = 'line 1: ' + csv_eod_error_str csv_unknown_url = "'bogus.csv'" -if sys.version_info < (3,3,2): +if sys.version_info < (3, 0): csv_unknown_url = "bogus.csv" + def null_bytes(): - import csv with open(utf_16_csv, 'rb') as f: csv_data = f.read() csv_data = unicode(csv_data, 'latin1').splitlines() diff --git a/docutils/test/test_utils.py b/docutils/test/test_utils.py index 07b62e11a..1be74aad5 100755 --- a/docutils/test/test_utils.py +++ b/docutils/test/test_utils.py @@ -9,14 +9,11 @@ Test module for utils/__init__.py. """ -import unittest -import sys +from io import StringIO import os +import unittest + from DocutilsTestSupport import docutils, utils, nodes -try: - from io import StringIO -except ImportError: # io is new in Python 2.6 - from StringIO import StringIO class ReporterTests(unittest.TestCase): diff --git a/docutils/test/test_writers/test_odt.py b/docutils/test/test_writers/test_odt.py index 4dcb784ec..74788eeb7 100755 --- a/docutils/test/test_writers/test_odt.py +++ b/docutils/test/test_writers/test_odt.py @@ -46,6 +46,7 @@ TEMP_FILE_PATH = 'functional/output/' INPUT_PATH = 'functional/input/' EXPECTED_PATH = 'functional/expected/' + class DocutilsOdtTestCase(DocutilsTestSupport.StandardTestCase): def process_test(self, input_filename, expected_filename, diff --git a/docutils/tools/buildhtml.py b/docutils/tools/buildhtml.py index 798dca04b..5cd8ef706 100755 --- a/docutils/tools/buildhtml.py +++ b/docutils/tools/buildhtml.py @@ -241,7 +241,7 @@ class Builder: writer_name=pub_struct.writer_name, settings=settings) except ApplicationError: - error = sys.exc_info()[1] # get exception in Python <2.6 and 3.x + error = sys.exc_info()[1] # get exception in Python 3.x errout.write(' %s\n' % ErrorString(error)) diff --git a/docutils/tox.ini b/docutils/tox.ini index 19892b732..a539c9dcf 100644 --- a/docutils/tox.ini +++ b/docutils/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py33, py34, py35, py36, py37 +envlist = py{27,34,35,36,37} [testenv] commands = python test/alltests.py |
