class documentation
class LazyFile: (source)
A lazy file works like a regular file but it does not fully open the file but it does perform some basic checks early to see if the filename parameter does make sense. This is useful for safely opening files for writing.
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __getattr__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | close |
Closes the underlying file, no matter what. |
Method | close |
This function only closes the file if it was opened by the lazy file wrapper. For instance this will never close stdin. |
Method | open |
Opens the file if it's not yet open. This call might fail with a :exc:`FileError`. Not handling this error will produce an error that Click shows. |
Instance Variable | atomic |
Undocumented |
Instance Variable | encoding |
Undocumented |
Instance Variable | errors |
Undocumented |
Instance Variable | mode |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | should |
Undocumented |
Instance Variable | _f |
Undocumented |
Undocumented
Parameters | |
filename:str | Undocumented |
mode:str | Undocumented |
encoding:t.Optional[ | Undocumented |
errors:t.Optional[ | Undocumented |
atomic:bool | Undocumented |
This function only closes the file if it was opened by the lazy file wrapper. For instance this will never close stdin.
Opens the file if it's not yet open. This call might fail with a :exc:`FileError`. Not handling this error will produce an error that Click shows.
Returns | |
t.IO | Undocumented |