roskakori / cutplace

validate data stored in CSV, PRN, ODS or Excel files
http://cutplace.readthedocs.org/
GNU Lesser General Public License v3.0
18 stars 20 forks source link

Preserve support for Python 2.6+ #61

Closed roskakori closed 9 years ago

roskakori commented 10 years ago

Goal: even after migration to Python 3 (#56), the code still works with Python 2.6+.

Notes on how to achieve this:

  from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals

Instead of six and _compat we could also use future available from https://pypi.python.org/pypi/future.

roskakori commented 9 years ago

Note: I modified this ticket to cover all issues concerning the back port to Python 2 as this will be an ongoing topic for the weeks to come.

roskakori commented 9 years ago

Current status: all modules have from __future__ imports, 128 test pass and 28 fail when running tox -e py27.

Most of the failed test should be fixable by using six.text_type or considering the u'...' prefix for unicode strings when comparing expected error messages.

roskakori commented 9 years ago

All test pass with Python 2.6 and Python 2.7.