[docs] flags is not a parameter in open

Gert gert at fenlogic.com
Mon Aug 18 14:47:18 CEST 2014


https://docs.python.org/3.0/library/os.html.
says this:
The following constants are options for the /flags/ parameter to the 
open() <https://docs.python.org/3.0/library/functions.html#open> function.
...
os.O_NDELAY

When I follow the link to the open function it does NOT have a flags 
parameter:
open(/file/[, /mode='r'/[, /buffering=None/[, /encoding=None/[, 
/errors=None/[, /newline=None/[, /closefd=True/]]]]]])¶ 
<https://docs.python.org/3.0/library/functions.html#open>


I am trying to solve this:
My C-code uses: fd = open("/dev/ttyAMA0",O_RDW|O_NDELAY)

the equivalent code in python3 (Raspberry-Pi)  gives an error:
fd = open("/dev/ttyAMA0",os.O_RDW|os.O_NDELAY)
open() second argument must be str, not int


-- Gert

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20140818/108b8355/attachment.html>


More information about the docs mailing list