Skip to content

Commit d94c13b

Browse files
jdufresnedan-blanchard
authored andcommitted
Drop support for Python 2.6 (chardet#143)
Python 2.6 and 3.3 is EOL and is no longer receiving bug fixes, including security fixes. https://snarky.ca/stop-using-python-2-6/ http://www.curiousefficiency.org/posts/2015/04/stop-supporting-python26.html Fixes chardet#133
1 parent c4c1ba0 commit d94c13b

File tree

5 files changed

+16
-22
lines changed

5 files changed

+16
-22
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
language: python
22
sudo: false
33
python:
4-
- 2.6
54
- 2.7
6-
- 3.3
75
- 3.4
86
- 3.5
97
- 3.6
@@ -20,8 +18,6 @@ env:
2018
install:
2119
- travis_retry pip install --upgrade pip
2220
- travis_retry pip install --upgrade --upgrade-strategy only-if-needed pytest pytest-catchlog
23-
# Hypothesis doesn't work on 2.6
24-
- if [ $TRAVIS_PYTHON_VERSION != "2.6" ]; then travis_retry pip install hypothesis; fi
2521
- pip install .
2622

2723
# Run test

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Detects
3232
Our ISO-8859-2 and windows-1250 (Hungarian) probers have been temporarily
3333
disabled until we can retrain the models.
3434

35-
Requires Python 2.6, 2.7, or 3.3+.
35+
Requires Python 2.7 or 3.4+.
3636

3737
Installation
3838
------------
@@ -63,6 +63,6 @@ This is a continuation of Mark Pilgrim's excellent chardet. Previously, two
6363
versions needed to be maintained: one that supported python 2.x and one that
6464
supported python 3.x. We've recently merged with `Ian Cordasco <https://github.com/sigmavirus24>`_'s
6565
`charade <https://github.com/sigmavirus24/charade>`_ fork, so now we have one
66-
coherent version that works for Python 2.6+.
66+
coherent version that works for Python 2.7+ and 3.4+.
6767

6868
:maintainer: Dan Blanchard

bench.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626

2727
# TODO: Restore Hungarian encodings (iso-8859-2 and windows-1250) after we
2828
# retrain model.
29-
MISSING_ENCODINGS = set(['iso-8859-2', 'iso-8859-6', 'windows-1250',
30-
'windows-1254', 'windows-1256'])
31-
EXPECTED_FAILURES = set(['tests/iso-8859-7-greek/disabled.gr.xml',
32-
'tests/iso-8859-9-turkish/divxplanet.com.xml',
33-
'tests/iso-8859-9-turkish/subtitle.srt',
34-
'tests/iso-8859-9-turkish/wikitop_tr_ISO-8859-9.txt'])
29+
MISSING_ENCODINGS = {'iso-8859-2', 'iso-8859-6', 'windows-1250',
30+
'windows-1254', 'windows-1256'}
31+
EXPECTED_FAILURES = {'tests/iso-8859-7-greek/disabled.gr.xml',
32+
'tests/iso-8859-9-turkish/divxplanet.com.xml',
33+
'tests/iso-8859-9-turkish/subtitle.srt',
34+
'tests/iso-8859-9-turkish/wikitop_tr_ISO-8859-9.txt'}
3535

3636
def get_py_impl():
3737
"""Return what kind of Python this is"""

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from setuptools import find_packages, setup
66

77

8-
needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv)
8+
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
99
pytest_runner = ['pytest-runner'] if needs_pytest else []
1010

1111

@@ -39,10 +39,8 @@ def readme():
3939
"Operating System :: OS Independent",
4040
"Programming Language :: Python",
4141
'Programming Language :: Python :: 2',
42-
'Programming Language :: Python :: 2.6',
4342
'Programming Language :: Python :: 2.7',
4443
'Programming Language :: Python :: 3',
45-
'Programming Language :: Python :: 3.3',
4644
'Programming Language :: Python :: 3.4',
4745
'Programming Language :: Python :: 3.5',
4846
'Programming Language :: Python :: 3.6',

test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626

2727
# TODO: Restore Hungarian encodings (iso-8859-2 and windows-1250) after we
2828
# retrain model.
29-
MISSING_ENCODINGS = set(['iso-8859-2', 'iso-8859-6', 'windows-1250',
30-
'windows-1254', 'windows-1256'])
31-
EXPECTED_FAILURES = set(['tests/iso-8859-7-greek/disabled.gr.xml',
32-
'tests/iso-8859-9-turkish/divxplanet.com.xml',
33-
'tests/iso-8859-9-turkish/subtitle.srt',
34-
'tests/iso-8859-9-turkish/wikitop_tr_ISO-8859-9.txt'])
29+
MISSING_ENCODINGS = {'iso-8859-2', 'iso-8859-6', 'windows-1250',
30+
'windows-1254', 'windows-1256'}
31+
EXPECTED_FAILURES = {'tests/iso-8859-7-greek/disabled.gr.xml',
32+
'tests/iso-8859-9-turkish/divxplanet.com.xml',
33+
'tests/iso-8859-9-turkish/subtitle.srt',
34+
'tests/iso-8859-9-turkish/wikitop_tr_ISO-8859-9.txt'}
3535

3636
def gen_test_params():
3737
"""Yields tuples of paths and encodings to use for test_encoding_detection"""
@@ -143,4 +143,4 @@ def test_detect_all_and_detect_one_should_agree(txt, enc, rnd):
143143
results = chardet.detect_all(data)
144144
assert result['encoding'] == results[0]['encoding']
145145
except Exception:
146-
raise Exception('%s != %s' % (result, results))
146+
raise Exception('%s != %s' % (result, results))

0 commit comments

Comments
 (0)