matthewatabet
matthewatabet

Reputation: 1481

Does gevent.monkey.patch_all() patch file objects?

I noticed that gevent supports wrappers for file-like objects: http://www.gevent.org/gevent.fileobject.html

gevent.monkey.patch_all conveniently patches modules like socket and time to make them gevent friendly. Reading the code, it doesn't seem like patch_all() calls an explicit patch_file() but it does call patch_builtins(). The implementation of this function is somewhat magical. It's not clear to me whether this would patch the built-in file objects.

Does anyone know?

Upvotes: 0

Views: 431

Answers (1)

DevShark
DevShark

Reputation: 9122

No, the built in file is not patched. You need to use gevent FileObject.

Upvotes: 1

Related Questions