This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author barry
Recipients barry
Date 2010-04-23.12:31:13
SpamBayes Score 9.0113974e-07
Marked as misclassified No
Message-id <1272025875.68.0.994022757539.issue8505@psf.upfronthosting.co.za>
In-reply-to
Content
Lines such as the following are removed by fix_future.py in 2to3

from __future__ import absolute_import, unicode_literals

I think this is unnecessary and I have a case where it causes problems.  It's unnecessary because this import is essentially a no-op in Python 3, so it does no harm, and serves no actual useful purpose to remove.  It causes harm because of a common idiom in doctest setups:

def setup(testobj):
    """Test setup."""
    # Make sure future statements in our doctests match the Python code.
    testobj.globs['absolute_import'] = absolute_import
    testobj.globs['unicode_literals'] = unicode_literals

fix_future.py removes the import so these cause NameErrors.  Sure, I can wrap them in try/excepts, but still what's the point of fix_future?
History
Date User Action Args
2010-04-23 12:31:15barrysetrecipients: + barry
2010-04-23 12:31:15barrysetmessageid: <1272025875.68.0.994022757539.issue8505@psf.upfronthosting.co.za>
2010-04-23 12:31:14barrylinkissue8505 messages
2010-04-23 12:31:13barrycreate