Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
fcntl O_NDELAY constant not found in python 2.3 on linux
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Ryan Grow, post: 1747364"] 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, fcntl, FCNTL file = open("/tmp/testfd.txt", 'w') fd = file.fileno() fl = fcntl.fcntl(fd, FCNTL.F_GETFL) fcntl.fcntl(fd, FCNTL.F_SETFL, fl | FCNTL.O_NDELAY) print "Made it!" When I run this in the following environment, it works fine: Linux Kernel 2.4.7-10 python 2.1.1 [rgrow@linux01 python]$ /usr/bin/python2.1 ../testfcntl.py Made it! However, when I run this with either python 2.3.2 or 2.3.3, I get the following output: [rgrow@linux01 python]$ python ./testfcntl.py /usr/local/lib/python2.3/FCNTL.py:7: DeprecationWarning: the FCNTL module is deprecated; please use fcntl DeprecationWarning) Traceback (most recent call last): File "./testfcntl.py", line 6, in ? fcntl.fcntl(fd, FCNTL.F_SETFL, fl | FCNTL.O_NDELAY) AttributeError: 'module' object has no attribute 'O_NDELAY' What is the correct way that I should be making this kind of a call in 2.3 to both avoid the deprecation warning as well as the attribute error? Thanks, Ryan __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! [URL]http://webhosting.yahoo.com/ps/sb/[/URL] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
fcntl O_NDELAY constant not found in python 2.3 on linux
Top