python 2.3.1 issues DeprecationWarning for FCNTL when importing tempfile
Pierre Rouleau
prouleau at impathnetworks.com
Fri Oct 3 15:08:03 EDT 2003
>>I get the problem with right away in the python shell:
>>
>>D:\dev\python>python
>>Python 2.3.1 (#47, Sep 23 2003, 23:47:32) [MSC v.1200 32 bit (Intel)]
>>on win32
>>Type "help", "copyright", "credits" or "license" for more information.
>> >>> import tempfile
>>c:\python23\lib\fcntl.py:7: DeprecationWarning: the FCNTL module is
>
> ^^^^^^^^
> This is a bit bizarre; the file is really called FCNTL.py, right?
>
>
Yes. The file is old though:
C:\Python23\Lib>ls -l [fF]*.py
-rwxrwxrwa 1 Administrators None 418 May 9 2001 FCNTL.py
-rwxrwxrwa 1 Administrators None 10173 Sep 2 07:47 filecmp.py
-rwxrwxrwa 1 Administrators None 12732 Jan 8 2003 fileinput.py
-rwxrwxrwa 1 Administrators None 3126 Jul 13 18:06 fnmatch.py
-rwxrwxrwa 1 Administrators None 15548 Feb 27 2003 formatter.py
-rwxrwxrwa 1 Administrators None 4709 Jan 21 2001 fpformat.py
-rwxrwxrwa 1 Administrators None 27589 Jun 3 2002 ftplib.py
I wonder if FCNTL.py is a valid file. Here is what it contains:
C:\Python23\Lib>cat FCNTL.py
cat FCNTL.py
"""Backward-compatibility version of FCNTL; export constants exported by
fcntl, and issue a deprecation warning.
"""
import warnings
warnings.warn("the FCNTL module is deprecated; please use fcntl",
DeprecationWarning)
# Export the constants known to the fcntl module:
from fcntl import *
# and *only* the constants:
__all__ = [s for s in dir() if s[0] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
C:\Python23\Lib>
----
BTW, I solved the problem by deleting the fcntl.pyc. See my other post
below.
Thanks for your help!
More information about the Python-list
mailing list