MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / file_requires_unicode

Function file_requires_unicode

lib/matplotlib/cbook.py:522–532  ·  view source on GitHub ↗

Return whether the given writable file-like object requires Unicode to be written to it.

(x)

Source from the content-addressed store, hash-verified

520
521
522def file_requires_unicode(x):
523 """
524 Return whether the given writable file-like object requires Unicode to be
525 written to it.
526 """
527 try:
528 x.write(b'')
529 except TypeError:
530 return True
531 else:
532 return False
533
534
535def to_filehandle(fname, flag='r', return_opened=False, encoding=None):

Callers 2

_print_figureMethod · 0.90

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…