[Python-Dev] Kill FCNTL.py

Tim Peters tim.one at comcast.net
Sat Jul 17 07:50:45 CEST 2004

Can we get rid of Lib/FCNTL.py for 2.4?  AFAICT, its existence does nothing
but create obscure problems for Windows users.  For an old example, in

    import fcntl as _fcntl
    # If PYTHONCASEOK is set on Windows, stinking FCNTL.py gets
    # imported, and we don't get an ImportError then.  Provoke
    # an AttributeError instead in that case.
except (ImportError, AttributeError):

For an example from yesterday:


I don't know all the ways this happens, but a surprising number of Windows
users end up with a file named:


in their Lib directories, and then tons of things break, because imports of
fcntl pick that up instead of getting the ImportError cross-platform code
expects on Windows.

I know that one persistent user traced this to one of the Python-aware
installer-builders creating allupper.pyc files from ALLUPPER.py files on
Windows, but it's not worth the effort of tracking this down:  since the day
it was introduced, FCNTL.py has generated a deprecation warning telling you
to use fcntl instead.  The builtin fcntl was introduced in 1.5a3.  Enough
already <wink>.

More information about the Python-Dev mailing list