[ python-Bugs-994605 ] fcntl example is broken

SourceForge.net noreply at sourceforge.net
Tue Jul 20 17:54:52 CEST 2004


Bugs item #994605, was opened at 2004-07-20 15:54
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=994605&group_id=5470

Category: Documentation
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Green (chrisgreen)
Assigned to: Nobody/Anonymous (nobody)
Summary: fcntl example is broken

Initial Comment:
http://www.python.org/doc/current/lib/module-fcntl.html
import os,struct, fcntl
f = open(".zshrc", "r+")
rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NDELAY)
lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0,
0, 0, 0)
rv = fcntl.fcntl(f,
                 fcntl.F_SETLKW,
                 lockdata)

It was missing an os import and was directly calling
the module 


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=994605&group_id=5470


More information about the Python-bugs-list mailing list