Skip to contents

Only the mode argument of an open() call counts: the second positional argument, or mode =. A mode is a write when it is w, a, x or r+, with b, t or +. Any quoted word with a w, a or x in it used to count, so open(p, encoding = "ascii") was a write and open(p, "r+") was not (U240).

Usage

.py_open_writes(line)

Arguments

line

one line of Python code, comments removed

Value

TRUE when an open() call on the line has a write mode