By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,558 Members | 1,607 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,558 IT Pros & Developers. It's quick & easy.

python 2.3.1 issues DeprecationWarning for FCNTL when importing tempfile

P: n/a
Hi all!

I am using Python 2.3.1 on Win32 (NT, 2000).

Whenever a file imports the standard tempfile module, Python 2.3.1
issues the following warning:

C:\Python23\lib\fcntl.py:7: DeprecationWarning: the FCNTL module is
Deprecated; please use fcntl DeprecationWarning).

A quick look into tempfile.py show that it does import fcnt. Python 2.3
tempfile documentation says that it was changed. Was the use of fcntl()
forgotten? Is this a bug?

Thanks for your time.

Pierre

Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Pierre Rouleau <pr******@impathnetworks.com> writes:
Hi all!

I am using Python 2.3.1 on Win32 (NT, 2000).

Whenever a file imports the standard tempfile module, Python 2.3.1
issues the following warning:

C:\Python23\lib\fcntl.py:7: DeprecationWarning: the FCNTL module is
Deprecated; please use fcntl DeprecationWarning).

A quick look into tempfile.py show that it does import fcnt. Python
2.3 tempfile documentation says that it was changed. Was the use of
fcntl() forgotten? Is this a bug?


Do you have the environment variable PYTHONCASEOK set? You probably
don't want to...

Cheers,
mwh

--
The "of course, while I have no problem with this at all, it's
surely too much for a lesser being" flavor of argument always
rings hollow to me. -- Tim Peters, 29 Apr 1998
Jul 18 '05 #2

P: n/a
>>Whenever a file imports the standard tempfile module, Python 2.3.1
issues the following warning:

C:\Python23\lib\fcntl.py:7: DeprecationWarning: the FCNTL module is
Deprecated; please use fcntl DeprecationWarning).

A quick look into tempfile.py show that it does import fcnt. Python
2.3 tempfile documentation says that it was changed. Was the use of
fcntl() forgotten? Is this a bug?

Do you have the environment variable PYTHONCASEOK set? You probably
don't want to...


No, PYTHONCASEOK is not set.

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
deprecated; please use fcntl
DeprecationWarning)
import os
'PYTHONCASEOK' in os.environ False
I also tried it within PythonWin: same result.
PythonWin 2.3.1 (#47, Sep 23 2003, 23:47:32) [MSC v.1200 32 bit (Intel)]
on win32.
Portions Copyright 1994-2001 Mark Hammond (mh******@skippinet.com.au) -
see 'Help/About PythonWin' for further copyright information. import tempfile C:\Python23\lib\fcntl.py:7: DeprecationWarning: the FCNTL module is
deprecated; please use fcntl
DeprecationWarning) import os
'PYTHONCASEOK' in os.environ False


I did not edit any of the files in the Python library. It does the same
on WinNT and Win2000 but i also tried it on a XP machine and the problem
is not on the XP machine. But the source is the same on the XP machine
(the FCNTL.py and tempfile.py) and the NT and 2000 machines.

I am starting to wonder if the problem is caused by a package that was
installed on one set of machines and not the other.

Thanks!

Pierre

Jul 18 '05 #3

P: n/a
Pierre Rouleau <pr******@impathnetworks.com> writes:
Whenever a file imports the standard tempfile module, Python 2.3.1
issues the following warning:

C:\Python23\lib\fcntl.py:7: DeprecationWarning: the FCNTL module is
Deprecated; please use fcntl DeprecationWarning).

A quick look into tempfile.py show that it does import fcnt. Python
2.3 tempfile documentation says that it was changed. Was the use of
fcntl() forgotten? Is this a bug? Do you have the environment variable PYTHONCASEOK set? You probably
don't want to...


No, PYTHONCASEOK is not set.


Hmm, weird.
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?
I did not edit any of the files in the Python library. It does the
same on WinNT and Win2000 but i also tried it on a XP machine and the
problem is not on the XP machine. But the source is the same on the
XP machine (the FCNTL.py and tempfile.py) and the NT and 2000 machines.

I am starting to wonder if the problem is caused by a package that was
installed on one set of machines and not the other.


Could be. I've reached the outer edge of my windows knowledge (not
very far, you'll notice), so I hope another reader can get you
further...

Cheers,
mwh

--
You're posting to a Scheme group. Around here, arguing that Java is
better than C++ is like arguing that grasshoppers taste better than
tree bark. -- Thant Tessman, comp.lang.scheme
Jul 18 '05 #4

P: n/a

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!

Jul 18 '05 #5

P: n/a
Pierre Rouleau <pr******@impathnetworks.com> writes:
BTW, I solved the problem by deleting the fcntl.pyc. See my other
post below.


Actaully, I read this thread completely out of order, but glad to see
you got it sorted. Definitely a good mystery!

Cheers,
mwh

--
I have a feeling that any simple problem can be made arbitrarily
difficult by imposing a suitably heavy administrative process
around the development. -- Joe Armstrong, comp.lang.functional
Jul 18 '05 #6

P: n/a
Michael Hudson wrote:

Pierre Rouleau <pr******@impathnetworks.com> writes:
BTW, I solved the problem by deleting the fcntl.pyc. See my other
post below.


use McMillan installer on Windows, too, and I've also been getting
these messages. Didn't know they were fixable until reading this
thread. I was getting two sets of messages, one for fcntl and one
for termios. Each of these had a *.py, a *.pyc, and a *.pyo in the
python\Lib folder. Deleting them all seems to fix it.

Al
Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.