(data)
| 768 | return |
| 769 | |
| 770 | def write(data): |
| 771 | if not isinstance(data, basestring): |
| 772 | data = str(data) |
| 773 | # If the file has an encoding, encode unicode with it. |
| 774 | if (isinstance(fp, file) and |
| 775 | isinstance(data, unicode) and |
| 776 | fp.encoding is not None): |
| 777 | errors = getattr(fp, "errors", None) |
| 778 | if errors is None: |
| 779 | errors = "strict" |
| 780 | data = data.encode(fp.encoding, errors) |
| 781 | fp.write(data) |
| 782 | want_unicode = False |
| 783 | sep = kwargs.pop("sep", None) |
| 784 | if sep is not None: |
no test coverage detected
searching dependent graphs…