Form feed (^L) characters in source code interfer with 2to3 conversion.

Bug #879189 reported by Denis Zawada
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flufl.enum
Won't Fix
Undecided
Unassigned
pylandro-collections-range
Trunk
Invalid
Critical
Unassigned

Bug Description

>>> open('_enum.py', 'r', encoding='utf-8').read().count('\x0c')
4

The 2to3 conversion completes without any errors, however nothing is converted and outputted after the first occurrence of line feed character. Those characters can be found in the very first commit in munepy source code.

In a brand new installation (pip install flufl.enum==3.2) in virtualenv with Python 3.2 this results in the following error:

>>> import flufl.enum
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "$VIRTUALENV/lib/python3.2/site-packages/flufl/enum/__init__.py", line 32, in <module>
    from ._enum import Enum, make_enum
ImportError: cannot import name Enum

Revision history for this message
Barry Warsaw (barry) wrote :

This is actually a bug in Python 3.2 which was fixed in Python 3.3 (development version) but accidentally not back-ported in time to make it to Python 3.2.2.

http://bugs.python.org/issue11250

I back ported it so it will make it into Python 3.2.3, though there's no ETA for that yet. I'm disinclined to remove the formfeeds from flufl.enum to worm around this Python bug.

Changed in flufl.enum:
status: New → Won't Fix
Revision history for this message
Barry Warsaw (barry) wrote :

Is there some other way you could work around this problem?

Revision history for this message
Denis Zawada (ohdeno) wrote :

I’m just curious, what is their purpose? It’s first I see those in any source code.

I’ll just repackage the latest stable release and include a note about this bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.