473,325 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

python 2.3.1 issues DeprecationWarning for FCNTL when importing tempfile

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
6 3795
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
>>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
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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rami A. Kishek | last post by:
Please help! Very strange installation problem. First, let me say I successfully installed and use Python 2.2.3 and 2.3 from the EXE binaries on a win ME machine. That machine previously had...
1
by: hellprout | last post by:
hi , i want to use mcmillan installer 5_5b5 with python 2.3 so , no problem when i compil this prog but when i'm using installer i have an error D:\Python23\lib\fcntl.py:7:...
0
by: Ryan Grow | last post by:
Hi, I'm trying to use fcntl to set an existing file descriptor to be nonblocking. This contrived example exhibits the behavior of python that is preventing me from doing this: import os,...
6
by: Lex Hider | last post by:
Hi, Apologies if this is against etiquette. I've just got my first python app up and running. It is a podcast aggregator depending on feedparser. I've really only learnt enough to get this up and...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 342 open (-38) / 3712 closed (+54) / 4054 total (+16) Bugs : 951 open (-14) / 6588 closed (+33) / 7539 total (+19) RFE : 257 open...
2
by: xucs007 | last post by:
I ran following 2 programs (lock1, lock2) at almost same time, to write either "123456", or "222" to file "aaa" at the same time. But I often just got "222456" in "aaa" . Is this a bug of python...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.